xtd 1.0.0
Loading...
Searching...
No Matches
xtd::drawing::image Class Reference
Inheritance diagram for xtd::drawing::image:
xtd::object xtd::iequatable< image > xtd::interface xtd::extensions::equality_operators< image, iequatable< image > > xtd::drawing::bitmap

Definition

An abstract base class that provides functionality for the bitmap and metafile descended classes.

class drawing_export_ image : public xtd::object, public xtd::iequatable<image>
An abstract base class that provides functionality for the bitmap and metafile descended classes.
Definition image.hpp:49
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition iequatable.hpp:23
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.hpp:45
#define drawing_export_
Define shared library export.
Definition drawing_export.hpp:13
Inheritance
xtd::objectxtd::drawing::image
Namespace
xtd::drawing
Library
xtd.drawing
Remarks
To draw an image on a Windows Form, you should use one of the draw_image methods.
Examples
draw_image.cpp, and image_effects.cpp.

Public Fields

static image empty
 Represent an empty xtd::drawing::image.

Public Properties

auto alpha () const -> const xtd::byte *
 Gets the image alpha pointer, which represents the alpha data of the image.
auto alpha () -> xtd::byte *
 Gets the image alpha pointer, which represents the alpha data of the image.
auto flags () const noexcept -> xtd::int32
 Gets attribute flags for the pixel data of this xtd::drawing::image.
auto frame_dimentions_list () const noexcept -> xtd::array< guid >
 Gets an array of GUIDs that represent the dimensions of frames within this image.
auto handle () const noexcept -> xtd::intptr
 Gets the handle of this image.
auto height () const noexcept -> xtd::int32
 Gets the height, in pixels, of this image.
auto horizontal_resolution () const noexcept -> float
 Gets the horizontal resolution, in pixels per inch, of this image.
auto palette () const noexcept -> xtd::drawing::imaging::color_palette
 Gets the color palette used for this image.
auto palette (const xtd::drawing::imaging::color_palette &palette) noexcept -> void
 Sets the color palette used for this image.
auto physical_dimension () const noexcept -> const xtd::drawing::size_f &
 Gets the width and height of this image.
auto pixel_format () const noexcept -> xtd::drawing::imaging::pixel_format
 Gets the pixel format for this image.
auto property_id_list () const noexcept -> const xtd::array< xtd::int32 > &
 Gets IDs of the property items stored in this image.
auto property_items () const noexcept -> const xtd::array< xtd::drawing::imaging::property_item > &
 Gets all the property items (pieces of metadata) stored in this image.
auto raw_format () const noexcept -> const xtd::drawing::imaging::image_format &
 Gets the file format of this image.
auto rgb () const -> const xtd::byte *
 Gets the image data pointer, which represents the RGB data of the image.
auto rgb () -> xtd::byte *
 Gets the image data pointer, which represents the RGB data of the image.
auto size () const noexcept -> const xtd::drawing::size &
 Gets the width and height, in pixels, of this image.
auto tag () const noexcept -> const xtd::any_object &
 Gets an object that provides additional data about the image.
auto tag (const xtd::any_object &tag) noexcept -> void
 Sets an object that provides additional data about the image.
auto vertical_resolution () const noexcept -> float
 Gets the vertical resolution, in pixels per inch, of this image.
auto width () const noexcept -> xtd::int32
 Gets the width, in pixels, of this image.

Public Methods

auto clone () const -> image
 Creates an exact copy of this xtd::drawing::image.
auto create_graphics () -> xtd::drawing::graphics
 Creates the xtd::drawing::graphics for the image.
auto equals (const object &obj) const noexcept -> bool override
 Determines whether the specified object is equal to the current object.
auto equals (const image &other) const noexcept -> bool override
 Indicates whether the current object is equal to another object of the same type.
auto get_bounds (xtd::drawing::graphics_unit page_unit) const noexcept -> xtd::drawing::rectangle_f
 Gets the bounds of the image in the specified unit.
auto get_encoder_parameter_list (xtd::guid encoder) const noexcept -> xtd::drawing::imaging::encoder_parameters
 Returns information about the parameters supported by the specified image encoder.
