Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

CImage::Attach 

Attaches hBitmap to a CImage object.


void Attach(
   HBITMAP hBitmap, 
   DIBOrientation eOrientation = DIBOR_DEFAULT
) throw();

Parameters

hBitmap

A handle to an HBITMAP.

eOrientation

Specifies the orientation of the bitmap. Can be one of the following:

  • DIBOR_DEFAULT   The orientation of the bitmap is determined by the operating system. However, this may not always have the intended results on all operating systems. For more information on this, see the following Knowledge Base article (Q186586): PRB: GetObject() Always Returns Positive Height For DIB Sections.

  • DIBOR_BOTTOMUP   The lines of the bitmap are in reverse order. This causes CImage::GetBits to return a pointer near the end of the bitmap buffer and CImage::GetPitch to return a negative number.

  • DIBOR_TOPDOWN   The lines of the bitmap are in top to bottom order. This causes CImage::GetBits to return a pointer to the first byte of the bitmap buffer and CImage::GetPitch to return a positive number.

The bitmap can be either a non-DIB section bitmap or a DIB section bitmap. See IsDIBSection for a list of methods that you can use only with DIB section bitmaps.

Community Additions

ADD
Show:
© 2015 Microsoft