ReactOS 0.4.15-dev-8096-ga0eec98
Bitmap Class Reference

#include <gdiplusheaders.h>

Inheritance diagram for Bitmap:
Collaboration diagram for Bitmap:

Public Member Functions

 Bitmap (INT width, INT height, Graphics *target)
 
 Bitmap (const BITMAPINFO *gdiBitmapInfo, VOID *gdiBitmapData)
 
 Bitmap (INT width, INT height, PixelFormat format)
 
 Bitmap (HBITMAP hbm, HPALETTE hpal)
 
 Bitmap (INT width, INT height, INT stride, PixelFormat format, BYTE *scan0)
 
 Bitmap (const WCHAR *filename, BOOL useIcm)
 
 Bitmap (HINSTANCE hInstance, const WCHAR *bitmapName)
 
 Bitmap (HICON hicon)
 
 Bitmap (IStream *stream, BOOL useIcm)
 
BitmapClone (const Rect &rect, PixelFormat format)
 
BitmapClone (const RectF &rect, PixelFormat format)
 
BitmapClone (REAL x, REAL y, REAL width, REAL height, PixelFormat format)
 
BitmapClone (INT x, INT y, INT width, INT height, PixelFormat format)
 
Status GetHBITMAP (const Color &colorBackground, HBITMAP *hbmReturn)
 
Status GetHICON (HICON *hicon)
 
Status GetPixel (INT x, INT y, Color *color)
 
Status LockBits (const Rect *rect, UINT flags, PixelFormat format, BitmapData *lockedBitmapData)
 
Status SetPixel (INT x, INT y, const Color &color)
 
Status SetResolution (REAL xdpi, REAL ydpi)
 
Status UnlockBits (BitmapData *lockedBitmapData)
 
- Public Member Functions inherited from Image
 Image (IStream *stream, BOOL useEmbeddedColorManagement=FALSE)
 
 Image (const WCHAR *filename, BOOL useEmbeddedColorManagement=FALSE)
 
ImageClone ()
 
virtual ~Image ()
 
Status GetAllPropertyItems (UINT totalBufferSize, UINT numProperties, PropertyItem *allItems)
 
Status GetBounds (RectF *srcRect, Unit *srcUnit)
 
Status GetEncoderParameterList (const CLSID *clsidEncoder, UINT size, EncoderParameters *buffer)
 
UINT GetEncoderParameterListSize (const CLSID *clsidEncoder)
 
UINT GetFlags ()
 
UINT GetFrameCount (const GUID *dimensionID)
 
UINT GetFrameDimensionsCount ()
 
Status GetFrameDimensionsList (GUID *dimensionIDs, UINT count)
 
UINT GetHeight ()
 
REAL GetHorizontalResolution ()
 
Status GetLastStatus ()
 
Status GetPalette (ColorPalette *palette, INT size)
 
INT GetPaletteSize ()
 
Status GetPhysicalDimension (SizeF *size)
 
PixelFormat GetPixelFormat ()
 
UINT GetPropertyCount ()
 
Status GetPropertyIdList (UINT numOfProperty, PROPID *list)
 
Status GetPropertyItem (PROPID propId, UINT propSize, PropertyItem *buffer)
 
UINT GetPropertyItemSize (PROPID propId)
 
Status GetPropertySize (UINT *totalBufferSize, UINT *numProperties)
 
Status GetRawFormat (GUID *format)
 
ImageGetThumbnailImage (UINT thumbWidth, UINT thumbHeight, GetThumbnailImageAbort callback, VOID *callbackData)
 
ImageType GetType ()
 
REAL GetVerticalResolution ()
 
UINT GetWidth ()
 
Status RemovePropertyItem (PROPID propId)
 
Status RotateFlip (RotateFlipType rotateFlipType)
 
Status Save (IStream *stream, const CLSID *clsidEncoder, const EncoderParameters *encoderParams)
 
Status Save (const WCHAR *filename, const CLSID *clsidEncoder, const EncoderParameters *encoderParams)
 
Status SaveAdd (const EncoderParameters *encoderParams)
 
Status SaveAdd (Image *newImage, const EncoderParameters *encoderParams)
 
Status SelectActiveFrame (const GUID *dimensionID, UINT frameIndex)
 
Status SetPalette (const ColorPalette *palette)
 
Status SetPropertyItem (const PropertyItem *item)
 
- Public Member Functions inherited from GdiplusBase
void operator delete (void *in_pVoid)
 