auto get_frame_count (const xtd::drawing::imaging::frame_dimension &dimension) const -> xtd::usize
 Returns the number of frames of the specified dimension.
auto get_hash_code () const noexcept -> xtd::usize override
 Serves as a hash function for a particular type.
auto get_property_item (int32 propid) -> xtd::drawing::imaging::property_item
 Gets the specified property item from this xtd::drawing::image.
auto get_thmbnail_image (int32 thumb_width, int32 thunb_height) noexcept -> xtd::drawing::image
 Returns a thumbnail for this xtd::drawing::image.
auto rotate_flip (xtd::drawing::rotate_flip_type rotate_flip_typerotate_flip_type) -> void
 Rotates, flips, or rotates and flips the xtd::drawing::image.
auto save (const xtd::string &filename) const -> void
 Saves this xtd::drawing::image to the specified file or stream.
auto save (const xtd::string &filename, const xtd::drawing::imaging::image_format &format) const -> void
 Saves this xtd::drawing::image to the specified file in the specified format.
auto save (std::ostream &stream, const xtd::drawing::imaging::image_format &format) const -> void
 Saves this image to the specified stream in the specified format.

Public Static Methods

static auto from_file (const xtd::string &filename) -> image
 Creates an image from the specified file.
static auto from_hbitmap (xtd::intptr hbitmap) -> bitmap
 Creates a xtd::drawing::bitmap from a handle to a GDI bitmap.
static auto from_stream (std::istream &stream) -> image
 Creates an xtd::drawing::image from the specified data stream.
static auto from_xbm_data (const unsigned char *bits, int32 width, int32 height) -> bitmap
 Creates an xtd::drawing::image from the specified data pointer, width and hieght.
static auto from_xpm_data (const char *const *bits) -> bitmap
 Creates an xtd::drawing::image from the specified data pointer.
static auto get_pixel_format_size (xtd::drawing::imaging::pixel_format pixfmt) noexcept -> xtd::int32
 Returns the color depth, in number of bits per pixel, of the specified pixel format.
static auto is_alpha_pixel_format (xtd::drawing::imaging::pixel_format pixfmt) noexcept -> bool
 Returns a value that indicates whether the pixel format for this xtd::drawing::image contains alpha information.
static auto is_canonical_pixel_format (xtd::drawing::imaging::pixel_format pixfmt) noexcept -> bool
 Returns a value that indicates whether the pixel format is 32 bits per pixel.
static auto is_extended_pixel_format (xtd::drawing::imaging::pixel_format pixfmt) noexcept -> bool
 Returns a value that indicates whether the pixel format is 64 bits per pixel.

Additional Inherited Members

 object ()=default
 Create a new instance of the ultimate base class object.
virtual auto get_type () const noexcept -> type_object
 Gets the type of the current instance.
template<typename object_t>
auto memberwise_clone () const -> xtd::unique_ptr_object< object_t >
 Creates a shallow copy of the current object.
virtual auto to_string () const -> xtd::string
 Returns a xtd::string that represents the current object.
virtual auto equals (const image &) const noexcept -> bool=0
 Indicates whether the current object is equal to another object of the same type.
template<typename object_a_t, typename object_b_t>
static auto equals (const object_a_t &object_a, const object_b_t &object_b) noexcept -> bool
 Determines whether the specified object instances are considered equal.
template<typename object_a_t, typename object_b_t>
static auto reference_equals (const object_a_t &object_a, const object_b_t &object_b) noexcept -> bool
 Determines whether the specified object instances are the same instance.

Member Function Documentation

◆ alpha() [1/2]

auto xtd::drawing::image::alpha ( ) const -> const xtd::byte *
nodiscard

Gets the image alpha pointer, which represents the alpha data of the image.

Returns
The pointer or alpha image.
Remarks
The size of this data is 1 byte (alpha) * height() * width().
If the image has no handle, such as an empty image, this method returns nullptr.
Warning
Be careful when using this pointer as there is no control and you can exceed its size and create irreparable problems.
Remarks
To access the position of a specific pixel, it's best to use the xtd::drawing::image::get_pixel and xtd::drawing::image::set_pixel methods.

