Zitat: |
Private Sub DrawBar(ImgState As eImg, Optional CalculateX As Boolean = True)
Dim intY As Integer, intX As Integer If CalculateX Then If ePosition = Vertical Then If iMin < 0 Then iValue = -iValue Else iValue = iMax - iValue 'iY = (iValue - iMin) / (iMax - iMin) * (picBack.Height - picBar.Height) intX = 0: intY = iY Else 'iY = (iValue - iMin) / (iMax - iMin) * (picBack.Width - picBar.Width) intX = iY: intY = 0 End If Else If ePosition = Vertical Then intX = 0: intY = iY Else intX = iY: intY = 0 End If picBack.Cls '// draw progress If ePosition = Vertical Then Call BitBlt(picBack.HDC, intX, intY, picBack1.ScaleWidth, picBack1.ScaleHeight, _ picBack1.HDC, intX, intY, vbSrcCopy) Else Call BitBlt(picBack.HDC, 0, 0, intX, picBack1.ScaleHeight, _ picBack1.HDC, 0, 0, vbSrcCopy) End If |