<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>progressbas yapmak arşivleri - Ertan Dönmez</title>
	<atom:link href="https://www.ertandonmez.org/tag/progressbas-yapmak/feed/" rel="self" type="application/rss+xml" />
	<link></link>
	<description>Ertan Dönmez Kişisel Blog Sitesi.</description>
	<lastBuildDate>Sun, 28 Mar 2010 15:42:15 +0000</lastBuildDate>
	<language>tr</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0</generator>
	<item>
		<title>Visual Basic Üç Boyutlu ve Rengarenk ProgressBar Yapımı</title>
		<link>https://www.ertandonmez.org/visual-basic-uc-boyutlu-ve-rengarenk-progressbar-yapimi/</link>
					<comments>https://www.ertandonmez.org/visual-basic-uc-boyutlu-ve-rengarenk-progressbar-yapimi/#respond</comments>
		
		<dc:creator><![CDATA[Ertan]]></dc:creator>
		<pubDate>Sun, 28 Mar 2010 15:42:15 +0000</pubDate>
				<category><![CDATA[Kategorisizler]]></category>
		<category><![CDATA[3d]]></category>
		<category><![CDATA[progressbar]]></category>
		<category><![CDATA[progressbas yapmak]]></category>
		<category><![CDATA[vb]]></category>
		<category><![CDATA[vb progressbar yapımı]]></category>
		<category><![CDATA[visual basic]]></category>
		<category><![CDATA[visual basicde 3 boyutlu progressbar yapmak]]></category>
		<guid isPermaLink="false">https://www.ertandonmez.org/?p=234</guid>

					<description><![CDATA[<p>Hazırlık Yapacağımız kontrol nesnesini EXE projesi içinde kullacağız. Dilerseniz yeni bir ActiveControl projesinde OCX olarak hazırlayabilirsiniz. Öncelikle yeni bir EXE projesi açıp, projeye bir tane UserControl ve iki tane Modul ekleyin. Aşağıda anlattığımız projede kullandığımız objelere aşağıdaki isimleri verdik. Anlatım süresince bu isimleri kullanıcaz. Form: Form1 UserControl: GBProgressBar Module: mdlDrawing Module: mdlRGBHSL UserControl: GBProgressBar UserControl [&#8230;]</p>
<p><a href="https://www.ertandonmez.org/visual-basic-uc-boyutlu-ve-rengarenk-progressbar-yapimi/">Visual Basic Üç Boyutlu ve Rengarenk ProgressBar Yapımı</a> yazısı ilk önce <a href="https://www.ertandonmez.org">Ertan Dönmez</a> üzerinde ortaya çıktı.</p>
]]></description>
										<content:encoded><![CDATA[<p><img fetchpriority="high" decoding="async" class="alignleft" src="https://www.ertandonmez.org/wp-content/uploads/VisualBasicLogo.gif" alt="visual basic logo" width="337" height="159" />Hazırlık<br />
Yapacağımız kontrol nesnesini EXE projesi içinde  kullacağız.<br />
Dilerseniz yeni bir ActiveControl projesinde OCX olarak<br />
hazırlayabilirsiniz.<br />
Öncelikle  yeni bir EXE projesi açıp, projeye bir tane UserControl<br />
ve iki tane  Modul ekleyin. Aşağıda anlattığımız projede kullandığımız objelere aşağıdaki isimleri  verdik. Anlatım süresince bu isimleri kullanıcaz.<span id="more-234"></span><br />
Form:  Form1<br />
UserControl: GBProgressBar<br />
Module: mdlDrawing<br />
Module:  mdlRGBHSL<br />
UserControl: GBProgressBar<br />
UserControl  nesnesinin ismini &#8220;GBProgressBar&#8221; olarak kullandık.<br />
Bu kontrol  nesnesi, Toolbar bölümünde varsayılan icon resmi<br />
ile gözükecektir.  Biz bu ikonu kendi hazırladığımız resimle<br />
değiştireceğiz.<br />
UserControl&#8217;un  ScaleMode özelliğini pixel olarak tanımlayın ve AutoRedraw<br />
özelliğini  ise True yapın.<br />
Mouse, Toolbardaki bu kontrol üzerine  geldiğinde, hatırlatma<br />
balonu çıkacak ve vermiş olduğunuz  &#8220;GBProgressBar&#8221; ismi gözükecektir.<br />
Toolbar&#8217;daki iconu değiştirmek  için, UserControl nesnesinin &#8220;ToolboxBitmap&#8221;<br />
özelliğine kendi  hazırladığımız resmi seçeceğiz. Bu resim 16&#215;15 pixel<br />
boyutlarında  olmalı ve &#8220;1, 15&#8221; koordinatlarındaki renk değeri maskeleme için<br />
kullanılacaktır.  Yani &#8220;x=1, y=15&#8221; koordinatlarındaki renk değeri siyah ise<br />
bu resim  içinde kullandığınız tüm siyah renkler maskelenecektir.<br />
UserControl  nesnesinin kod bölümüne geçelim ve bu kontrol içinde kullanacağımız<br />
özellikleri  saklayan değişkenleri tanımlayalım. Bu alanda &#8220;eProgressScrolling&#8221;<br />
isimli  bir enum olusturuyoruz. Enum ile ilgili açıklama dökümanın ilerleyen<br />
bölümlerinde  verilecektir.<br />
&#8216; ProgressBar&#8217;ın görünüm değerleri<br />
Public  Enum eProgressScrolling<br />
pbScrollingStandard = 0<br />
pbScrollingSmooth =  1<br />
End Enum<br />
Dim m_nFaceColor As OLE_COLOR &#8216; önplan rengi<br />
Dim  m_nBackColor As OLE_COLOR &#8216; arkaplan rengi<br />
Dim m_nMax As Long &#8216;  maximum progress değeri<br />
Dim m_nMin As Long &#8216; minimum progress değeri<br />
Dim  m_nValue As Long &#8216; progress in çalışma anındaki değeri<br />
Dim  m_bEnabled As Boolean &#8216; progress&#8217;in kullanılabilirlik değeri<br />
Dim  m_nScrolling As eProgressScrolling &#8216; görünümü<br />
İlk olarak,  hazırladığımız UserControl&#8217;ü formunuza eklediğinizde<br />
varsayılan  değerleri &#8220;UserControl_Initialize&#8221; bölümünde belirtiyoruz.<br />
Private  Sub UserControl_Initialize()<br />
m_nMax = 100<br />
m_nFaceColor = vbGreen<br />
m_nBackColor  = vbButtonFace<br />
m_nValue = 0<br />
m_nScrolling = pbScrollingStandard<br />
End  Sub<br />
Bir de &#8220;UserControl_InitProperties&#8221; olayı vardır.<br />
Bu  olay &#8220;UserControl_Initialize&#8221; dan sonra çalışır ve &#8220;Ambient&#8221; kullanımına<br />
izin  verir. Sadece yazmakta olduğumuz &#8220;UserControl&#8221; nesnesi herhangi bir<br />
forma  eklendiğinde çalışır.<br />
örn: Kontrolü forma eklediğimizde,  kontrolün arkaplan renginin, form ile<br />
aynı olmasını istiyorsak. Bu  bölüme aşağıdaki kodlar eklenebilir.<br />
Private Sub  UserControl_InitProperties()<br />
&#8216;Bu işlem UserControl_Initialize da  yapılamaz.<br />
m_nBackColor = Ambient.BackColor<br />
End Sub<br />
Yukarıda  tanımlanan değişkenleri UserControl dışından kullanabilmemiz için<br />
kontrole  özellikler eklememiz gerekmektedir.<br />
Public Property Get  FaceColor() As OLE_COLOR<br />
FaceColor = m_nFaceColor<br />
End Property<br />
Public  Property Let FaceColor(ByVal newVal As OLE_COLOR)<br />
m_nFaceColor =  newVal<br />
Call DrawProgress<br />
End Property<br />
Public Property Get  BackColor() As OLE_COLOR<br />
BackColor = m_nBackColor<br />
End Property<br />
Public  Property Let BackColor(ByVal newVal As OLE_COLOR)<br />
m_nBackColor =  newVal<br />
Call DrawProgress<br />
End Property<br />
*<br />
*<br />
*<br />
Her  özelliği değiştirdiğiminde kontrolü &#8220;DrawProgress&#8221; alt programı<br />
ile  tekrar çiziyoruz.<br />
Private Sub DrawProgress()<br />
Dim nVal As  Long<br />
UserControl.Cls<br />
nVal = (UserControl.ScaleWidth &#8211; 4)<br />
UserControl.BackColor  = m_nBackColor<br />
If Ambient.UserMode Then<br />
nVal =  ((UserControl.ScaleWidth &#8211; 4) / (m_nMax &#8211; m_nMin)) * (m_nValue &#8211; m_nMin)<br />
End  If<br />
Call DrawDegrade(UserControl.hdc, 2, 2, nVal,  (UserControl.ScaleHeight &#8211; 4), (UserControl.ScaleWidth &#8211; 4),  m_nFaceColor, m_nScrolling)<br />
Call DrawEdgeEx(UserControl.hdc, 0, 0,  UserControl.ScaleWidth, UserControl.ScaleHeight)<br />
If  UserControl.AutoRedraw Then UserControl.*******<br />
End Sub<br />
Yukarıdaki  kodda &#8220;Ambient.UserMode&#8221; değeri, uygulama çalıştırıldığında<br />
&#8220;True&#8221;  olur. Normalde kontrol forma eklendiğinde &#8220;Value&#8221; değerini maximum<br />
olarak  gösterip, progress&#8217;in tamamını çizerek kullanıcıya göstermek<br />
amacıyla  kullanılmıştır. Kodu kullanırken daha net anlayacaksınız.<br />
UserControl&#8217;ün  tüm kodları aşağıda sunulmuştur.<br />
&#8216; Author: Gökhan ERDOĞDU<br />
&#8216;  Date : 03.06.2009<br />
&#8216; mail : gokhan_erdogdu@yahoo.com<br />
&#8216; Copyright ©  2009 GBSoftware<br />
Option Explicit<br />
Public Enum  eProgressScrolling<br />
pbScrollingStandard = 0<br />
pbScrollingSmooth = 1<br />
End  Enum<br />
Dim m_nFaceColor As OLE_COLOR<br />
Dim m_nBackColor As  OLE_COLOR<br />
Dim m_nMax As Long<br />
Dim m_nMin As Long<br />
Dim m_nValue As  Long<br />
Dim m_bEnabled As Boolean<br />
Dim m_nScrolling As  eProgressScrolling<br />
Public Event Click()<br />
Public Event  MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)<br />
Public  Event MouseMove(Button As Integer, Shift As Integer, x As Single, y As  Single)<br />
Public Event MouseUp(Button As Integer, Shift As Integer, x  As Single, y As Single)<br />
Private Sub DrawProgress()<br />
Dim nVal As  Long<br />
UserControl.Cls<br />
nVal = (UserControl.ScaleWidth &#8211; 4)<br />
UserControl.BackColor  = m_nBackColor<br />
If Ambient.UserMode Then<br />
nVal =  ((UserControl.ScaleWidth &#8211; 4) / (m_nMax &#8211; m_nMin)) * (m_nValue &#8211; m_nMin)<br />
End  If<br />
Call DrawDegrade(UserControl.hdc, 2, 2, nVal,  (UserControl.ScaleHeight &#8211; 4), (UserControl.ScaleWidth &#8211; 4),  m_nFaceColor, m_nScrolling)<br />
Call DrawEdgeEx(UserControl.hdc, 0, 0,  UserControl.ScaleWidth, UserControl.ScaleHeight)<br />
If  UserControl.AutoRedraw Then UserControl.*******<br />
End Sub<br />
Private  Sub UserControl_Click()<br />
If Not m_bEnabled Then Exit Sub<br />
RaiseEvent  Click<br />
End Sub<br />
Private Sub UserControl_InitProperties()<br />
m_nBackColor  = Ambient.BackColor<br />
End Sub<br />
Private Sub  UserControl_MouseDown(Button As Integer, Shift As Integer, x As Single, y  As Single)<br />
If Not m_bEnabled Then Exit Sub<br />
RaiseEvent  MouseDown(Button, Shift, x, y)<br />
End Sub<br />
Private Sub  UserControl_MouseMove(Button As Integer, Shift As Integer, x As Single, y  As Single)<br />
If Not m_bEnabled Then Exit Sub<br />
RaiseEvent  MouseMove(Button, Shift, x, y)<br />
End Sub<br />
Private Sub  UserControl_MouseUp(Button As Integer, Shift As Integer, x As Single, y  As Single)<br />
If Not m_bEnabled Then Exit Sub<br />
RaiseEvent  MouseUp(Button, Shift, x, y)<br />
End Sub<br />
Private Sub  UserControl_Initialize()<br />
m_nMax = 100<br />
m_nFaceColor = vbGreen<br />
m_nBackColor  = vbButtonFace<br />
m_nValue = 0<br />
m_nScrolling = pbScrollingStandard<br />
End  Sub<br />
Private Sub UserControl_ReadProperties(PropBag As  PropertyBag)<br />
m_nFaceColor = PropBag.ReadProperty(&#8220;FaceColor&#8221;,  vbGreen)<br />
m_nBackColor = PropBag.ReadProperty(&#8220;BackColor&#8221;,  vbButtonFace)<br />
m_nMax = PropBag.ReadProperty(&#8220;Max&#8221;, 100)<br />
m_nMin =  PropBag.ReadProperty(&#8220;Min&#8221;, 0)<br />
m_nValue = m_nMin<br />
m_nScrolling =  PropBag.ReadProperty(&#8220;Scrolling&#8221;, pbScrollingStandard)<br />
m_bEnabled =  PropBag.ReadProperty(&#8220;Enabled&#8221;, True)<br />
Call DrawProgress<br />
End Sub<br />
Private  Sub UserControl_WriteProperties(PropBag As PropertyBag)<br />
Call  PropBag.WriteProperty(&#8220;FaceColor&#8221;, m_nFaceColor)<br />
Call  PropBag.WriteProperty(&#8220;BackColor&#8221;, m_nBackColor)<br />
Call  PropBag.WriteProperty(&#8220;Max&#8221;, m_nMax)<br />
Call  PropBag.WriteProperty(&#8220;Min&#8221;, m_nMin)<br />
Call  PropBag.WriteProperty(&#8220;Scrolling&#8221;, m_nScrolling)<br />
Call  PropBag.WriteProperty(&#8220;Enabled&#8221;, m_bEnabled)<br />
End Sub<br />
Private  Sub UserControl_Resize()<br />
Call DrawProgress<br />
End Sub<br />
Public  Property Get FaceColor() As OLE_COLOR<br />
FaceColor = m_nFaceColor<br />
End  Property<br />
Public Property Let FaceColor(ByVal newVal As OLE_COLOR)<br />
m_nFaceColor  = newVal<br />
Call DrawProgress<br />
End Property<br />
Public Property  Get BackColor() As OLE_COLOR<br />
BackColor = m_nBackColor<br />
End Property<br />
Public  Property Let BackColor(ByVal newVal As OLE_COLOR)<br />
m_nBackColor =  newVal<br />
Call DrawProgress<br />
End Property<br />
Public Property Get  Max() As Long<br />
Max = m_nMax<br />
End Property<br />
Public Property Let  Max(ByVal newVal As Long)<br />
If newVal &gt; m_nMin Then<br />
m_nMax =  newVal<br />
If m_nValue &gt; m_nMax Then m_nValue = m_nMax<br />
Call  DrawProgress<br />
Else<br />
VBA.Err.Raise 380, , &#8220;Invalid property value&#8221;<br />
End  If<br />
End Property<br />
Public Property Get Min() As Long<br />
Min =  m_nMin<br />
End Property<br />
Public Property Let Min(ByVal newVal As Long)<br />
If  newVal &lt; m_nMax Then<br />
m_nMin = newVal<br />
If m_nValue &lt; m_nMin  Then m_nValue = m_nMin<br />
Call DrawProgress<br />
Else<br />
VBA.Err.Raise  380, , &#8220;Invalid property value&#8221;<br />
End If<br />
End Property<br />
Public  Property Get Value() As Long<br />
Value = m_nValue<br />
End Property<br />
Public  Property Let Value(ByVal newVal As Long)<br />
If newVal &gt;= m_nMin And  newVal &lt;= m_nMax Then<br />
m_nValue = newVal<br />
Call DrawProgress<br />
Else<br />
VBA.Err.Raise  380, , &#8220;Invalid property value&#8221;<br />
End If<br />
End Property<br />
Public  Property Get Scrolling() As eProgressScrolling<br />
Scrolling =  m_nScrolling<br />
End Property<br />
Public Property Let Scrolling(ByVal  newVal As eProgressScrolling)<br />
m_nScrolling = newVal<br />
Call  DrawProgress<br />
End Property<br />
Public Property Get Enabled() As  Boolean<br />
Enabled = m_bEnabled<br />
End Property<br />
Public Property Let  Enabled(ByVal newVal As Boolean)<br />
m_bEnabled = newVal<br />
Call  DrawProgress<br />
End Property<br />
Module: mdlDrawing<br />
Çizim  işlemleri için kullandığımız fonksiyon ve api fonksiyonlarını<br />
bu  modülde tanımlıyoruz.<br />
&#8216; Author: Gökhan ERDOĞDU<br />
&#8216; Date :  03.06.2009<br />
&#8216; mail : gokhan_erdogdu@yahoo.com<br />
&#8216; Copyright © 2009  GBSoftware<br />
Option Explicit<br />
Private Const MAX_LUMINANCE =  &amp;HA0<br />
Private Const MIN_LUMINANCE = &amp;H3C<br />
Private Const  PROGRESS_PIE_WIDTH = 6<br />
Private Const BDR_RAISEDOUTER = &amp;H1<br />
Private  Const BDR_SUNKENOUTER = &amp;H2<br />
Private Const BDR_RAISEDINNER =  &amp;H4<br />
Private Const BDR_SUNKENINNER = &amp;H8<br />
Private Const  BDR_OUTER = &amp;H3<br />
Private Const BDR_INNER = &amp;HC<br />
Private  Const BDR_RAISED = &amp;H5<br />
Private Const BDR_SUNKEN = &amp;HA<br />
Private  Const EDGE_RAISED = (BDR_RAISEDOUTER Or BDR_RAISEDINNER)<br />
Private  Const EDGE_SUNKEN = (BDR_SUNKENOUTER Or BDR_SUNKENINNER)<br />
Private  Const EDGE_ETCHED = (BDR_SUNKENOUTER Or BDR_RAISEDINNER)<br />
Private  Const EDGE_BUMP = (BDR_RAISEDOUTER Or BDR_SUNKENINNER)<br />
Private  Const BF_LEFT = &amp;H1<br />
Private Const BF_TOP = &amp;H2<br />
Private  Const BF_RIGHT = &amp;H4<br />
Private Const BF_BOTTOM = &amp;H8<br />
Private  Const BF_TOPLEFT = (BF_TOP Or BF_LEFT)<br />
Private Const BF_TOPRIGHT =  (BF_TOP Or BF_RIGHT)<br />
Private Const BF_BOTTOMLEFT = (BF_BOTTOM Or  BF_LEFT)<br />
Private Const BF_BOTTOMRIGHT = (BF_BOTTOM Or BF_RIGHT)<br />
Private  Const BF_RECT = (BF_LEFT Or BF_TOP Or BF_RIGHT Or BF_BOTTOM)<br />
Private  Const BF_DIAGONAL = &amp;H10<br />
&#8216; For diagonal lines, the BF_RECT  flags specify the end point of the<br />
&#8216; vector bounded by the rectangle  parameter.<br />
Private Const BF_DIAGONAL_ENDTOPRIGHT = (BF_DIAGONAL Or  BF_TOP _<br />
Or BF_RIGHT)<br />
Private Const BF_DIAGONAL_ENDTOPLEFT =  (BF_DIAGONAL Or BF_TOP Or BF_LEFT)<br />
Private Const  BF_DIAGONAL_ENDBOTTOMLEFT = (BF_DIAGONAL Or BF_BOTTOM _<br />
Or BF_LEFT)<br />
Private  Const BF_DIAGONAL_ENDBOTTOMRIGHT = (BF_DIAGONAL Or BF_BOTTOM _<br />
Or  BF_RIGHT)<br />
Private Const BF_MIDDLE = &amp;H800 &#8216; Fill in the  middle<br />
Private Const BF_SOFT = &amp;H1000 &#8216; For softer buttons<br />
Private  Const BF_ADJUST = &amp;H2000 &#8216; Calculate the space left over<br />
Private  Const BF_FLAT = &amp;H4000 &#8216; For flat rather than 3D borders<br />
Private  Const BF_MONO = &amp;H8000 &#8216; For monochrome borders<br />
Private Type  RECT<br />
Left As Long<br />
Top As Long<br />
Right As Long<br />
Bottom As Long<br />
End  Type<br />
Private Declare Function DrawEdge Lib &#8220;user32&#8221; (ByVal hdc  As Long, _<br />
qrc As RECT, ByVal edge As Long, ByVal grfFlags As Long)  As Boolean<br />
Private Declare Function SetPixel Lib &#8220;gdi32&#8221; _<br />
(ByVal  hdc As Long, ByVal x As Long, _<br />
ByVal y As Long, ByVal crColor As  Long) As Long<br />
Public Function DrawEdgeEx(ByVal nDC As Long,  ByVal nX As Long, ByVal nY As Long, ByVal nWidth As Long, ByVal nHeight  As Long) As Boolean<br />
Dim rc1 As RECT<br />
rc1.Left = nX<br />
rc1.Right =  nX + nWidth<br />
rc1.Top = nY<br />
rc1.Bottom = nY + nHeight<br />
DrawEdgeEx =  DrawEdge(nDC, rc1, BDR_SUNKENOUTER, BF_RECT)<br />
End Function<br />
Public  Sub DrawDegrade(ByVal nDC As Long, ByVal nX As Long, ByVal nY As Long,  ByVal nWidth As Long, ByVal nHeight As Long, ByVal nMaxWidth As Long,  ByVal nColor As Long, ByVal nScrolling As eProgressScrolling)<br />
If  nWidth &lt;= 0 Or nHeight &lt;= 0 Then Exit Sub<br />
Dim i As Long, j  As Long, k As Long<br />
Dim nPieWidth As Long<br />
Dim nCntX As Long, nCntY  As Long<br />
Dim nLum As Long<br />
Dim dScale As Double<br />
nPieWidth =  nHeight * 3 / 4<br />
nCntX = nX + nWidth &#8211; 1<br />
nCntY = nY + nHeight &#8211; 1<br />
If  nScrolling = pbScrollingStandard Then<br />
dScale = (MAX_LUMINANCE &#8211;  MIN_LUMINANCE) / nHeight<br />
For i = nX To nCntX<br />
If ((nX &#8211; i) Mod  (nPieWidth + 1)) = 0 Then<br />
For k = i To GetMin(i + nPieWidth &#8211; 1,  nMaxWidth + 1)<br />
For j = nY To nCntY<br />
nLum = MIN_LUMINANCE + (nCntY &#8211;  j) * dScale<br />
Call SetPixel(nDC, k, j, GetAdjustLuma(nColor, nLum))<br />
Next  j<br />
Next k<br />
End If<br />
Next i<br />
Else<br />
dScale = (MAX_LUMINANCE &#8211;  MIN_LUMINANCE) / nHeight<br />
For i = nX To nCntX<br />
For j = nY To nCntY<br />
nLum  = MIN_LUMINANCE + (nCntY &#8211; j) * dScale<br />
Call SetPixel(nDC, i, j,  GetAdjustLuma(nColor, nLum))<br />
Next j<br />
Next i<br />
End If<br />
End Sub<br />
Public  Function GetMin(nVal1 As Long, nVal2 As Long) As Long<br />
GetMin =  VBA.IIf(nVal1 &gt; nVal2, nVal2, nVal1)<br />
End Function<br />
Public  Function GetMax(nVal1 As Long, nVal2 As Long) As Long<br />
GetMax =  VBA.IIf(nVal1 &gt; nVal2, nVal1, nVal2)<br />
End Function<br />
Module:  mdlRGBHSL<br />
Renk için RGB, Hue, Luminance ve Saturation gibi  değerleri kontrol ettiğimiz<br />
api fonksiyonlarını bu modülde  tanımlıyoruz.<br />
&#8216; Author: Gökhan ERDOĞDU<br />
&#8216; Date : 03.06.2009<br />
&#8216;  mail : gokhan_erdogdu@yahoo.com<br />
&#8216; Copyright © 2009 GBSoftware<br />
Option  Explicit<br />
Public Type RGBQUAD<br />
bB As Byte &#8216;Blue<br />
bG As Byte  &#8216;Green<br />
bR As Byte &#8216;Red<br />
bA As Byte &#8216;Alpha<br />
End Type<br />
Public  Type tHSL<br />
H As Long<br />
S As Long<br />
L As Long<br />
End Type<br />
Private  Declare Function ColorAdjustLuma Lib &#8220;SHLWAPI.DLL&#8221; _<br />
(ByVal clrRGB  As Long, _<br />
ByVal n As Long, _<br />
ByVal fScale As Long) As Long<br />
Private  Declare Function ColorHLSToRGB Lib &#8220;SHLWAPI.DLL&#8221; _<br />
(ByVal wHue As  Long, _<br />
ByVal wLuminance As Long, _<br />
ByVal wSaturation As Long) As  Long<br />
Private Declare Sub ColorRGBToHLS Lib &#8220;SHLWAPI.DLL&#8221; _<br />
(ByVal  clrRGB As Long, _<br />
ByRef wHue As Long, _<br />
ByRef wLuminance As Long,  _<br />
ByRef wSaturation As Long)<br />
Public Function Long2RGB(ByVal  color1 As Long) As RGBQUAD<br />
With Long2RGB<br />
.bG = VBA.CByte((color1 &#8211;  (color1 Mod 65536)) / 65535)<br />
color1 = (color1 Mod 65535)<br />
.bB =  VBA.CByte((color1 &#8211; (color1 Mod 256)) / 255)<br />
color1 = (color1 Mod  255)<br />
.bR = VBA.CByte(color1)<br />
End With<br />
End Function<br />
Public  Function RGB2Long(rgb1 As RGBQUAD)<br />
RGB2Long = VBA.RGB(rgb1.bR,  rgb1.bG, rgb1.bB)<br />
End Function<br />
Public Function RGB2Grey(rgb1  As RGBQUAD) As Long<br />
Dim nColor As Long<br />
nColor = RGB2Long(rgb1)<br />
RGB2Grey  = Long2Grey(nColor)<br />
End Function<br />
Public Function  Long2Grey(nColor As Long, Optional ByRef nLuminance As Long)<br />
Dim HSL  As tHSL<br />
Call ColorRGBToHLS(nColor, HSL.H, HSL.L, HSL.S)<br />
nLuminance  = HSL.L<br />
Long2Grey = (nLuminance * 65536 + nLuminance * 256 +  nLuminance)<br />
End Function<br />
Public Function Long2HSL(nColor As  Long) As tHSL<br />
With Long2HSL<br />
Call ColorRGBToHLS(nColor, .H, .L, .S)<br />
End  With<br />
End Function<br />
Public Function GetAdjustLuma(ByVal nColor  As Long, ByVal newLuma As Long)<br />
Dim hsl1 As tHSL<br />
hsl1 =  Long2HSL(nColor)<br />
GetAdjustLuma = ColorHLSToRGB(hsl1.H, newLuma,  hsl1.S)<br />
End Function<br />
Form: Form1<br />
Hazırlamış  olduğumuz ProgressBar&#8217;ı test ettiğimiz form objesinin<br />
AutoRedraw  özelliğini True ve ScaleMode özelliğini ise Pixel olarak<br />
tanımlayın.  Aşağıda forma ait kodlar sunulmuştur.<br />
&#8216; Author:  ERDOĞDU<br />
&#8216;  Date : 01.01.2010<br />
&#8216; mail :<br />
&#8216; Copyright © 2010 GBSoftware<br />
Option  Explicit<br />
Private Sub Form_Resize()<br />
Me.Cls<br />
Call  DrawDegrade(Me.hdc, 0, 0, Me.ScaleWidth, Me.ScaleHeight, Me.ScaleWidth,  &amp;HC0E0FF, pbScrollingSmooth)<br />
Me.*******<br />
End Sub<br />
Private  Sub Timer1_Timer()<br />
Dim nVal As Long<br />
Dim ctr1 As Variant<br />
Randomize<br />
For  Each ctr1 In Me.Controls<br />
If TypeName(ctr1) = &#8220;GBProgressBar&#8221; Then<br />
nVal  = ctr1.Value + (Rnd(999) * 5)<br />
If nVal &lt;= ctr1.Max Then ctr1.Value  = nVal<br />
End If<br />
Next ctr1<br />
End Sub</p>
<p><a href="https://www.ertandonmez.org/visual-basic-uc-boyutlu-ve-rengarenk-progressbar-yapimi/">Visual Basic Üç Boyutlu ve Rengarenk ProgressBar Yapımı</a> yazısı ilk önce <a href="https://www.ertandonmez.org">Ertan Dönmez</a> üzerinde ortaya çıktı.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.ertandonmez.org/visual-basic-uc-boyutlu-ve-rengarenk-progressbar-yapimi/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
