Search the web
Sign In
New User? Sign Up
AIL_Development · AIL Developer's Forum
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Display 32-bit transparent PNG in Image control (VB)   Message List  
Reply | Forward Message #106 of 125 |
Re: Display 32-bit transparent PNG in Image control (VB)

Great stuff kevin, many thanks. I guess i had the wrong idea about
what filestreams were there. I couldn't work out why it asked for a
file location string!

There are a couple of issues with using the code to load the png to a
picturebox via this method :

picturebox.image = image.fromfile(filenamestring)

When i use this, i get a permission issue when clicking another file
to load in my thumbnail utility. it says that the temp PNG is being
used by another process. I havent worked out why yet, or a way to free
the resources, but the plus side is that is if use :

picturebox.imagelocation = filenamestring

I can avoid this error. i'd like to find out what image.fromfile is
doing differently, but the other way does work perfectly well.

As for the transparent issue with TGAs, i dont know why they don't
display the transparent areas. It's an old format i guess but im
assuming that PNGs still store the transparency in the extra 8 bit
channel? photoshop collapses the image even if you make it on with a
transparent background, and fills it when you save with the foreground
color.

The reason for not using render_transparent is rendering to the dc
prevents me using the size methods of the picturebox, and i am viewing
many different sizes of images. i know render normal can scale the
image, but that doesn't do transparency!

All in all it's been an interesting quandry. hope you dont mind the
questions, and thanks again for your expert tech support!






Fri Oct 17, 2008 10:44 pm

bluescreenwe...
Offline Offline
Send Email Send Email

Forward
Message #106 of 125 |
Expand Messages Author Sort by Date

Daniel asked: "how do you load the 32-bit transparent PNG image. it shows as normal when loaded in a image box"...
Kevin Wilson
kwilson1997
Offline Send Email
Jul 26, 2008
4:16 pm

In VB5 and VB6, there's no way to load a transparent pictures into an Image control because the Image control does not have a Device Context handle (hDC)...
Kevin Wilson
kwilson1997
Offline Send Email
Jul 26, 2008
4:19 pm

I have been musing over this one for a while, as I need to display the transparency of Targa files. A picturebox in VB.net will render a 32-bit PNG correctly...
bluescreenweasel
bluescreenwe...
Offline Send Email
Oct 17, 2008
5:49 pm

further to this one of your previous replies has a more elegant method than the one I just posted - If you want to use the transparent PNG approach but don't...
bluescreenweasel
bluescreenwe...
Offline Send Email
Oct 17, 2008
5:50 pm

... method ... Keep in mind that saving to a Stream object in .NET is intended for things like pushing a custom image over the internet or network via an open...
Kevin Wilson
kwilson1997
Offline Send Email
Oct 17, 2008
6:59 pm

Great stuff kevin, many thanks. I guess i had the wrong idea about what filestreams were there. I couldn't work out why it asked for a file location string! ...
bluescreenweasel
bluescreenwe...
Offline Send Email
Oct 21, 2008
1:58 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help