◆ alpha() [2/2]

auto xtd::drawing::image::alpha ( ) -> xtd::byte *
nodiscard

Gets the image alpha pointer, which represents the alpha data of the image.

Returns
The pointer or alpha image.
Remarks
The size of this data is 1 byte (alpha) * height() * width().
If the image has no handle, such as an empty image, this method returns nullptr.
Warning
Be careful when using this pointer as there is no control and you can exceed its size and create irreparable problems.
Remarks
To access the position of a specific pixel, it's best to use the xtd::drawing::image::get_pixel and xtd::drawing::image::set_pixel methods.

◆ flags()

auto xtd::drawing::image::flags ( ) const -> xtd::int32
nodiscardnoexcept

Gets attribute flags for the pixel data of this xtd::drawing::image.

Returns
The integer representing a bitwise combination of xtd::drawing::imaging::image_flags for this xtd::drawing::image.
Remarks
The integer value returned from this method will correspond to a sum of image_flags, as described in the following table.
image_flag value Integer representation
image_flags_none 0
Iimage_flags_scalable 1
Iimage_flags_has_alpha 2
Iimage_flags_has_translucent 4
Iimage_flags_partially_scalable 8
Iimage_flags_color_space_rgb 16
Iimage_flags_color_space_cmyk 32
Iimage_flags_color_space_gray 64
Iimage_flags_color_space_ycbr 128
Iimage_flags_color_space_ycck 256
Iimage_flags_has_real_dpi 4096
Iimage_flags_has_real_pixel_size 8192
Iimage_flags_read_only 65536
Iimage_flags_caching 131072
For example, if the Flags property for an image returned 77960, the image_flags for the image would be read_only, has_real_dpi, has_real_pixel_size, color_space_ycbcr, and partially_scalable.

◆ frame_dimentions_list()

auto xtd::drawing::image::frame_dimentions_list ( ) const -> xtd::array< guid >
nodiscardnoexcept

Gets an array of GUIDs that represent the dimensions of frames within this image.

Returns
An array of GUIDs that specify the dimensions of frames within this xtd::drawing::image from most significant to least significant.
Remarks
This method returns information about multiple-frame images, which come in two styles: multiple page and multiple resolution.
A multiple-page image is an image that contains more than one image. Each page contains a single image (or frame). These pages (or images, or frames) are typically displayed in succession to produce an animated sequence, such as an animated .gif file.
A multiple-resolution image is an image that contains more than one copy of an image at different resolutions. This is commonly used by MIP mapping where the displayed image size determines the resolution of the image used for drawing. GDI+ can support an arbitrary number of pages (or images, or frames), as well as an arbitrary number of resolutions. The defined dimensions are properties of the frame_dimension.

◆ handle()

auto xtd::drawing::image::handle ( ) const -> xtd::intptr
nodiscardnoexcept

Gets the handle of this image.

Returns
The handle of this image.

◆ height()

auto xtd::drawing::image::height ( ) const -> xtd::int32
nodiscardnoexcept

Gets the height, in pixels, of this image.

Returns
The height, in pixels, of this image.

◆ horizontal_resolution()

auto xtd::drawing::image::horizontal_resolution ( ) const -> float
nodiscardnoexcept

Gets the horizontal resolution, in pixels per inch, of this image.

Returns
The horizontal resolution, in pixels per inch, of this image.

◆ palette() [1/2]

auto xtd::drawing::image::palette ( ) const -> xtd::drawing::imaging::color_palette
nodiscardnoexcept

Gets the color palette used for this image.

Returns
An xtd::drawing::imaging::color_palette that represents the color palette used for this image.
Remarks
This property returns a copy of the xtd::drawing::imaging::color_palette object used by this xtd::drawing::image.

◆ palette() [2/2]

auto xtd::drawing::image::palette ( const xtd::drawing::imaging::color_palette & palette) -> void
noexcept

Sets the color palette used for this image.

Parameters
paletteA color_palette that represents the color palette used for this image.

◆ physical_dimension()

