Dim bi24BitInfo As BITMAPINFO, bBytes() As Byte, Cnt As Long
With bi24BitInfo.bmiHeader
.biBitCount = 24
.biCompression = BI_RGB
.biPlanes = 1
.biSize = 40
.biWidth = 256
.biHeight = 256
End With
ReDim bBytes(1 To bi24BitInfo.bmiHeader.biWidth * bi24BitInfo.bmiHeader.biHeight * 3) As Byte
For xc = 0 To 255
For yc = 0 To 255
NewRed = (0 * yc + ((255 * xc + usecolor.rgbRed * (255 - xc)) \ 255) * (255 - yc)) \ 255
NewGreen = (0 * yc + ((255 * xc + usecolor.rgbGreen * (255 - xc)) \ 255) * (255 - yc)) \ 255
NewBlue = (0 * yc + ((255 * xc + usecolor.rgbBlue * (255 - xc)) \ 255) * (255 - yc)) \ 255
GFX_SET_PIXEL_DIB bBytes, xc, yc, RGB(NewRed, NewGreen, NewBlue), bi24BitInfo.bmiHeader.biWidth
Next yc
Next xc
SetDIBitsToDevice Picture.hdc, 0, 0, bi24BitInfo.bmiHeader.biWidth, bi24BitInfo.bmiHeader.biHeight, 0, 0, 0, bi24BitInfo.bmiHeader.biHeight, bBytes(1), bi24BitInfo, DIB_RGB_COLORS
With bi24BitInfo.bmiHeader
.biBitCount = 24
.biCompression = BI_RGB
.biPlanes = 1
.biSize = 40
.biWidth = 256
.biHeight = 256
End With
ReDim bBytes(1 To bi24BitInfo.bmiHeader.biWidth * bi24BitInfo.bmiHeader.biHeight * 3) As Byte
For xc = 0 To 255
For yc = 0 To 255
NewRed = (0 * yc + ((255 * xc + usecolor.rgbRed * (255 - xc)) \ 255) * (255 - yc)) \ 255
NewGreen = (0 * yc + ((255 * xc + usecolor.rgbGreen * (255 - xc)) \ 255) * (255 - yc)) \ 255
NewBlue = (0 * yc + ((255 * xc + usecolor.rgbBlue * (255 - xc)) \ 255) * (255 - yc)) \ 255
GFX_SET_PIXEL_DIB bBytes, xc, yc, RGB(NewRed, NewGreen, NewBlue), bi24BitInfo.bmiHeader.biWidth
R = zColor \ 65536
G = (zColor And 65535) \ 256
B = zColor And 255
Function ConverColor(bColor As Byte) As Byte
If bColor >= 0 And bColor <= 25 Then ConverColor = 15: Exit Function
If bColor >= 26 And bColor <= 50 Then ConverColor = 40: Exit Function
If bColor >= 51 And bColor <= 100 Then ConverColor = 75: Exit Function
If bColor >= 101 And bColor <= 150 Then ConverColor = 125: Exit Function
If bColor >= 151 And bColor <= 200 Then ConverColor = 175: Exit Function
If bColor >= 201 And bColor <= 255 Then ConverColor = 225: Exit Function
End Function
For v = 0 To 255
For X = 0 To 255
bBytes(pCursor).rgbRed = ConverColor(SatLine(X).r * v)
bBytes(pCursor).rgbGreen = ConverColor(SatLine(X).g * v)
bBytes(pCursor).rgbBlue = ConverColor(SatLine(X).b * v)
pCursor = pCursor + 1
Next X
Next v
Сейчас этот форум просматривают: AhrefsBot, Bing-бот, Google-бот и гости: 57