Hi,

I want to rotate a bitmap in any angle (0-360). The bitmap is copied in a byte array via GetDIBits().
Which is the best way to create a rotate function?

Greetings, Nordwind64
Posted on 2002-04-26 15:36:20 by Nordwind64
Well if you dont have to have it in the byte array take your hand at this:

Windows provides a function to copy a bitmap into a parallelogram; this function, PlgBlt, performs a bit-block transfer from a rectangle in a source device context into a parallelogram in a destination device context. In order to rotate the bitmap, an application must provide the coordinates, in world units, to be used for the corners of the parallelogram. (For more information about rotation and world units, see Coordinate Spaces and Transformations.)

Of course I am assuming that you just want it rotated period. If you wanted to do it yourself, then maybe someone else can help :P
Posted on 2002-04-26 15:47:51 by Graebel
Hi Graebel,

sorry, PlgBlt don't work under windows 95/98, but the rotate function should do that...

Thanks,
Nordwind64
Posted on 2002-04-26 16:53:24 by Nordwind64
Nordwind64,

That's true, PlgBlt is for NT and better, Further there is no: Rotate function in Win32API.....however here is a real good routine in PB...which should be fairly easy to follow:

http://www.powerbasic.com/support/forums/Forum7/HTML/000831.html

Brad
Posted on 2002-04-26 17:57:20 by Brad
Thank you, Brad.

I'll try to get it work in assembler...

Greetings,
Nordwind64
Posted on 2002-04-27 03:12:39 by Nordwind64