rotate functions for win32?

Started by
9 comments, last by LessBread 18 years, 7 months ago
i'm programming my games using win32, but the book i'm using doesn't mention any ability to rotate a bitmap once you've loaded it. Is there any way i can blit it differently, essentially rotating it? or am i stuck with having to create rotations of my image? (i.e. i want to make an image like the froggy from Zuma) zappernapper
Advertisement
You're not using DirectX or OpenGL?

So I assume you're using GDI?

-dbh
------------------------------------------------------------GDC/IGF 2006 Student Showcase Submission: Curator Defense
correct, just the basic #include <windows.h>
As far as GDI goes, you'll have to roll your own rotation routines.
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes." - the Laughing Man
Agreed, GDI means do it yourself ;)

This site had some great tutorials back when I used to work with GDI... maybe they can help?

http://www.functionx.com/bcb/index.htm

-dbh
------------------------------------------------------------GDC/IGF 2006 Student Showcase Submission: Curator Defense
while that site DOES answer other questions i had on how to create widgets outside of python, it only goes as far to tell me how to load and draw a bitmap... doesn't even mention how to load it as a resource or use transparency... so what you're saying is I have to somehow figure out how to tell the program to blit it a certain way? damn.... anyone else happen to know something?
Be sure to check out the articles here at gamedev. For example, Bitmap Rotation.
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes." - the Laughing Man
If you were using SDL, you could use SDL_gfx's handy rotozoom methods.
Rob Loach [Website] [Projects] [Contact]
thanks lessbread, but i don't know how to get at the pixels themselves to do the shearing and transposing, you know? i guess i'll have to google it.
If you don't care about Win9x or WinME compatibility you can switch GDI to "advanced" mode via SetGraphicsMode and then do arbitrary 2D transformations with SetWorldTransform.

On any version of Win32 you can flip around either the horizontal or vertical axis simply by giving a negative width/height to StretchBlt.

You might also be able to do what you want with PlgBlt. But I haven't really played with that function so I don't know to much about it.
-Mike

This topic is closed to new replies.

Advertisement