On form u need HScrollBar
That is a simple code of Alpha blending
in Attachments professional code of Alpha BlendingCode:Private Const GWL_EXSTYLE As Long = (-20) Private Const WS_EX_RIGHT As Long = &H1000 Private Const WS_EX_LEFTSCROLLBAR As Long = &H4000 Private Const WS_EX_LAYERED As Long = &H80000 Private Const WS_EX_TRANSPARENT = &H20& Private Const LWA_COLORKEY As Long = &H1 Private Const LWA_ALPHA As Long = &H2 Private Declare Function GetWindowLong Lib "User32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "User32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Declare Function SetLayeredWindowAttributes Lib "User32" (ByVal hwnd As Long, ByVal crKey As Long, ByVal bAlpha As Long, ByVal dwFlags As Long) As Long Private Sub Form_Load() Dim style As Long HScroll1.Min = 10 HScroll1.Max = 255 HScroll1.Value = 127 style = GetWindowLong(Me.hwnd, GWL_EXSTYLE) If Not (style And WS_EX_LAYERED = WS_EX_LAYERED) Then style = style Or WS_EX_LAYERED SetWindowLong Me.hwnd, GWL_EXSTYLE, style SetLayeredWindowAttributes Me.hwnd, 0&, HScroll1.Value, LWA_ALPHA End If End Sub Private Sub HScroll1_Change() HScroll1_Scroll End Sub Private Sub HScroll1_Scroll() SetLayeredWindowAttributes Me.hwnd, 0&, HScroll1.Value, LWA_ALPHA End Sub
[...]
Introduction to DiBits
The gdi32.dll is the dynamic library handling all window’s application graphics processing, with the exception of Direct-X.
One of its functions is called GetDIBits which loads all the data of a bitmap in to an array, really quickly.
The Purpose of such a function is to help programmers, process image data really quickly, since this function writes instructions directly into the video memory.
Revision:
The GetDIBits function retrieves the bits of the specified bitmap and copies them into a buffer using the specified format.
How To Use GetDIBits
Firstly we need to create a context to process our graphic into.
Usage:
CreateCompatibleDC(hdc)
hdc refers to the device context to be compatible with.
If zero is put, the context will be compatible with the application’s current screen.i'm pretty like that code, because is awesome...Code:Type BITMAPINFOHEADER biSize As Long '4 Bytes to hold a fixed value biWidth As Long '4 Bytes to hold the bitmap’s width biHeight As Long '4 Bytes to hold the bitmap’s height biPlanes As Integer '2 Bytes to hold the bitmap’s Plane biBitCount As Integer '2 Bytes to hold the bits per pixel '16 Colors, 16 Color gray = 4 'Gray, 256 Color = 8 'True Color = 24 'True Color & Transparency = 32 biCompression As Long '4 Bytes to hold thecompression type (if any) biSizeImage As Long biXPelsPerMeter As Long biYPelsPerMeter As Long biClrUsed As Long 'My guess use a byte to show the next line biClrImportant As Long 'Is this importand? End Type
don't forget on main form putThis is only a foretaste of this code, lots and lots of lines but... with commentsCode:Const Rad As Currency = 1.74532925199433E-02
virustotal.com/pl/file/eb1713638114026d0c1e61dea2e8cd88c167dd0dd5dd0d60ef de907a49ea81d3/analysis/1386621905/
Please register or login to download attachments.