Stretching a Bitmap

Started by
5 comments, last by Zool 21 years, 1 month ago
I use a library called SDL (www.libsdl.com) it uses videomemory exactly like directdraw but there is no way to stretch bitmaps, there is a way to setpixels and blt normally, if someone out there knows exactly how stretchblting is accomplished (in plain english would work just fine) i just need to understand how it works then I can make an algo for it. Thanks
Advertisement
i never used SDL, but: stretching a bitmap is actually a hard task. you can make it simple by stretching the bitmap with a bresenham-like function with error terms for x/y axis, which is easy to code, but the visual quality will be bad when the bitmap gets too large, so you will have to introduce some sort of filter (which is usually slow). does SDL have 3D functions (for bilinear filtered polygons and so on)?

hope this helps
It has no 3D functions, you can init OpenGL but I know didly about OpenGL so I would rather stay away from that. Can you go into more detail about that bresehen-like function?
i show you the code to it because my english sucks and i''m not good in explaining algorithms :-)

fastBitmap


this will do the job, but as said it will look a bit ugly without filtering. maybe you consider using a real texturemapping algorithm later on, you''d also get sprite rotation for free!

hope this helps
I''ve gotten it to stretch using a pixel by pixel loop and stretching the pixel color into a rectangle but it wont shrink. do you know how to do that?
People today are sooooo lazy...
Why can''t you do it by yourself, using some bilinear filtering?

Height Map Editor | Eternal Lands | Fast User Directory
Well I figured it out without whatever you sent

This topic is closed to new replies.

Advertisement