auto xtd::drawing::image::physical_dimension ( ) const -> const xtd::drawing::size_f &
nodiscardnoexcept

Gets the width and height of this image.

Returns
A xtd::drawing::size_f structure that represents the width and height of this image.
Remarks
If the image is a bitmap, the width and height are returned in pixels. If the image is a metafile, the width and height are returned in 0.01 millimeter units.

◆ pixel_format()

auto xtd::drawing::image::pixel_format ( ) const -> xtd::drawing::imaging::pixel_format
nodiscardnoexcept

Gets the pixel format for this image.

Returns
A pixel_format that represents the pixel format for this image.

◆ property_id_list()

auto xtd::drawing::image::property_id_list ( ) const -> const xtd::array< xtd::int32 > &
nodiscardnoexcept

Gets IDs of the property items stored in this image.

Returns
An array of the property IDs, one for each property item stored in this image.
Remarks
If the image has no property items or if the image format does not support property items, the property_id_list property returns an empty array (that is, an array of length zero).

◆ property_items()

auto xtd::drawing::image::property_items ( ) const -> const xtd::array< xtd::drawing::imaging::property_item > &
nodiscardnoexcept

Gets all the property items (pieces of metadata) stored in this image.

Returns
An array of xtd::drawing::imaging::property_item objects, one for each property item stored in the image.
Remarks
IIf the image has no property items or if the image format does not support property items, property_items returns an empty array (that is, an array of length zero).

◆ raw_format()

auto xtd::drawing::image::raw_format ( ) const -> const xtd::drawing::imaging::image_format &
nodiscardnoexcept

Gets the file format of this image.

Returns
The image_format that represents the file format of this image.

◆ rgb() [1/2]

auto xtd::drawing::image::rgb ( ) const -> const xtd::byte *
nodiscard

Gets the image data pointer, which represents the RGB data of the image.

Returns
The pointer or data image.
Remarks
This is most often used when doing direct image manipulation. The return value points to an array of characters in RGBRGBRGB... format in the top-to-bottom, left-to-right order, that is the first RGB triplet corresponds to the first pixel of the first row, the second one — to the second pixel of the first row and so on until the end of the first row, with second row following after it and so on.
The size of this data is 3 bytes (RGB) * height() * width().
If the image has no handle, such as an empty image, this method returns nullptr.
Warning
Be careful when using this pointer as there is no control and you can exceed its size and create irreparable problems.
Remarks
To access the position of a specific pixel, it's best to use the xtd::drawing::image::get_pixel and xtd::drawing::image::set_pixel methods.

◆ rgb() [2/2]

auto xtd::drawing::image::rgb ( ) -> xtd::byte *
nodiscard

Gets the image data pointer, which represents the RGB data of the image.

Returns
The pointer or data image.
Remarks
This is most often used when doing direct image manipulation. The return value points to an array of characters in RGBRGBRGB... format in the top-to-bottom, left-to-right order, that is the first RGB triplet corresponds to the first pixel of the first row, the second one — to the second pixel of the first row and so on until the end of the first row, with second row following after it and so on.
The size of this data is 3 bytes (RGB) * height() * width().
If the image has no handle, such as an empty image, this method returns nullptr.
Warning
Be careful when using this pointer as there is no control and you can exceed its size and create irreparable problems.
Remarks
To access the position of a specific pixel, it's best to use the xtd::drawing::image::get_pixel and xtd::drawing::image::set_pixel methods.

◆ size()

auto xtd::drawing::image::size ( ) const -> const xtd::drawing::size &
nodiscardnoexcept

Gets the width and height, in pixels, of this image.

Returns
A size structure that represents the width and height, in pixels, of this image.

◆ tag() [1/2]

auto xtd::drawing::image::tag ( ) const -> const xtd::any_object &
nodiscardnoexcept

Gets an object that provides additional data about the image.

Returns
The object that provides additional data about the image.

◆ tag() [2/2]

auto xtd::drawing::image::tag ( const xtd::any_object & tag) -> void
noexcept

Sets an object that provides additional data about the image.

Parameters
tagThe object that provides additional data about the image.

◆ vertical_resolution()

