Skip to content
 

PngSkin – Per Pixel Forms Skin

You are currently browsing comments. If you would like to return to the full story, you can read the full entry here: “PngSkin – Per Pixel Forms Skin”.

3 Comments

  1. Jeff Davis says:

     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.

  2. 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.

  3. Lucky says:

    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.

Leave a Reply