void operator delete[] (void *in_pVoid)
 
voidoperator new (size_t in_size)
 
voidoperator new[] (size_t in_size)
 

Static Public Member Functions

static BitmapFromBITMAPINFO (const BITMAPINFO *gdiBitmapInfo, VOID *gdiBitmapData)
 
static BitmapFromFile (const WCHAR *filename, BOOL useEmbeddedColorManagement)
 
static BitmapFromHBITMAP (HBITMAP hbm, HPALETTE hpal)
 
static BitmapFromHICON (HICON hicon)
 
static BitmapFromResource (HINSTANCE hInstance, const WCHAR *bitmapName)
 
static BitmapFromStream (IStream *stream, BOOL useEmbeddedColorManagement)
 
- Static Public Member Functions inherited from Image
static ImageFromFile (const WCHAR *filename, BOOL useEmbeddedColorManagement=FALSE)
 
static ImageFromStream (IStream *stream, BOOL useEmbeddedColorManagement=FALSE)
 

Protected Member Functions

 Bitmap ()
 
 Bitmap (GpBitmap *nativeBitmap)
 
GpBitmapGetNativeBitmap () const
 
- Protected Member Functions inherited from Image
 Image ()
 
 Image (GpImage *image, Status status)
 
Status SetStatus (Status status) const
 
void SetNativeImage (GpImage *image)
 

Friends

class CachedBitmap
 

Additional Inherited Members

- Protected Attributes inherited from Image
GpImagenativeImage
 
Status lastStatus
 

Detailed Description

Definition at line 378 of file gdiplusheaders.h.

Constructor & Destructor Documentation

◆ Bitmap() [1/11]

Bitmap::Bitmap ( INT  width,
INT  height,
Graphics target 
)
inline

Definition at line 388 of file gdiplusheaders.h.

389 {
391 lastStatus = DllExports::GdipCreateBitmapFromGraphics(width, height, target ? getNat(target) : NULL, &bitmap);
393 }
void SetNativeImage(GpImage *image)
Status lastStatus
friend GpImage *& getNat(const Image *image)
#define NULL
Definition: types.h:112
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLint GLint GLsizei width
Definition: gl.h:1546
GLenum target
Definition: glext.h:7315
Definition: uimain.c:89

◆ Bitmap() [2/11]

Bitmap::Bitmap ( const BITMAPINFO gdiBitmapInfo,
VOID gdiBitmapData 
)
inline

Definition at line 395 of file gdiplusheaders.h.

396 {
398 lastStatus = DllExports::GdipCreateBitmapFromGdiDib(gdiBitmapInfo, gdiBitmapData, &bitmap);
400 }

◆ Bitmap() [3/11]

Bitmap::Bitmap ( INT  width,
INT  height,
PixelFormat  format 
)
inline

Definition at line 402 of file gdiplusheaders.h.

403 {
405 lastStatus = DllExports::GdipCreateBitmapFromScan0(width, height, 0, format, NULL, &bitmap);
407 }
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546

◆ Bitmap() [4/11]

Bitmap::Bitmap ( HBITMAP  hbm,
HPALETTE  hpal 
)
inline

Definition at line 409 of file gdiplusheaders.h.

410 {
412 lastStatus = DllExports::GdipCreateBitmapFromHBITMAP(hbm, hpal, &bitmap);
414 }
_In_ HBITMAP hbm
Definition: ntgdi.h:2776

◆ Bitmap() [5/11]

Bitmap::Bitmap ( INT  width,
INT  height,
INT  stride,
PixelFormat  format,
BYTE scan0 
)
inline

Definition at line 416 of file gdiplusheaders.h.

417 {
419 lastStatus = DllExports::GdipCreateBitmapFromScan0(width, height, stride, format, scan0, &bitmap);
421 }
GLsizei stride
Definition: glext.h:5848

◆ Bitmap() [6/11]

Bitmap::Bitmap ( const WCHAR filename,
BOOL  useIcm 
)
inline

Definition at line 423 of file gdiplusheaders.h.

424 {
426
427 if (useIcm)
428 lastStatus = DllExports::GdipCreateBitmapFromFileICM(filename, &bitmap);
429 else
430 lastStatus = DllExports::GdipCreateBitmapFromFile(filename, &bitmap);
431
433 }
const char * filename
Definition: ioapi.h:137

◆ Bitmap() [7/11]

Bitmap::Bitmap ( HINSTANCE  hInstance,
const WCHAR bitmapName 
)
inline

