![]() ![]() In any case, animation would require rendering each GIF frame to the layered window bitmap and calling UpdateLayeredWindow. I'll see if I can tweak the class to support GIFs to 32bpp premultiplied so you can use it correctly. If your goal is to animate GIFs onto layered windows, let me know. The sample form can be closed by double clicking on it. GIFs are not working so avoid those for layered window images.Īvoid hitting STOP while using the class. Private Sub Form_Unload(Cancel As Integer)Įnd SubAn example of using an icon is also in the Form_Load, but commented out. M_hBmp = CreateDIBSection(m_hDC, BHI, 0&, m_DIBptr, 0&, 0&) Private Function pvCreateLWdc() As Boolean Private Sub Form_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single) SendMessage Me.hWnd, WM_NCLBUTTONDOWN, HTCAPTION, ByVal 0& If m_MousePoints.x x And m_MousePoints.y y Then If Button = vbLeftButton And m_MousePoints.x > -1& Then Private Sub Form_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single) UpdateLayeredWindow Me.hWnd, 0&, ByVal 0&, m_Size, m_hDC, srcPt, 0&, lBlendFunc, ULW_ALPHA SetWindowLong Me.hWnd, GWL_EXSTYLE, GetWindowLong(Me.hWnd, GWL_EXSTYLE) Or WS_EX_LAYERED Me.Move Me.Left, Me.Top, m_Size.Cx * Screen.TwipsPerPixelX, m_Size.Cy * Screen.TwipsPerPixelY ' error couldn't create a basic DC & bitmap M_Size.Cy = ScaleY(tPic.Height, vbHimetric, vbPixels) M_Size.Cx = ScaleX(tPic.Width, vbHimetric, vbPixels) 'Set tPic = StdPictureEx.LoadPicture(LoadResData("ICON", "CUSTOM"), lpsCustom,, 256, 256) Set tPic = StdPictureEx.LoadPicture(LoadResData("PNG", "CUSTOM"),, ,, ,, vbPicTypeBitmap) Private m_hDC As Long, m_hBmp As Long, m_DIBptr As Long Private Type BITMAPINFOHEADER ' GDI structure Private Const WS_BORDER As Long = &H800000 Private Const WM_NCLBUTTONDOWN As Long = &HA1 Private Const WS_EX_LAYERED As Long = &H80000 Private Declare Function DeleteDC Lib "gdi32.dll" (ByVal hDC As Long) As Long Private Declare Function CreateDIBSection Lib "gdi32.dll" (ByVal hDC As Long, ByRef pBitmapInfo As Any, ByVal un As Long, ByRef lplpVoid As Long, ByVal Handle As Long, ByVal dw As Long) As Long Private Declare Function CreateCompatibleDC Lib "gdi32.dll" (ByVal hDC As Long) As Long Private Declare Sub FillMemory Lib "kernel32.dll" Alias "RtlFillMemory" (ByRef Destination As Any, ByVal Length As Long, ByVal Fill As Byte) Private Declare Function ReleaseDC Lib "user32.dll" (ByVal hWnd As Long, ByVal hDC As Long) As Long Private Declare Function DeleteObject Lib "gdi32.dll" (ByVal hObject As Long) As Long Private Declare Function SelectObject Lib "gdi32.dll" (ByVal hDC As Long, ByVal hObject As Long) As Long Private Declare Function GetDC Lib "user32.dll" (ByVal hWnd As Long) As Long ![]() Private Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByRef lParam As Any) As Long Private Declare Function ReleaseCapture Lib "user32.dll" () As Long Private Declare Function SetLayeredWindowAttributes Lib "user32.dll" (ByVal hWnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long Private Declare Function SetWindowLong Lib "user32.dll" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long ![]() Private Declare Function GetWindowLong Lib "user32.dll" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long Private Declare Function UpdateLayeredWindow Lib "user32.dll" (ByVal hWnd As Long, ByVal hdcDst As Long, ByRef pptDst As Any, ByRef pSize As Any, ByVal hdcSrc As Long, ByRef pptSrc As Any, ByVal crKey As Long, ByRef pblend As Long, ByVal dwFlags As Long) As Long ) i see like this on some softwares and i want create like that with vb. ![]() (for example i hv a a.psd or a.tiff with 10 layers and i named each layer to open close hover disable or like this and i want load like object and when mouse entered on object hover layer can show or. Or if psd format is hard so no matter i can use tiff format but i need load each layers on separated layered window I want load animation png on form(transparent form like as desktop)ģ: how can load psd format (for example psd old format with adobe 8 cs for better processing) and i want load each layers on layred window or i want find counts of layers and. i want just use a simple class like ur class )Ģ: how can load apng format with this class(when this calss can suppore png or tiff multipage why can not support apng? 1: how can use of this class for load pictures on layered window(for example transparent form,please send a example projecte used this class, i used alpha image control but i dont want load all of classes and control and. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |