RotateBitmap90

#include "BIDIB.H"

 

HBITMAP CALLBACK RotateBitmap90(HBITMAP hbmOld)

Description

This function rotates the bitmap 90 degrees, physically, bit by bit, in a positive direction. A faster rotation is possible by rotating the window's coordinate origin.

Parameters

HBITMAP

hbmOld

Handle to the bitmap to be rotated.

Limitation

The available global memory.

Return values

Handle to the newly created, rotated bitmap. NULL on error.

Programming notes

This function creates another bitmap whose dimensions are the rotated dimensions of the original (transposes horizontal and vertical size).

Requirements

Header :     Declared in BiDIB.h; include BiDIB.h.

Library :    Use BiDIB.lib.

DLLs :       BiDIB.dll.

Code example

#include "BIDIB.H"

 

HBITMAP hOriginalBitmap, hRotatedBitmap;

// create, or load original bitmap

.

.

if ( (hRotatedBitmap = RotateBitmap90(hOriginalBitmap)) == NULL)

{

                // could not rotate bitmap

                // possible not enough memory or too many DCs are in use

}