@@ -15,7 +15,7 @@ ms.assetid: 52861e3d-bf7e-481f-a240-90e88f76c490
15
15
16
16
## Syntax
17
17
18
- ```
18
+ ``` cpp
19
19
class CImage
20
20
```
21
21
@@ -148,7 +148,7 @@ You can use `CImage` from either MFC or ATL.
148
148
149
149
Displays bitmaps that have transparent or semitransparent pixels.
150
150
151
- ```
151
+ ```cpp
152
152
BOOL AlphaBlend(
153
153
HDC hDestDC,
154
154
int xDest,
@@ -267,7 +267,7 @@ The bitmap can be either a non-DIB section bitmap or a DIB section bitmap. See [
267
267
268
268
Copies a bitmap from the source device context to this current device context.
269
269
270
- ```
270
+ ```cpp
271
271
BOOL BitBlt(
272
272
HDC hDestDC,
273
273
int xDest,
@@ -343,7 +343,7 @@ For more information, see [`BitBlt`](/windows/win32/api/wingdi/nf-wingdi-bitblt)
343
343
344
344
Constructs a ` CImage ` object.
345
345
346
- ```
346
+ ``` cpp
347
347
CImage () throw();
348
348
```
349
349
@@ -359,7 +359,7 @@ Using global `CImage` objects in a DLL is not recommended. If you need to use a
359
359
360
360
Creates a ` CImage ` bitmap and attach it to the previously constructed ` CImage ` object.
361
361
362
- ```
362
+ ``` cpp
363
363
BOOL Create (
364
364
int nWidth,
365
365
int nHeight,
@@ -394,7 +394,7 @@ Nonzero if successful; otherwise 0.
394
394
395
395
Creates a `CImage` bitmap and attach it to the previously constructed `CImage` object.
396
396
397
- ```
397
+ ```cpp
398
398
BOOL CreateEx(
399
399
int nWidth,
400
400
int nHeight,
@@ -458,7 +458,7 @@ void Destroy() throw();
458
458
459
459
Detaches a bitmap from a ` CImage ` object.
460
460
461
- ```
461
+ ``` cpp
462
462
HBITMAP Detach () throw();
463
463
```
464
464
@@ -470,7 +470,7 @@ A handle to the bitmap detached, or `NULL` if no bitmap is attached.
470
470
471
471
Copies a bitmap from the source device context to the current device context.
472
472
473
- ```
473
+ ``` cpp
474
474
BOOL Draw (
475
475
HDC hDestDC,
476
476
int xDest,
@@ -579,7 +579,7 @@ Using this pointer, along with the value returned by [`GetPitch`](#getpitch), yo
579
579
580
580
Retrieves the bits-per-pixel value.
581
581
582
- ```
582
+ ``` cpp
583
583
int GetBPP () const throw();
584
584
```
585
585
@@ -619,7 +619,7 @@ A pointer to the array of [`RGBQUAD`](/windows/win32/api/wingdi/ns-wingdi-rgbqua
619
619
620
620
Retrieves the device context that currently has the image selected into it.
621
621
622
- ```
622
+ ```cpp
623
623
HDC GetDC() const throw();
624
624
```
625
625
@@ -635,7 +635,7 @@ For each call to `GetDC`, you must have a subsequent call to [`ReleaseDC`](#rele
635
635
636
636
Finds image formats available for saving images.
637
637
638
- ```
638
+ ``` cpp
639
639
static HRESULT GetExporterFilterString (
640
640
CSimpleString& strExporters,
641
641
CSimpleArray<GUID>& aguidFileTypes,
@@ -718,7 +718,7 @@ Use the default separator `|` if you pass this string to an MFC `CFileDialog` ob
718
718
719
719
Retrieves the height, in pixels, of an image.
720
720
721
- ```
721
+ ``` cpp
722
722
int GetHeight () const throw();
723
723
```
724
724
@@ -730,7 +730,7 @@ The height, in pixels, of an image.
730
730
731
731
Finds image formats available for loading images.
732
732
733
- ```
733
+ ``` cpp
734
734
static HRESULT GetImporterFilterString (
735
735
CSimpleString& strImporters,
736
736
CSimpleArray<GUID>& aguidFileTypes,
@@ -809,7 +809,7 @@ Use the default separator `|` if you pass this string to an MFC `CFileDialog` ob
809
809
810
810
Retrieves the maximum number of entries in the color table.
811
811
812
- ```
812
+ ``` cpp
813
813
int GetMaxColorTableEntries () const throw();
814
814
```
815
815
@@ -825,7 +825,7 @@ This method supports only DIB section bitmaps.
825
825
826
826
Retrieves the pitch of an image.
827
827
828
- ```
828
+ ``` cpp
829
829
int GetPitch () const throw();
830
830
```
831
831
@@ -846,7 +846,7 @@ Use `GetPitch` with [`GetBits`](#getbits) to find individual pixels of an image.
846
846
847
847
Retrieves the color of the pixel at the location specified by * x* and * y* .
848
848
849
- ```
849
+ ``` cpp
850
850
COLORREF GetPixel (int x, int y) const throw();
851
851
```
852
852
@@ -891,7 +891,7 @@ For formats that have less than 8 bits per pixel, this method returns the addres
891
891
892
892
Retrieves the indexed location of the transparent color in the color palette.
893
893
894
- ```
894
+ ``` cpp
895
895
LONG GetTransparentColor () const throw();
896
896
```
897
897
@@ -903,7 +903,7 @@ The index of the transparent color.
903
903
904
904
Retrieves the width, in pixels, of an image.
905
905
906
- ```
906
+ ``` cpp
907
907
int GetWidth () const throw();
908
908
```
909
909
@@ -915,7 +915,7 @@ The width of the bitmap, in pixels.
915
915
916
916
Determines if the attached bitmap is a DIB section.
917
917
918
- ```
918
+ ``` cpp
919
919
bool IsDIBSection () const throw();
920
920
```
921
921
@@ -945,7 +945,7 @@ If the bitmap is not a DIB section, you cannot use the following `CImage` method
945
945
946
946
Determines whether a bitmap's pixels are mapped to a color palette.
947
947
948
- ```
948
+ ``` cpp
949
949
bool IsIndexed () const throw();
950
950
```
951
951
@@ -964,7 +964,7 @@ This method returns `TRUE` only if the bitmap is 8-bit (256 colors) or less.
964
964
965
965
Determines if a bitmap is currently loaded.
966
966
967
- ```
967
+ ``` cpp
968
968
bool IsNull () const throw();
969
969
```
970
970
@@ -976,7 +976,7 @@ This method returns `TRUE` if a bitmap is not currently loaded; otherwise `FALSE
976
976
977
977
Indicates whether the application supports transparent bitmaps.
978
978
979
- ```
979
+ ``` cpp
980
980
static BOOL IsTransparencySupported () throw();
981
981
```
982
982
@@ -992,7 +992,7 @@ If the return value is nonzero, and transparency is supported, a call to [`Alpha
992
992
993
993
Loads an image.
994
994
995
- ```
995
+ ``` cpp
996
996
HRESULT Load (LPCTSTR pszFileName) throw();
997
997
HRESULT Load(IStream* pStream) throw();
998
998
```
@@ -1048,7 +1048,7 @@ The resource must be of type `BITMAP`.
1048
1048
1049
1049
Combines the color data for the source and destination bitmaps using the specified mask and raster operation.
1050
1050
1051
- ```
1051
+ ``` cpp
1052
1052
BOOL MaskBlt (
1053
1053
HDC hDestDC,
1054
1054
int xDest,
@@ -1147,7 +1147,7 @@ Use this operator to get the attached Windows GDI handle of the `CImage` object.
1147
1147
1148
1148
Performs a bit-block transfer from a rectangle in a source device context into a parallelogram in a destination device context.
1149
1149
1150
- ```
1150
+ ```cpp
1151
1151
BOOL PlgBlt(
1152
1152
HDC hDestDC,
1153
1153
const POINT* pPoints,
@@ -1245,7 +1245,7 @@ This method must be called to free resources allocated by a global `CImage` obje
1245
1245
1246
1246
Saves an image to the specified stream or file on disk.
1247
1247
1248
- ```
1248
+ ``` cpp
1249
1249
HRESULT Save (
1250
1250
IStream* pStream,
1251
1251
REFGUID guidFileType) const throw();
@@ -1391,7 +1391,7 @@ The red, green, and blue parameters are each represented by a number between 0 a
1391
1391
1392
1392
Sets a color at a given indexed location as transparent.
1393
1393
1394
- ```
1394
+ ```cpp
1395
1395
LONG SetTransparentColor(LONG iTransparentColor) throw();
1396
1396
```
1397
1397
@@ -1408,7 +1408,7 @@ The index of the color previously set as transparent.
1408
1408
1409
1409
Copies a bitmap from the source device context to this current device context.
1410
1410
1411
- ```
1411
+ ``` cpp
1412
1412
BOOL StretchBlt (
1413
1413
HDC hDestDC,
1414
1414
int xDest,
@@ -1491,7 +1491,7 @@ For more information, see [`StretchBlt`](/windows/win32/api/wingdi/nf-wingdi-str
1491
1491
1492
1492
Copies a bitmap from the source device context to this current device context.
1493
1493
1494
- ```
1494
+ ```cpp
1495
1495
BOOL TransparentBlt(
1496
1496
HDC hDestDC,
1497
1497
int xDest,
0 commit comments