CodeGuru Forums -
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic Newsletters VB Forums Developer.com


Newest CodeGuru.com Articles:

  • Installing SQL Server 2008
  • Writing UDFs for Firebird Embedded SQL Server
  • [Updated] Shutdown Manager
  • Building Windows Azure Cloud Service Applications with Azure Storage and the Azure SDK

  • Search CodeGuru:
     



    Go Back   CodeGuru Forums > Visual Basic Programming > Visual Basic 6.0 Programming
    FAQ Members List Calendar Search Today's Posts Mark Forums Read

    Visual Basic 6.0 Programming Ask questions about VB 6.0 (or earlier versions) or help others by answering their question.

    Reply
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1    
    Old October 23rd, 2009, 01:42 PM
    avidichard avidichard is offline
    Member
     
    Join Date: Jul 2005
    Location: Quebec, Canada
    Posts: 39
    avidichard is an unknown quantity at this point (<10)
    Arrow PNG Alpha Blended Form

    OK, first, I want to say that I have found several threads for what I am searching for but none of them achieves the result I want. One close but the problem is that the controls in the form are not shown but still answer to mouse events. So here is my question and request:

    I would like to set a PNG image as a form with it's alpha channel (Transparency) but see the controls on the form. The one I found was using GDI+, which almost does what I want but I would like to know if it is possible to do this using DirectX if it would solve the hidden controls problem.
    __________________
    David Richard
    Reply With Quote
      #2    
    Old October 26th, 2009, 08:20 AM
    avidichard avidichard is offline
    Member
     
    Join Date: Jul 2005
    Location: Quebec, Canada
    Posts: 39
    avidichard is an unknown quantity at this point (<10)
    Arrow Re: PNG Alpha Blended Form

    OK, I can see that no-one found a solution, or the post does not seem very interesting so I have posted two examples I have downloaded and tested for some people to work with.

    LoadPNG.zip is an example on how to load a PNG image in a PictureBox using GDI+.

    PerPixelAlpha.zip is a project example that shows how to use a PNG image as a form. You will see that the problem is that you cannot see the controls in the form but the controls still respond to mouse events.

    I need a solution. A form that has the picture and transparency of a given PNG image but that still shows the controls in the form. It's like a mixture of both projects that I need. If I can get the transparency of a PNG image from a PNG image loaded in a PictureBox, I won't need to repaint the actual form. I want to put PNG file effets on a form bu still show the controls I put on it. I am wondering if in DirectX mode, this would be achievable better than using GDI+. Does someone have a solution?
    Attached Files
    File Type: zip LoadPNG.zip (60.4 KB, 43 views)
    File Type: zip PerPixelAlpha.zip (49.5 KB, 40 views)
    __________________
    David Richard

    Last edited by avidichard; October 26th, 2009 at 08:21 AM. Reason: Forgat Attachments
    Reply With Quote
      #3    
    Old October 27th, 2009, 11:33 PM
    dglienna's Avatar
    dglienna dglienna is offline
    ex MVP - Visual Basic
    Power Poster
     
    Join Date: Jan 2006
    Location: Chicago, IL
    Posts: 9,895
    dglienna has a brilliant future (2000+)dglienna has a brilliant future (2000+)dglienna has a brilliant future (2000+)dglienna has a brilliant future (2000+)dglienna has a brilliant future (2000+)dglienna has a brilliant future (2000+)dglienna has a brilliant future (2000+)dglienna has a brilliant future (2000+)dglienna has a brilliant future (2000+)dglienna has a brilliant future (2000+)dglienna has a brilliant future (2000+)
    Re: PNG Alpha Blended Form

    VB.Net lets you set OPACITY, as well as use Expressions Blend to create WPF forms to use, instead.
    __________________
    David CodeGuru Article: Bound Controls are Evil-VB6
    101 Samples: VB & C# VS2008 Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!
    Reply With Quote
      #4    
    Old October 28th, 2009, 07:58 AM
    avidichard avidichard is offline
    Member
     
    Join Date: Jul 2005
    Location: Quebec, Canada
    Posts: 39
    avidichard is an unknown quantity at this point (<10)
    Re: PNG Alpha Blended Form

    I am not using VB.NET and I can't use it since I will need to create my whole application completely. I don't want to do that. And, I won't use their VB6 to .Net Project converter because of the mess it does in the code and it doesn't even run after.

    As I can also see, I posted the thread in the Visual Basic 6 Formum for a reason. Thanks anyways for the comment.
    __________________
    David Richard
    Reply With Quote
      #5    
    Old October 29th, 2009, 12:44 AM
    dglienna's Avatar
    dglienna dglienna is offline
    ex MVP - Visual Basic
    Power Poster
     
    Join Date: Jan 2006
    Location: Chicago, IL
    Posts: 9,895
    dglienna has a brilliant future (2000+)dglienna has a brilliant future (2000+)dglienna has a brilliant future (2000+)dglienna has a brilliant future (2000+)dglienna has a brilliant future (2000+)dglienna has a brilliant future (2000+)dglienna has a brilliant future (2000+)dglienna has a brilliant future (2000+)dglienna has a brilliant future (2000+)dglienna has a brilliant future (2000+)dglienna has a brilliant future (2000+)
    Re: PNG Alpha Blended Form

    Read up. You can mix VB.Net code and VB6 code in the same project. You can rewrite sections at a time, if you want features of one language (like opacity). Your VB6 app could use WPF forms
    __________________
    David CodeGuru Article: Bound Controls are Evil-VB6
    101 Samples: VB & C# VS2008 Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!
    Reply With Quote
      #6    
    Old October 29th, 2009, 12:14 PM
    avidichard avidichard is offline
    Member
     
    Join Date: Jul 2005
    Location: Quebec, Canada
    Posts: 39
    avidichard is an unknown quantity at this point (<10)
    Re: PNG Alpha Blended Form

    I searched the net to add WPF forms to a VB6 app and everything is oriented in the other way like hot to put a vb form in a WPF application. I use Visual Studio 6 (Visual Basic 6). I want to apply a PNG image to a form or PictureBox and see the PNG's transparency effect. That is the main reason of this thread.
    __________________
    David Richard
    Reply With Quote
      #7    
    Old October 29th, 2009, 05:31 PM
    dglienna's Avatar
    dglienna dglienna is offline
    ex MVP - Visual Basic
    Power Poster
     
    Join Date: Jan 2006
    Location: Chicago, IL
    Posts: 9,895
    dglienna has a brilliant future (2000+)dglienna has a brilliant future (2000+)dglienna has a brilliant future (2000+)dglienna has a brilliant future (2000+)dglienna has a brilliant future (2000+)dglienna has a brilliant future (2000+)dglienna has a brilliant future (2000+)dglienna has a brilliant future (2000+)dglienna has a brilliant future (2000+)dglienna has a brilliant future (2000+)dglienna has a brilliant future (2000+)
    Re: PNG Alpha Blended Form

    It works the other way. Download Visual Studio 2008 - VB.Net Express Edition.

    This will let you LOAD the VB6 app, attempt to upgrade it, and let it execute when you add the .dll and .exe files to your project.

    It was all over the net a few years ago, when the vb.net toolset was being developed
    __________________
    David CodeGuru Article: Bound Controls are Evil-VB6
    101 Samples: VB & C# VS2008 Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!
    Reply With Quote
      #8    
    Old November 3rd, 2009, 11:57 AM
    avidichard avidichard is offline
    Member
     
    Join Date: Jul 2005
    Location: Quebec, Canada
    Posts: 39
    avidichard is an unknown quantity at this point (<10)
    Exclamation Re: PNG Alpha Blended Form

    Sorry for the delay.

    I once found a project created by someone on the net permitting to use a PNG image as a form with controls on it but I can't find it anymore. I know it is doable in VB6 and I don't want to convert the entire project in Dot Net since the all programs are done in VB6. Can someone help me do this project. I just want an alpha blended form from a PNG image with the controls shown.
    __________________
    David Richard
    Reply With Quote
      #9    
    Old November 6th, 2009, 03:26 AM
    vb5prgrmr vb5prgrmr is online now
    Member
     
    Join Date: Apr 2009
    Posts: 148
    vb5prgrmr has a spectacular aura about (150+)vb5prgrmr has a spectacular aura about (150+)
    Re: PNG Alpha Blended Form

    Search over at vbforums... (I think in their codebank...)...




    Good Luck
    Reply With Quote
    Reply

    Bookmarks

    Tags
    alpha, blending, form, png, transparent
    Go Back   CodeGuru Forums > Visual Basic Programming > Visual Basic 6.0 Programming


    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 02:01 AM.



    Acceptable Use Policy

    internet.comMediabistrojusttechjobs.comGraphics.com

    WebMediaBrands Corporate Info


    Advertise | Newsletters | Feedback | Submit News

    Legal Notices | Licensing | Permissions | Privacy Policy


    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
    Copyright WebMediaBrands Inc. 2002-2009