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 #69 of 125 |
Re: Rendering transparent TGA to a picturebox in vb.net

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 "Render_Transparent" function.
If you are NOT trying to render transparently, just use
the "Render_Normal" function and specify the stretched size as
the "Dest_Width" / "Dest_Height" parameters. Rendering the 2nd way
will always be MUCH faster because it saves a resize operation, and
rendering normal is a quick BitBlt operation where rendering
transparent is a pixel-by-pixel operation (which can be slow for
large images).

If you want to use the transparent PNG approach but don't want to
save the images to the hard drive... you can always save them to
memory-based byte arrays using the "IO_SaveToBinary" function. Then
when it's time to render that "frame"... use the "IO_LoadFromBinary"
function and then call "Convert_ImageToPicture" to convert the hIMG
image handle to a System.Drawing.Image object to set the PictureBox
control. But again, this method uses a lot of conversion calls and
load/save functions. Speed will be an issue here for animation.

The bottom line is that if you're trying to do rapid loading and
displaying of images as part of an annimation sequence, using
the "Render_Normal" function once the images have been loaded will
work great for you. However, if you're trying to animate transparent
images, it will be very slow (unless you spend some time optomizing
the functions to do this a faster way, or change the source images to
allow a more "creative" way of rendering transparently).


P.S. - Rendering images transparently for annimation is highly
unusual because if you render 1 frame transparently, the background
for the transparent images will be the background color of the
PictureBox. Then when you go to render every other frame
transparently, the transparent regions of every other frame will show
the previously rendered frames behind them... which will look like
crap. Or maybe I'm not understanding fully what you're trying to do.





Mon Apr 14, 2008 4:05 pm

kwilson1997
Offline Offline
Send Email Send Email

Forward
Message #69 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