3

I found a function

 function RotateBitmap(var hDIB: HGlobal;
 radang: Double; clrBack: TColor): Boolean;

that rotates an image. But I don't know how to call this function. What parameters I can pass to this function. I don't know how to use this func at all.

Johan
  • 74,508
  • 24
  • 191
  • 319
Frankie Drake
  • 1,338
  • 9
  • 24
  • 40
  • Thanx David. Firstly I don't know this parameter: `hDIB: HGlobal`. – Frankie Drake Oct 07 '11 at 17:00
  • 2
    It sounds like a handle to a DIB. But the code does GlobalLock on it and interprets it as a pointer to bitmap info header. That seems plain odd to me. I'd look for another routine. Have you tried graphics32 yet? I'm sure it will do this, and in a very natural Delphi way. – David Heffernan Oct 07 '11 at 17:03
  • that code works with DIB section handle, not TBitmap. You have to call GetObject first – Premature Optimization Oct 07 '11 at 17:11

1 Answers1

4

Judging by the code presented hDIB is a pointer to a single memory block containing 2 structures - BitmapInfo and bitmap's pixel array. You can obtain these structures from TBitmap using GetDIBSizes and GetDIB functions.

If you are interested in bitmap transformations you can follow David's advice and try graphics32

kludg
  • 27,213
  • 5
  • 67
  • 118