Jump to content
  • Advertisement
Sign in to follow this  
pnroach

zoomSurface problem

This topic is 4836 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

i tried using zoomSurface to scale my texture and it did scale it but the resulting surface lost its transparent background. i used SDL_image library to load image (png format). SDL_Surface* temp ; temp = zoomSurface(texture, scale_x, scale_y, 1); Why is transparency lost? Suggestions?

Share this post


Link to post
Share on other sites
Advertisement
Maybe it looses transparency because the function (I am not familiar with it) returns a new surface, so you have to set the transparency again for it.

Or maybe when it zooms it does anti-aliasing and changes your color that you want transparent a little bit and so instead of like 0x00ff00 its 0x11dd11 and it looks a like but really isnt.

But I dont know anything about the peculiars of zoomSurface.

Share this post


Link to post
Share on other sites
You have to treat colors 0 though 16777215 as transparent, because when you use rotozoom, the colors are messed around a bit but the transparent range displacement seems limited to this range.

Share this post


Link to post
Share on other sites
You'll have to fiddle with the colour key when blitting the zoomSurface. Try changing the colour key on the source surface to black before rotating, try changing the colour key to purple on the final surface, fiddle around with it and you'll eventually get it.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!