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
Rendering transparent TGA to a picturebox in vb.net   Message List  
Reply | Forward Message #67 of 125 |
Re: Rendering transparent TGA to a picturebox in vb.net

1) Standard 24-bit BITMAP images do not support transparency... so
converting any 32-bit transparent image (including TGA) to a 24-bit
BITMAP would lose the transparency.


2) As the documentation states, always use "Render_Transparent" to
render images unless you have special needs for your rendering
that "Render_Transparent" doesn't support and another render function
does (i.e. - if you need to stretch your picture when you render
it, "Render_Normal" supports this, but "Render_Transparent" does not).


3) I would suggest loading the 32-bit transparent TGA file, and then
use the "Render_Transparent" function to render the image
transparently onto your PictureBox.

If you're using VB5 or VB6, set the PictureBox's "AutoRedraw"
property to TRUE.

If you're using VB.NET, C#.NET, or any other .NET language... the
PictureBox no longer has an "AutoRedraw" property... so when the
PictureBox is refreshed or redrawn, some or all of your rendered
image will be lost. If you're doing animation (rendering multiple
images onto a PictureBox quickly), this is not an issue. If you're
NOT doing animation, I might suggest storing the image handle and
then kicking off a call to the "Render_Transparent" function every
time the "Paint" event is called.

If you're using .NET, an alternative to this is converting the image
to a transparent PNG image and then setting the "Image" property of
the PictureBox to that PNG image. .NET PictureBoxes support
transparent PNG images.

Hope this helps.

- Kevin




--- In AIL_Development@yahoogroups.com, "bluescreenweasel"
<peteraddington@...> wrote:
>
> Hello all AIL users.
>
> I wanted to know what the quickest way would be to load a 32 bit tga
> so that the alpha transparency was preserved. Ideally i'd need my
> fuction to return a bitmap so that i can update a picturebox. There
> are a few methods pertaining to the use of alpha channels and
> transparency, but i am unsure of what one to use. I just need the
> fastest way of displaying the image. many thanks
>





Thu Apr 10, 2008 7:46 pm

kwilson1997
Offline Offline
Send Email Send Email

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

Hello all AIL users. I wanted to know what the quickest way would be to load a 32 bit tga so that the alpha transparency was preserved. Ideally i'd need my ...
bluescreenweasel
bluescreenwe...
Offline Send Email
Apr 10, 2008
7:27 pm

1) Standard 24-bit BITMAP images do not support transparency... so converting any 32-bit transparent image (including TGA) to a 24-bit BITMAP would lose the...
Kevin Wilson
kwilson1997
Offline Send Email
Apr 10, 2008
7:46 pm

Hi kevin, Thanks for your reply. I am using vb.net and AIL to make an animation sequence player. I did want to squash the image to 16:9 so does that make the...
bluescreenweasel
bluescreenwe...
Offline Send Email
Apr 11, 2008
7:32 pm

If you want to squash the image to 16:9 before rendering to a PictureBox, I would recommend resizing the image first, then rendering it transparently using the...
Kevin Wilson
kwilson1997
Offline Send Email
Apr 14, 2008
4:06 pm

you're right, it would look like crap. My theory was to try to render a tga foreground animation in the image property of the picturebox and a background (non...
bluescreenweasel
bluescreenwe...
Offline Send Email
Apr 28, 2008
5:35 pm
Advanced

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