Definition at line 435 of file gdiplusheaders.h.

436 {
438 lastStatus = DllExports::GdipCreateBitmapFromResource(hInstance, bitmapName, &bitmap);
440 }
HINSTANCE hInstance
Definition: charmap.c:19

◆ Bitmap() [8/11]

Bitmap::Bitmap ( HICON  hicon)
inline

Definition at line 442 of file gdiplusheaders.h.

443 {
445 lastStatus = DllExports::GdipCreateBitmapFromHICON(hicon, &bitmap);
447 }

◆ Bitmap() [9/11]

Bitmap::Bitmap ( IStream stream,
BOOL  useIcm 
)
inline

Definition at line 449 of file gdiplusheaders.h.

450 {
452 if (useIcm)
453 lastStatus = DllExports::GdipCreateBitmapFromStreamICM(stream, &bitmap);
454 else
455 lastStatus = DllExports::GdipCreateBitmapFromStream(stream, &bitmap);
457 }
Definition: parse.h:23

◆ Bitmap() [10/11]

Bitmap::Bitmap ( )
inlineprotected

Definition at line 596 of file gdiplusheaders.h.

597 {
598 }

Referenced by Clone(), FromBITMAPINFO(), FromFile(), FromHBITMAP(), FromHICON(), FromResource(), and FromStream().

◆ Bitmap() [11/11]

Bitmap::Bitmap ( GpBitmap nativeBitmap)
inlineprotected

Definition at line 600 of file gdiplusheaders.h.

601 {
602 lastStatus = Ok;
603 SetNativeImage(nativeBitmap);
604 }
@ Ok
Definition: gdiplustypes.h:26

Member Function Documentation

◆ Clone() [1/4]

Bitmap * Bitmap::Clone ( const Rect rect,
PixelFormat  format 
)
inline

Definition at line 460 of file gdiplusheaders.h.

461 {
462 return Clone(rect.X, rect.Y, rect.Width, rect.Height, format);
463 }
Image * Clone()
& rect
Definition: startmenu.cpp:1413

◆ Clone() [2/4]

Bitmap * Bitmap::Clone ( const RectF rect,
PixelFormat  format 
)
inline

Definition at line 466 of file gdiplusheaders.h.

467 {
468 return Clone(rect.X, rect.Y, rect.Width, rect.Height, format);
469 }

◆ Clone() [3/4]

Bitmap * Bitmap::Clone ( INT  x,
INT  y,
INT  width,
INT  height,
PixelFormat  format 
)
inline

Definition at line 490 of file gdiplusheaders.h.

491 {
493 lastStatus = DllExports::GdipCloneBitmapAreaI(x, y, width, height, format, GetNativeBitmap(), &bitmap);
494
495 if (lastStatus != Ok)
496 return NULL;
497
498 Bitmap *newBitmap = new Bitmap(bitmap);
499 if (newBitmap == NULL)
500 {
501 DllExports::GdipDisposeImage(bitmap);
502 }
503
504 return newBitmap;
505 }
GpBitmap * GetNativeBitmap() const
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548

◆ Clone() [4/4]

Bitmap * Bitmap::Clone ( REAL  x,
REAL  y,
REAL  width,
REAL  height,
PixelFormat  format 
)
inline

Definition at line 472 of file gdiplusheaders.h.

473 {
475 lastStatus = DllExports::GdipCloneBitmapArea(x, y, width, height, format, GetNativeBitmap(), &bitmap);
476
477 if (lastStatus != Ok)
478 return NULL;
479
480 Bitmap *newBitmap = new Bitmap(bitmap);
481 if (newBitmap == NULL)
482 {
483 DllExports::GdipDisposeImage(bitmap);
484 }
485
486 return newBitmap;
487 }

◆ FromBITMAPINFO()

static Bitmap * Bitmap::FromBITMAPINFO ( const BITMAPINFO gdiBitmapInfo,
VOID gdiBitmapData 
)
inlinestatic

Definition at line 508 of file gdiplusheaders.h.

509 {
510 return new Bitmap(gdiBitmapInfo, gdiBitmapData);
511 }

◆ FromFile()

static Bitmap * Bitmap::FromFile ( const WCHAR filename,
BOOL  useEmbeddedColorManagement 
)
inlinestatic

Definition at line 519 of file gdiplusheaders.h.

520 {
521 return new Bitmap(filename, useEmbeddedColorManagement);
522 }

Referenced by CAppScrnshotPreview::DisplayFile().

