xtd - Reference Guide  0.1.0
Modern c++17 framework to create console, gui and unit test applications on Windows, macOS and Linux.
xtd::drawing::bitmap Class Reference

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. More...

#include <bitmap.h>

Inheritance diagram for xtd::drawing::bitmap:
xtd::drawing::image

Public Member Functions

 bitmap (const image &image)
 
 bitmap (const image &image, const drawing::size &size)
 
 bitmap (const image &image, const rectangle &rect)
 
 bitmap (const std::string &filename)
 
 bitmap (std::istream &stream)
 
 bitmap (const char *const *bits)
 
 bitmap (int32_t width, int32_t height)
 
bitmap clone (const rectangle &rect)
 
int32_t flags () const
 Gets attribute flags for the pixel data of this Image. More...
 
const std::vector< guid > & frame_dimentions_list () const
 Gets an array of GUIDs that represent the dimensions of frames within this image. More...
 
drawing::color get_pixel (int32_t x, int32_t y) const
 
intptr_t handle () const
 Get the handle of this image. More...
 
int32_t height () const
 Gets the height, in pixels, of this image. More...
 
float horizontal_resolution () const
 Gets the horizontal resolution, in pixels per inch, of this image. More...
 
imaging::color_palette palette () const
 Gets the color palette used for this image. More...
 
void palette (const imaging::color_palette &palette)
 Sets the color palette used for this image. More...
 
const size_fphysical_dimension () const
 Gets the width and height of this image. More...
 
imaging::pixel_format pixel_format () const
 Gets the pixel format for this image. More...
 
const std::vector< int32_t > & property_id_list () const
 Gets IDs of the property items stored in this image. More...
 
const std::vector< imaging::property_item > & property_items () const
 Gets all the property items (pieces of metadata) stored in this image. More...
 
const imaging::image_formatraw_format () const
 Gets the file format of this image. More...
 
void save (const std::string &filename) const
 
void save (const std::string &filename, const imaging::image_format &format) const
 
void save (std::ostream &stream, const imaging::image_format &format) const
 
void set_pixel (int32_t x, int32_t y, const drawing::color &color)
 
const drawing::sizesize () const
 Gets the width and height, in pixels, of this image. More...
 
const std::anytag () const
 Gets an object that provides additional data about the image. More...
 
void tag (const std::any &tag)
 Sets an object that provides additional data about the image. More...
 
float vertical_resolution () const
 Gets the vertical resolution, in pixels per inch, of this image. More...
 
int32_t width () const
 Gets the width, in pixels, of this image. More...
 

Static Public Member Functions

static image from_data (const char *const *bits)
 
static image from_file (const std::string &filename)
 Creates an image from the specified file. More...
 
static image from_hbitmap (intptr_t hbitmap)
 
static image from_stream (std::istream &stream)
 

Static Public Attributes

static bitmap empty
 

Protected Member Functions

void update_properties ()
 

Protected Attributes

std::shared_ptr< datadata_ = std::make_shared<data>()
 

Detailed Description

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.

Remarks
To draw an image on a Windows Form, you should use one of the draw_image methods.

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