Skip to main content
GameDev.net gamedev.net
🔒 Locked

zoomSurface problem

Started by pnroach Aug 18, 2005 at 4:46 PM 2 replies 700+ views
Original Post
pnroach
pnroach
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?
ender7771
ender7771
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.
clayasaurus
clayasaurus
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.
Rob Loach
Rob Loach
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.
Rob Loach [Website] [Projects] [

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.