auto xtd::drawing::image::vertical_resolution ( ) const -> float
nodiscardnoexcept

Gets the vertical resolution, in pixels per inch, of this image.

Returns
The vertical resolution, in pixels per inch, of this image.

◆ width()

auto xtd::drawing::image::width ( ) const -> xtd::int32
nodiscardnoexcept

Gets the width, in pixels, of this image.

Returns
The width, in pixels, of this image.

◆ clone()

auto xtd::drawing::image::clone ( ) const -> image
nodiscard

Creates an exact copy of this xtd::drawing::image.

Returns
The xtd::drawing::image this method creates.

◆ create_graphics()

auto xtd::drawing::image::create_graphics ( ) -> xtd::drawing::graphics
nodiscard

Creates the xtd::drawing::graphics for the image.

Returns
A xtd::drawing::graphics for the image.
Examples
image_effects.cpp.

◆ equals() [1/2]

auto xtd::drawing::image::equals ( const object & obj) const -> bool
nodiscardoverridevirtualnoexcept

Determines whether the specified object is equal to the current object.

Parameters
objThe object to compare with the current object.
Returns
true if the specified object is equal to the current object. otherwise, false.

Reimplemented from xtd::object.

◆ equals() [2/2]

auto xtd::drawing::image::equals ( const image & other) const -> bool
nodiscardoverridenoexcept

Indicates whether the current object is equal to another object of the same type.

Parameters
otherAn object to compare with this object.
Returns
true if the current object is equal to the other parameter; otherwise, false.

◆ get_bounds()

auto xtd::drawing::image::get_bounds ( xtd::drawing::graphics_unit page_unit) const -> xtd::drawing::rectangle_f
nodiscardnoexcept

Gets the bounds of the image in the specified unit.

Parameters
page_unitOne of the xtd::drawing::graphics_unit values indicating the unit of measure for the bounding rectangle.
Returns
The xtd::drawing::rectangle_f that represents the bounds of the image, in the specified unit.

◆ get_encoder_parameter_list()

auto xtd::drawing::image::get_encoder_parameter_list ( xtd::guid encoder) const -> xtd::drawing::imaging::encoder_parameters
nodiscardnoexcept

Returns information about the parameters supported by the specified image encoder.

Parameters
guidA GUID that specifies the image encoder.
Returns
An xtd::drawing::imaging::encoder_parameters that contains an array of xtd::drawing::imaging::encoder_parameter objects. Each xtd::drawing::imaging::encoder_parameter contains information about one of the parameters supported by the specified image encoder.

◆ get_frame_count()

auto xtd::drawing::image::get_frame_count ( const xtd::drawing::imaging::frame_dimension & dimension) const -> xtd::usize
nodiscard

Returns the number of frames of the specified dimension.

Parameters
dimensionA xtd::drawing::imaging::frame_dimension that specifies the identity of the dimension type.
Returns
The number of frames in the specified dimension.
Remarks
This method returns information about multiple-frame images, which come in two styles: multiple page and multiple resolution.
A multiple-page image is an image that contains more than one image. Each page contains a single image (or frame). These pages (or images, or frames) are typically displayed in succession to produce an animated sequence, such as an animated .gif file.
A multiple-resolution image is an image that contains more than one copy of an image at different resolutions. This is commonly used by MIP mapping where the displayed image size determines the resolution of the image used for drawing. GDI+ can support an arbitrary number of pages (or images, or frames), as well as an arbitrary number of resolutions. The defined dimensions are properties of the xtd::drawing::imaging::frame_dimension.

◆ get_hash_code()

auto xtd::drawing::image::get_hash_code ( ) const -> xtd::usize
nodiscardoverridevirtualnoexcept

Serves as a hash function for a particular type.

Returns
A hash code for the current object.

Reimplemented from xtd::object.

◆ get_property_item()

auto xtd::drawing::image::get_property_item ( int32 propid) -> xtd::drawing::imaging::property_item
nodiscard

Gets the specified property item from this xtd::drawing::image.