◆ FromHBITMAP()

static Bitmap * Bitmap::FromHBITMAP ( HBITMAP  hbm,
HPALETTE  hpal 
)
inlinestatic

Definition at line 525 of file gdiplusheaders.h.

526 {
527 return new Bitmap(hbm, hpal);
528 }

◆ FromHICON()

static Bitmap * Bitmap::FromHICON ( HICON  hicon)
inlinestatic

Definition at line 531 of file gdiplusheaders.h.

532 {
533 return new Bitmap(hicon);
534 }

◆ FromResource()

static Bitmap * Bitmap::FromResource ( HINSTANCE  hInstance,
const WCHAR bitmapName 
)
inlinestatic

Definition at line 537 of file gdiplusheaders.h.

538 {
539 return new Bitmap(hInstance, bitmapName);
540 }

◆ FromStream()

static Bitmap * Bitmap::FromStream ( IStream stream,
BOOL  useEmbeddedColorManagement 
)
inlinestatic

Definition at line 543 of file gdiplusheaders.h.

544 {
545 return new Bitmap(stream, useEmbeddedColorManagement);
546 }

◆ GetHBITMAP()

Status Bitmap::GetHBITMAP ( const Color colorBackground,
HBITMAP hbmReturn 
)
inline

Definition at line 549 of file gdiplusheaders.h.

550 {
551 return SetStatus(
552 DllExports::GdipCreateHBITMAPFromBitmap(GetNativeBitmap(), hbmReturn, colorBackground.GetValue()));
553 }
Status SetStatus(Status status) const

◆ GetHICON()

Status Bitmap::GetHICON ( HICON hicon)
inline

Definition at line 556 of file gdiplusheaders.h.

557 {
558 return SetStatus(DllExports::GdipCreateHICONFromBitmap(GetNativeBitmap(), hicon));
559 }

◆ GetNativeBitmap()

GpBitmap * Bitmap::GetNativeBitmap ( ) const
inlineprotected

Definition at line 607 of file gdiplusheaders.h.

608 {
609 return static_cast<GpBitmap *>(nativeImage);
610 }
GpImage * nativeImage

Referenced by Clone(), GetHBITMAP(), GetHICON(), GetPixel(), LockBits(), SetPixel(), SetResolution(), and UnlockBits().

◆ GetPixel()

Status Bitmap::GetPixel ( INT  x,
INT  y,
Color color 
)
inline

Definition at line 562 of file gdiplusheaders.h.

563 {
564 ARGB argb;
565 Status s = SetStatus(DllExports::GdipBitmapGetPixel(GetNativeBitmap(), x, y, &argb));
566 if (color)
567 color->SetValue(argb);
568 return s;
569 }
DWORD ARGB
Status
Definition: gdiplustypes.h:25
GLdouble s
Definition: gl.h:2039
GLuint color
Definition: glext.h:6243

◆ LockBits()

Status Bitmap::LockBits ( const Rect rect,
UINT  flags,
PixelFormat  format,
BitmapData lockedBitmapData 
)
inline

Definition at line 572 of file gdiplusheaders.h.

573 {
574 return SetStatus(DllExports::GdipBitmapLockBits(GetNativeBitmap(), rect, flags, format, lockedBitmapData));
575 }
GLbitfield flags
Definition: glext.h:7161

◆ SetPixel()

Status Bitmap::SetPixel ( INT  x,
INT  y,
const Color color 
)
inline

Definition at line 578 of file gdiplusheaders.h.

579 {
580 return SetStatus(DllExports::GdipBitmapSetPixel(GetNativeBitmap(), x, y, color.GetValue()));
581 }

◆ SetResolution()

Status Bitmap::SetResolution ( REAL  xdpi,
REAL  ydpi 
)
inline

Definition at line 584 of file gdiplusheaders.h.

585 {
586 return SetStatus(DllExports::GdipBitmapSetResolution(GetNativeBitmap(), xdpi, ydpi));
587 }

◆ UnlockBits()

Status Bitmap::UnlockBits ( BitmapData lockedBitmapData)
inline

Definition at line 590 of file gdiplusheaders.h.

591 {
592 return SetStatus(DllExports::GdipBitmapUnlockBits(GetNativeBitmap(), lockedBitmapData));
593 }

Friends And Related Function Documentation

◆ CachedBitmap

friend class CachedBitmap
friend

Definition at line 380 of file gdiplusheaders.h.


The documentation for this class was generated from the following file: