VB 6.0
PngSkin is an ActiveX control written in Vb6 that can be used to apply per pixel alpha transparent PNG skin to any application (VB6 and .NET). You can ask your designer (Corel Draw) to create eye catching designs for your application. The control can be used for win2000 and upper operation systems. The non client area of any window can be designed in professional drawing software.The best part of this control is that to use it in your application you need not code or configure it heavily. For VB6 Windows application, you need not write even a single line of code. For .NET Windows forms, you need to write just 2 lines of codes.The Activex Control uses updatelayeredwindow (ULW) and setlayeredwindowattributes (SLWA) APIs to create a semi-transparent form capable of “hosting” controls. The word “hosting” is not correct. This example shows one way of creating a host form for controls and overlaying it on the semitransparent background.
Source Code at Code Project :
http://www.codeproject.com/KB/vbscript/PngSkin_-_Per_Pixel_Forms.aspx
I have been looking for years for a way to use PNG alpha blended forms in VB6. I just ran across your project and I think it is just what I need.
I only noticed one issue. When you move the form around the screen the image doesn’t follow it until you let go of the mouse? Looks very strange. Was wondering if you know why that is the case and if you think it can be fixed or if it is a limitation of your solution? I’d be willing to modify the code to fix the issue if you think it is possible.
I develop graphic user applications in VB6 using borderless windows forms and the SetLayeredWindowAttributes() API to display images as the main form but because VB6 doesn’t support PNG have not been able to have alpha blended edges on our forms . I know it can be done in VB.NET but we have a lot of VB6 applications that I have developed that are still in use.
LikeLike
Jeff : The pngskin control has been written in VB6 using WIN32 API’s UpdateLayeredWindow and SetLayeredWindowAttributes. For PNG support i have used cImage class which was written by LaVolpe [http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=68527&lngWId=1].
How it works : When you set png as background of form , other controls on form will not be painted on screen.The PngSkin Control launches another background form FrmBkg.frm and apply png on it as background using above mentioned api’s.It also uses SetOwner API to host the User form inside background form. On background form mouse moves, the user form will be dragged alone with background form.This may induce dragging issues.You may use subclassing to trap the messages and react before they reach to the form.Lot of articles are available on how to stick two windows form using subclassing on google.
Either you choose .Net or VB6 the underlying magic will be WIN32 API’s.Even in .net you have to use similar WIN32 Api’s and hack to do this.
LikeLike
That was very impressive.
I request you to please help me do this in vb.net 2008
The Form1 is full transparent using the transparency key red and form1 background as red. Now place a button or picturebox with semi transparent *.png image on the form1. Make its back.color transparent.
You will see a red patch behind the semi transparent pixels of button image making the button semi transparent to opaque.
That looks very ugly.
Please help me get rid of the patch. Please don’t advice to use a form background image.
Its possible in windows vista or 7 using dwmapi.dll.
But remote pc has win xp.
LikeLike