![]() |
xtd - Reference Guide
0.1.0
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
|
#include <bitmap.h>
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.
Inherits xtd::drawing::image.
Static Public Attributes | |
static bitmap | empty |
Represent an empty bitmap. | |
![]() | |
static image | empty |
Public Member Functions | |
bitmap (const char *const *bits) | |
Initializes a new instance of the bitmap class from the specified data xpm. | |
bitmap (const image &original) | |
Initializes a new instance of the bitmap class from the specified existing image. | |
bitmap (const image &original, const rectangle &new_rect) | |
Initializes a new instance of the bitmap class from the specified existing image, scaled to the specified rectangle. | |
bitmap (const 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::size &size) | |
Initializes a new instance of the Bitmap class with the specified size. | |
bitmap (const xtd::ustring &filename) | |
Initializes a new instance of the bitmap class from the specified file. | |
bitmap (int32_t width, int32_t height) | |
Initializes a new instance of the Bitmap class with the specified size. | |
bitmap (std::istream &stream) | |
Initializes a new instance of the bitmap class from the specified data stream. | |
bitmap | clone (const rectangle &rect) |
Creates a copy of the section of this Bitmap defined with a specified rectangle. | |
bitmap | clone (const rectangle_f &rect) |
Creates a copy of the section of this Bitmap defined with a specified rectangle. | |
drawing::color | get_pixel (int32_t x, int32_t y) const |
Gets the color of the specified pixel in this bitmap. | |
void | set_pixel (int32_t x, int32_t y, const drawing::color &color) |
Sets the color of the specified pixel in this bitmap. | |
![]() | |
graphics | create_graphics () |
Creates the xtd::drawing::graphics for the image. | |
int32_t | flags () const |
Gets attribute flags for the pixel data of this Image. | |
const std::vector< guid > & | frame_dimentions_list () const |
Gets an array of GUIDs that represent the dimensions of frames within this image. | |
intptr_t | handle () const |
Get the handle of this image. | |
int32_t | height () const |
Gets the height, in pixels, of this image. | |
float | horizontal_resolution () const |
Gets the horizontal resolution, in pixels per inch, of this image. | |
imaging::color_palette | palette () const |
Gets the color palette used for this image. | |
void | palette (const imaging::color_palette &palette) |
Sets the color palette used for this image. | |
const size_f & | physical_dimension () const |
Gets the width and height of this image. | |
imaging::pixel_format | pixel_format () const |
Gets the pixel format for this image. | |
const std::vector< int32_t > & | property_id_list () const |
Gets IDs of the property items stored in this image. | |
const std::vector< imaging::property_item > & | property_items () const |
Gets all the property items (pieces of metadata) stored in this image. | |
const imaging::image_format & | raw_format () const |
Gets the file format of this image. | |
void | save (const xtd::ustring &filename) const |
void | save (const xtd::ustring &filename, const imaging::image_format &format) const |
void | save (std::ostream &stream, const imaging::image_format &format) const |
const drawing::size & | size () const |
Gets the width and height, in pixels, of this image. | |
const std::any & | tag () const |
Gets an object that provides additional data about the image. | |
void | tag (const std::any &tag) |
Sets an object that provides additional data about the image. | |
float | vertical_resolution () const |
Gets the vertical resolution, in pixels per inch, of this image. | |
int32_t | width () const |
Gets the width, in pixels, of this image. | |
![]() | |
object ()=default | |
Create a new instance of the ultimate base class object. | |
virtual bool | equals (const object &obj) const noexcept |
Determines whether the specified object is equal to the current object. | |
virtual size_t | get_hash_code () const noexcept |
Serves as a hash function for a particular type. | |
template<typename object_t > | |
std::unique_ptr< object_t > | memberwise_clone () const |
Gets the type of the current instance. | |
virtual xtd::ustring | to_string () const noexcept |
Returns a std::string that represents the current object. | |
Additional Inherited Members | |
![]() | |
static image | from_data (const char *const *bits) |
static image | from_file (const xtd::ustring &filename) |
Creates an image from the specified file. | |
static image | from_hbitmap (intptr_t hbitmap) |
static image | from_stream (std::istream &stream) |
![]() | |
static bool | equals (const object &object_a, const object &object_b) noexcept |
Determines whether the specified object instances are considered equal. | |
static bool | reference_equals (const object &object_a, const object &object_b) noexcept |
Determines whether the specified object instances are the same instance. | |
![]() | |
std::shared_ptr< data > | data_ |
![]() | |
image (const char *const *bits) | |
image (const image &image, const rectangle &rect) | |
image (const image &image, int32_t width, int32_t height) | |
image (const xtd::ustring &fileName) | |
image (int32_t width, int32_t height) | |
image (intptr_t hbitmap) | |
image (std::istream &stream) | |
void | update_properties () |
|
inlineexplicit |
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. |
|
inline |
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. |
Initializes a new instance of the bitmap class from the specified existing image, scaled to 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. |
|
inlineexplicit |
Initializes a new instance of the bitmap class from the specified file.
filename | The bitmap file name and path. |
|
inlineexplicit |
Initializes a new instance of the bitmap class from the specified data stream.
stream | The data stream used to load the image. |
|
inlineexplicit |
Initializes a new instance of the bitmap class from the specified data xpm.
bits | The data xpm used to load the image. |
|
inline |
Initializes a new instance of the Bitmap class with the specified size.
width | The width, in pixels, of the new bitmap. |
height | The height, in pixels, of the new bitmap. |
|
inlineexplicit |
Initializes a new instance of the Bitmap class with the specified size.
size | the size, in pixels, of the new bitmap. |
Creates a copy of the section of this Bitmap defined with a specified rectangle.
rect | Defines the portion of this bitmap to copy. |
|
inline |
Creates a copy of the section of this Bitmap defined with a specified rectangle.
rect | Defines the portion of this bitmap to copy. |
drawing::color xtd::drawing::bitmap::get_pixel | ( | int32_t | x, |
int32_t | y | ||
) | const |
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. |
void xtd::drawing::bitmap::set_pixel | ( | int32_t | x, |
int32_t | y, | ||
const drawing::color & | color | ||
) |
Sets 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. |
color | A xtd::drawing::color structure that represents the color of the specified pixel. |
|
static |
Represent an empty bitmap.