Encapsulates a GDI+ bitmap, which consists of the pixel data for a graphics image and its attributes. A bitmap is an object used to work with images defined by pixel data.
Public Fields | |
| static bitmap | empty |
| Represent an empty bitmap. | |
Public Constructors | |
| bitmap (const xtd::drawing::image &original) | |
| Initializes a new instance of the bitmap class from the specified existing image. | |
| bitmap (const xtd::drawing::image &original, const xtd::drawing::size &new_size) | |
| Initializes a new instance of the bitmap class from the specified existing image, scaled to the specified size. | |
| bitmap (const xtd::drawing::image &original, xtd::int32 width, xtd::int32 height) | |
| Initializes a new instance of the bitmap class from the specified existing image, scaled to the specified size. | |
| bitmap (const xtd::drawing::image &original, const xtd::drawing::rectangle &new_rect) | |
| Initializes a new instance of the bitmap class from the specified existing image, resizing or cropping (without scaling) with the specified rectangle. | |
| bitmap (const xtd::string &filename) | |
| Initializes a new instance of the bitmap class from the specified file. | |
| bitmap (const xtd::string &filename, bool use_icm) | |
| Initializes a new instance of the bitmap class from the specified file. | |
| bitmap (std::istream &stream) | |
| Initializes a new instance of the bitmap class from the specified data stream. | |
| bitmap (std::istream &stream, bool use_icm) | |
| Initializes a new instance of the bitmap class from the specified data stream. | |
| bitmap (xtd::int32 width, xtd::int32 height) | |
| Initializes a new instance of the xtd::drawing::bitmap class with the specified size. | |
| bitmap (xtd::int32 width, xtd::int32 height, const xtd::drawing::graphics &g) | |
| Initializes a new instance of the xtd::drawing::bitmap class with the specified size and with the resolution of the specified xtd::drawing::raphics object. | |
| bitmap (xtd::int32 width, xtd::int32 height, xtd::drawing::imaging::pixel_format format) | |
| Initializes a new instance of the xtd::drawing::bitmap class with the specified size. | |
| bitmap (xtd::int32 width, xtd::int32 height, xtd::int32 stride, xtd::drawing::imaging::pixel_format format, xtd::intptr scan0) | |
| Initializes a new instance of the xtd::drawing::bitmap class with the specified size. | |
| bitmap (const xtd::drawing::size &size) | |
| Initializes a new instance of the xtd::drawing::bitmap class with the specified size. | |
Public Methods | |
| bitmap | clone (const xtd::drawing::rectangle &rect) const |
| Creates a copy of the section of this xtd::drawing::bitmap defined with a specified rectangle. | |
| bitmap | clone (const xtd::drawing::rectangle_f &rect) const |
| Creates a copy of the section of this xtd::drawing::bitmap defined with a specified rectangle. | |
| auto | get_hbitmap () const -> xtd::intptr |
| Creates a GDI bitmap object from this xtd::drawing::bitmap. | |
| auto | get_hbitmap (const xtd::drawing::color &background) const -> xtd::intptr |
| Creates a GDI bitmap object from this xtd::drawing::bitmap. | |
| auto | get_hicon () const -> xtd::intptr |
| Returns the handle to an icon. | |
| auto | get_pixel (xtd::int32 x, xtd::int32 y) const -> drawing::color |
| Gets the color of the specified pixel in this bitmap. | |
| auto | lock_bits (const xtd::drawing::rectangle &rect, xtd::drawing::imaging::image_lock_mode flags, xtd::drawing::imaging::pixel_format format) -> xtd::drawing::imaging::bitmap_data |
| Locks a xtd::drawing::bitmap into system memory. | |
| auto | lock_bits (const xtd::drawing::rectangle &rect, xtd::drawing::imaging::image_lock_mode flags, xtd::drawing::imaging::pixel_format format, const xtd::drawing::imaging::bitmap_data &data) -> xtd::drawing::imaging::bitmap_data |
| Locks a xtd::drawing::bitmap into system memory. | |
| auto | make_transparent () -> void |
| Makes the default transparent color transparent for this xtd::drawing::bitmap. | |
| auto | make_transparent (const xtd::drawing::color &transparent_color) -> void |
| Makes the specified color transparent for this xtd::drawing::bitmap. | |
| auto | set_pixel (xtd::int32 x, xtd::int32 y, const xtd::drawing::color &color) -> void |
| Sets the color of the specified pixel in this xtd::drawing::bitmap. | |
| auto | set_resolution (xtd::int32 x_dpi, xtd::int32 y_dpi) -> void |
| Sets the resolution for this xtd::drawing::bitmap. | |
| auto | unlock_bits (const xtd::drawing::imaging::bitmap_data &data) -> void |
| Unlocks this xtd::drawing::bitmap from system memory. | |
Public Deprecated Constructors | |
| bitmap (const char *const *bits) | |
| Initializes a new instance of the bitmap class from the specified data xpm. | |
Public Static Methods | |
| static auto | from_hicon (xtd::intptr icon) -> bitmap |
| Creates a xtd::drawing::bitmap from a Windows handle to an icon. | |
Additional Inherited Members | |
| static image | empty |
| Represent an empty xtd::drawing::image. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
|
explicit |
Initializes a new instance of the bitmap class from the specified existing image.
| original | The xtd::drawing::image from which to create the new bitmap. |
| xtd::drawing::bitmap::bitmap | ( | const xtd::drawing::image & | original, |
| const xtd::drawing::size & | new_size ) |
Initializes a new instance of the bitmap class from the specified existing image, scaled to the specified size.
| original | The xtd::drawing::image from which to create the new bitmap. |
| new_size | The xtd::drawing::size structure that represent the size of the new bitmap. |
| xtd::drawing::bitmap::bitmap | ( | const xtd::drawing::image & | original, |
| xtd::int32 | width, | ||
| xtd::int32 | height ) |
Initializes a new instance of the bitmap class from the specified existing image, scaled to the specified size.
| original | The xtd::drawing::image from which to create the new bitmap. |
| width | The width, in pixels, of the new xtd::drawing::bitmap. |
| height | The height, in pixels, of the new xtd::drawing::bitmap. |
| xtd::drawing::bitmap::bitmap | ( | const xtd::drawing::image & | original, |
| const xtd::drawing::rectangle & | new_rect ) |
Initializes a new instance of the bitmap class from the specified existing image, resizing or cropping (without scaling) with the specified rectangle.
| original | The xtd::drawing::image from which to create the new bitmap. |
| new_rect | The xtd::drawing::rect structure that represent the location and size of the new bitmap. |
|
explicit |
Initializes a new instance of the bitmap class from the specified file.
| filename | The bitmap file name and path. |
|
explicit |
Initializes a new instance of the bitmap class from the specified file.
| filename | The bitmap file name and path. |
| use_icm | true to use color correction for this xtd::drawing::bitmap; otherwise, false. |
|
explicit |
Initializes a new instance of the bitmap class from the specified data stream.
| stream | The data stream used to load the image. |
|
explicit |
Initializes a new instance of the bitmap class from the specified data stream.
| stream | The data stream used to load the image. |
| use_icm | true to use color correction for this xtd::drawing::bitmap; otherwise, false. |
| xtd::drawing::bitmap::bitmap | ( | xtd::int32 | width, |
| xtd::int32 | height ) |
Initializes a new instance of the xtd::drawing::bitmap class with the specified size.
| width | The width, in pixels, of the new bitmap. |
| height | The height, in pixels, of the new bitmap. |
| xtd::drawing::bitmap::bitmap | ( | xtd::int32 | width, |
| xtd::int32 | height, | ||
| const xtd::drawing::graphics & | g ) |
Initializes a new instance of the xtd::drawing::bitmap class with the specified size and with the resolution of the specified xtd::drawing::raphics object.
| width | The width, in pixels, of the new bitmap. |
| height | The height, in pixels, of the new bitmap. |
| g | The Graphics object that specifies the resolution for the new Bitmap. |
| xtd::drawing::bitmap::bitmap | ( | xtd::int32 | width, |
| xtd::int32 | height, | ||
| xtd::drawing::imaging::pixel_format | format ) |
Initializes a new instance of the xtd::drawing::bitmap class with the specified size.
| width | The width, in pixels, of the new bitmap. |
| height | The height, in pixels, of the new bitmap. |
| format | The pixel format for the new xtd::drawing::bitmap class with the specified size and format. |
| xtd::drawing::bitmap::bitmap | ( | xtd::int32 | width, |
| xtd::int32 | height, | ||
| xtd::int32 | stride, | ||
| xtd::drawing::imaging::pixel_format | format, | ||
| xtd::intptr | scan0 ) |
Initializes a new instance of the xtd::drawing::bitmap class with the specified size.
| width | The width, in pixels, of the new bitmap. |
| height | The height, in pixels, of the new bitmap. |
| stride | Integer that specifies the byte offset between the beginning of one scan line and the next. This is usually (but not necessarily) the number of bytes in the pixel format (for example, 2 for 16 bits per pixel) multiplied by the width of the bitmap. The value passed to this parameter must be a multiple of four. |
| format | The pixel format for the new xtd::drawing::bitmap class with the specified size and format. |
| scan0 | Pointer to an array of bytes that contains the pixel data. |
|
explicit |
Initializes a new instance of the xtd::drawing::bitmap class with the specified size.
| size | the size, in pixels, of the new bitmap. |
|
explicit |
Initializes a new instance of the bitmap class from the specified data xpm.
| bits | The data xpm used to load the image. |
| bitmap xtd::drawing::bitmap::clone | ( | const xtd::drawing::rectangle & | rect | ) | const |
Creates a copy of the section of this xtd::drawing::bitmap defined with a specified rectangle.
| rect | Defines the portion of this bitmap to copy. |
| bitmap xtd::drawing::bitmap::clone | ( | const xtd::drawing::rectangle_f & | rect | ) | const |
Creates a copy of the section of this xtd::drawing::bitmap defined with a specified rectangle.
| rect | Defines the portion of this bitmap to copy. |
|
nodiscard |
Creates a GDI bitmap object from this xtd::drawing::bitmap.
|
nodiscard |
Creates a GDI bitmap object from this xtd::drawing::bitmap.
| background | A xtd::drawing::color structure that specifies the background color. This parameter is ignored if the bitmap is totally opaque. |
|
nodiscard |
Returns the handle to an icon.
| auto xtd::drawing::bitmap::get_pixel | ( | xtd::int32 | x, |
| xtd::int32 | y ) const -> drawing::color |
Gets the color of the specified pixel in this bitmap.
| x | The x-coordinate of the pixel to retrieve. |
| y | The y-coordinate of the pixel to retrieve. |
|
nodiscard |
Locks a xtd::drawing::bitmap into system memory.
| rect | A xtd::drawing::rectangle structure that specifies the portion of the xtd::drawing::bitmap to lock. |
| flags | An xtd::drawing::imaging::image_lock_mode enumeration that specifies the access level (read/write) for the xtd::drawing::bitmap. |
| format | A xtd::drawing::imaging::pixel_format enumeration that specifies the data format of this xtd::drawing::bitmap. |
|
nodiscard |
Locks a xtd::drawing::bitmap into system memory.
| rect | A xtd::drawing::rectangle structure that specifies the portion of the xtd::drawing::bitmap to lock. |
| flags | An xtd::drawing::imaging::image_lock_mode enumeration that specifies the access level (read/write) for the xtd::drawing::bitmap. |
| format | A xtd::drawing::imaging::pixel_format enumeration that specifies the data format of this xtd::drawing::bitmap. |
| data | A xtd::drawing::imaging::bitmap_data that contains information about the lock operation. |
| auto xtd::drawing::bitmap::make_transparent | ( | ) | -> void |
Makes the default transparent color transparent for this xtd::drawing::bitmap.
| auto xtd::drawing::bitmap::make_transparent | ( | const xtd::drawing::color & | transparent_color | ) | -> void |
Makes the specified color transparent for this xtd::drawing::bitmap.
| transprent_color | The xtd::drawing::color structure that represents the color to make transparent. |
| auto xtd::drawing::bitmap::set_pixel | ( | xtd::int32 | x, |
| xtd::int32 | y, | ||
| const xtd::drawing::color & | color ) -> void |
Sets the color of the specified pixel in this xtd::drawing::bitmap.
| x | The x-coordinate of the pixel to retrieve. |
| y | The y-coordinate of the pixel to retrieve. |
| color | A xtd::drawing::color structure that represents the color of the specified pixel. |
| auto xtd::drawing::bitmap::set_resolution | ( | xtd::int32 | x_dpi, |
| xtd::int32 | y_dpi ) -> void |
Sets the resolution for this xtd::drawing::bitmap.
| x_dpi | The horizontal resolution, in dots per inch, of the xtd::drawing::bitmap. |
| y_dpi | The vertical resolution, in dots per inch, of the xtd::drawing::bitmap. |
| auto xtd::drawing::bitmap::unlock_bits | ( | const xtd::drawing::imaging::bitmap_data & | data | ) | -> void |
Unlocks this xtd::drawing::bitmap from system memory.
| data | A xtd::drawing::imaging::bitmap_data that specifies information about the lock operation. |
|
staticnodiscard |
Creates a xtd::drawing::bitmap from a Windows handle to an icon.
| hicon | A handle to an icon. |
|
static |
Represent an empty bitmap.