Parameters
propidThe ID of the property item to get.
Returns
The xtd::drawing::imaging::property_item this method gets.
Exceptions
xtd::argument_exceptionThe image format of this image does not support property items.
Remarks
For a list of property item IDs and links to more information, see Id.
It is difficult to set property items, because the xtd::drawing::imaging::property_item class has no public constructors. One way to work around this restriction is to obtain a xtd::drawing::imaging::property_item by retrieving the xtd::drawing::image::property_item property value or calling the xtd::drawing::image::get_property_item method of an xtd::drawing::image that already has property items. Then you can set the fields of the xtd::drawing::imaging::property_item and pass it to xtd::drawing::image::set_property_item.

◆ get_thmbnail_image()

auto xtd::drawing::image::get_thmbnail_image ( int32 thumb_width,
int32 thunb_height ) -> xtd::drawing::image
nodiscardnoexcept

Returns a thumbnail for this xtd::drawing::image.

Parameters
thbmb_widthThe width, in pixels, of the requested thumbnail image.
thum_heightThe height, in pixels, of the requested thumbnail image.
Returns
An xtd::drawing::image that represents the thumbnail.
Remarks
If the xtd::drawing::image contains an embedded thumbnail image, this method retrieves the embedded thumbnail and scales it to the requested size. If the xtd::drawing::image does not contain an embedded thumbnail image, this method creates a thumbnail image by scaling the main image.
The xtd::drawing::image::get_thumbnail_image method works well when the requested thumbnail image has a size of about 120 x 120 pixels. If you request a large thumbnail image (for example, 300 x 300) from an xtd::drawing::image that has an embedded thumbnail, there could be a noticeable loss of quality in the thumbnail image. It might be better to scale the main image (instead of scaling the embedded thumbnail) by calling the xtd::drawing::graphics::draw_image method.

◆ rotate_flip()

auto xtd::drawing::image::rotate_flip ( xtd::drawing::rotate_flip_type rotate_flip_type) -> void

Rotates, flips, or rotates and flips the xtd::drawing::image.

Parameters
rotate_flip_typeA xtd::drawing::rotate_flip_type member that specifies the type of rotation and flip to apply to the image.
Remarks
The xtd::drawing::image::rotate_flip method rotates the image clockwise.
If you wish to draw on an image once it has been rotated, you should always retrieve a new graphics object from the image, otherwise an exception could occur.

◆ save() [1/3]

auto xtd::drawing::image::save ( const xtd::string & filename) const -> void

Saves this xtd::drawing::image to the specified file or stream.

Parameters
filenameA string that contains the name of the file to which to save this xtd::drawing::image.
Remarks
If no encoder exists for the file format of the image, the Portable Network Graphics (PNG) encoder is used. When you use the xtd::drawing::image::save method to save a graphic image as a Windows Metafile Format (WMF) or Enhanced Metafile Format (EMF) file, the resulting file is saved as a Portable Network Graphics (PNG) file. This behavior occurs because the GDI+ component of the .NET Framework does not have an encoder that you can use to save files as .wmf or .emf files.
Saving the image to the same file it was constructed from is not allowed and throws an exception.

◆ save() [2/3]

auto xtd::drawing::image::save ( const xtd::string & filename,
const xtd::drawing::imaging::image_format & format ) const -> void

Saves this xtd::drawing::image to the specified file in the specified format.

Parameters
filenameA string that contains the name of the file to which to save this xtd::drawing::image.
formatThe xtd::drawing::imaging::image_format for this xtd::drawing::image.

◆ save() [3/3]

auto xtd::drawing::image::save ( std::ostream & stream,
const xtd::drawing::imaging::image_format & format ) const -> void

Saves this image to the specified stream in the specified format.

Parameters
streamThe std::otream where the image will be saved.
formatThe xtd::drawing::imaging::image_format for this xtd::drawing::image.
Remarks
You should avoid saving an image to the same stream that was used to construct it. Doing so might damage the stream.
The image must be saved to the stream at an offset of zero. If any additional data has been written to the stream before saving the image, the image data in the stream will be corrupted.

◆ from_file()

auto xtd::drawing::image::from_file ( const xtd::string & filename) -> image
staticnodiscard

Creates an image from the specified file.

