5/27/2023 0 Comments Simpleimage class![]() ![]() Because an HBITMAP can only be selected into one HDC at a time, the HBITMAP associated with the CImage cannot be selected into another HDC. CImage creates its own HDC for the image. If you need to use a global CImage object in a DLL, call CImage::ReleaseGDIPlus to explicitly release resources used by GDI+.ĬImage cannot be selected into a new CDC. Using global CImage objects in a DLL is not recommended. To determine if an attached bitmap is a DIB section, call IsDibSection. ![]() You can attach a non-DIB section bitmap to a CImage object using Attach, but then you cannot use the following CImage methods, which support only DIB section bitmaps: Returns the Windows handle attached to the CImage object.ĬImage takes bitmaps that are either device-independent bitmap (DIB) sections or not however, you can use Create or CImage::Load with only DIB sections. Only one color in a palette can be transparent.Ĭopies a bitmap from a source rectangle into a destination rectangle, stretching or compressing the bitmap to fit the dimensions of the destination rectangle, if necessary.Ĭopies a bitmap with transparent color from the source device context to this current device context. Sets the index of the color to be treated as transparent. Sets the pixel at the specified coordinates to the specified red, green, blue (RGB) value. Sets the pixel at the specified coordinates to the color at the specified index of the palette. Sets the pixel at the specified coordinates to the specified color. Sets red, green, blue RGB) color values in a range of entries in the color table of the DIB section. Must be called to free resources created by a global CImage object. Releases the device context that was retrieved with CImage::GetDC. Performs a bit-block transfer from a rectangle in a source device context into a parallelogram in a destination device context. Loads an image from the specified resource.Ĭombines the color data for the source and destination bitmaps using the specified mask and raster operation. Indicates whether the application supports transparent bitmaps. Indicates if a source bitmap is currently loaded. Indicates that a bitmap's colors are mapped to an indexed palette. Retrieves the width of the current image in pixels.ĭetermines if the attached bitmap is a DIB section. Retrieves the position of the transparent color in the color table. Retrieves the color of the pixel specified by x and y. ![]() Retrieves the pitch of the current image, in bytes. Retrieves the maximum number of entries in the color table. ![]() Retrieves the height of the current image in pixels. Retrieves the device context into which the current bitmap is selected.įinds the available image formats and their descriptions. Retrieves red, green, blue (RGB) color values from a range of entries in the color table. Retrieves a pointer to the actual pixel values of the bitmap. Draw stretches or compresses the bitmap to fit the dimensions of the destination rectangle, if necessary, and handles alpha blending and transparent colors. Can be used with either non-DIB section bitmaps or DIB section bitmaps.Ĭopies a bitmap from the source device context to this current device context.Ĭreates a DIB section bitmap and attaches it to the previously constructed CImage object.Ĭreates a DIB section bitmap (with additional parameters) and attaches it to the previously constructed CImage object.ĭetaches the bitmap from the CImage object and destroys the bitmap.ĭetaches the bitmap from a CImage object.Ĭopies a bitmap from a source rectangle into a destination rectangle. Syntax class CImageĭisplays bitmaps that have transparent or semitransparent pixels.Īttaches an HBITMAP to a CImage object. This class and its members cannot be used in applications that execute in the Windows Runtime. ![]()
0 Comments
Leave a Reply. |