Parameters
filenameA string that contains the name of the file from which to create the image.
Returns
The xtd::drawing::image this method creates.

◆ from_hbitmap()

auto xtd::drawing::image::from_hbitmap ( xtd::intptr hbitmap) -> bitmap
staticnodiscard

Creates a xtd::drawing::bitmap from a handle to a GDI bitmap.

Parameters
hbitmapThe GDI bitmap handle from which to create the xtd::drawing::bitmap.
Returns
The xtd::drawing::bitmap this method creates.
Remarks
The xtd::drawing::image::from_hbitmap method makes a copy of the GDI bitmap; so you can release the incoming GDI bitmap using the GDI DeleteObject method immediately after creating the new xtd::drawing::image.

◆ from_stream()

auto xtd::drawing::image::from_stream ( std::istream & stream) -> image
staticnodiscard

Creates an xtd::drawing::image from the specified data stream.

Parameters
streamA std::istream that contains the data for this xtd::drawing::image.
Returns
The xtd::drawing::image this method creates.
Remarks
You must keep the stream open for the lifetime of the xtd::drawing::image.
Note
The xtd::drawing::image class does not support alpha transparency in bitmaps. To enable alpha transparency, use PNG images with 32 bits per pixel.

◆ from_xbm_data()

auto xtd::drawing::image::from_xbm_data ( const unsigned char * bits,
int32 width,
int32 height ) -> bitmap
staticnodiscard

Creates an xtd::drawing::image from the specified data pointer, width and hieght.

Parameters
dataA pointer that contains the data for the xtd::drawing::image.
widthThe width for the xtd::drawing::image.
heightThe height for the xtd::drawing::image.
Returns
The xtd::drawing::image this method creates.
Remarks
This method is used for creating a xtd::drawing::image from an XBM image.
Note
Use xtd::drawing::image::from_file instead xtd::drawing::image::from_xbm_data.

◆ from_xpm_data()

auto xtd::drawing::image::from_xpm_data ( const char *const * bits) -> bitmap
staticnodiscard

Creates an xtd::drawing::image from the specified data pointer.

Parameters
dataA pointer that contains the data for the xtd::drawing::image.
Returns
The xtd::drawing::image this method creates.
Remarks
This method is used for creating a xtd::drawing::image from an XPM image.
Note
Use xtd::drawing::image::from_file instead xtd::drawing::image::from_xpm_data.
Examples
about_box.cpp, about_dialog.cpp, and about_dialog_system.cpp.

◆ get_pixel_format_size()

auto xtd::drawing::image::get_pixel_format_size ( xtd::drawing::imaging::pixel_format pixfmt) -> xtd::int32
staticnodiscardnoexcept

Returns the color depth, in number of bits per pixel, of the specified pixel format.

Parameters
pixfmtThe xtd::drawing::imaging::pixel_format member that specifies the format for which to find the size.
Returns
The color depth of the specified pixel format.

◆ is_alpha_pixel_format()

auto xtd::drawing::image::is_alpha_pixel_format ( xtd::drawing::imaging::pixel_format pixfmt) -> bool
staticnodiscardnoexcept

Returns a value that indicates whether the pixel format for this xtd::drawing::image contains alpha information.

Parameters
pixfmtThe PixelFormat to test.
Returns
true if pixfmt contains alpha information; otherwise, false.

◆ is_canonical_pixel_format()

auto xtd::drawing::image::is_canonical_pixel_format ( xtd::drawing::imaging::pixel_format pixfmt) -> bool
staticnodiscardnoexcept

Returns a value that indicates whether the pixel format is 32 bits per pixel.

Parameters
pixfmtThe PixelFormat to test.
Returns
true if pixfmt is canonical; otherwise, false.

◆ is_extended_pixel_format()

auto xtd::drawing::image::is_extended_pixel_format ( xtd::drawing::imaging::pixel_format pixfmt) -> bool
staticnodiscardnoexcept

Returns a value that indicates whether the pixel format is 64 bits per pixel.

Parameters
pixfmtThe PixelFormat to test.
Returns
true if pixfmt is extended; otherwise, false.

Member Data Documentation

◆ empty


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