xtd - Reference Guide 0.2.0
bitmap.h
Go to the documentation of this file.
1 #pragma once
5 #include "../drawing_export.h"
6 #include "image.h"
7 
9 namespace xtd {
11  namespace drawing {
24  class drawing_export_ bitmap : public xtd::drawing::image {
25  public:
27 
30  static bitmap empty;
32 
34 
38  explicit bitmap(const image& original) : xtd::drawing::image(original) {}
42  bitmap(const image& original, const xtd::drawing::size& new_size) : xtd::drawing::image(original, new_size.width(), new_size.height()) {}
46  bitmap(const image& original, const rectangle& new_rect) : xtd::drawing::image(original, new_rect) {}
50  explicit bitmap(const xtd::ustring& filename) : xtd::drawing::image(filename) {}
53  explicit bitmap(std::istream& stream) : xtd::drawing::image(stream) {}
56  explicit bitmap(const char* const* bits) : xtd::drawing::image(bits) {}
60  bitmap(int32_t width, int32_t height) : xtd::drawing::image(width, height) {}
63  explicit bitmap(const xtd::drawing::size& size) : xtd::drawing::image(size.width(), size.height()) {}
65 
67 
71  bitmap clone(const rectangle& rect) {return bitmap(*this, rect);}
74  bitmap clone(const rectangle_f& rect) {return bitmap(*this, xtd::drawing::rectangle::ceiling(rect));}
75 
77  bitmap(const bitmap& bitmap) = default;
78  bitmap& operator =(const bitmap& bitmap) = default;
80 
85  drawing::color get_pixel(int32_t x, int32_t y) const;
86 
91  void set_pixel(int32_t x, int32_t y, const drawing::color& color);
93 
94  private:
95  bitmap() = default;
96  };
97  }
98 }
bitmap(const image &original, const rectangle &new_rect)
Initializes a new instance of the bitmap class from the specified existing image, scaled to the speci...
Definition: bitmap.h:46
bitmap(std::istream &stream)
Initializes a new instance of the bitmap class from the specified data stream.
Definition: bitmap.h:53
bitmap clone(const rectangle_f &rect)
Creates a copy of the section of this Bitmap defined with a specified rectangle.
Definition: bitmap.h:74
Stores an ordered pair of integers, which specify a height and width.
Definition: size.h:30
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
bitmap(const xtd::drawing::size &size)
Initializes a new instance of the Bitmap class with the specified size.
Definition: bitmap.h:63
Stores a set of four floating-point numbers that represent the location and size of a rectangle...
Definition: rectangle_f.h:34
bitmap(const char *const *bits)
Initializes a new instance of the bitmap class from the specified data xpm.
Definition: bitmap.h:56
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:51
static rectangle ceiling(const xtd::drawing::rectangle_f &rect) noexcept
Converts the specified xtd::drawing::rectangle_f structure to a xtd::drawing::rectangle structure by ...
Contains xtd::drawing::image class.
bitmap(const xtd::ustring &filename)
Initializes a new instance of the bitmap class from the specified file.
Definition: bitmap.h:50
bitmap clone(const rectangle &rect)
Creates a copy of the section of this Bitmap defined with a specified rectangle.
Definition: bitmap.h:71
Encapsulates a GDI+ bitmap, which consists of the pixel data for a graphics image and its attributes...
Definition: bitmap.h:24
Represents an ARGB (alpha, red, green, blue) color.
Definition: color.h:44
Stores a set of four integers that represent the location and size of a rectangle.
Definition: rectangle.h:44
An abstract base class that provides functionality for the bitmap and metafile descended classes...
Definition: image.h:47
bitmap(int32_t width, int32_t height)
Initializes a new instance of the Bitmap class with the specified size.
Definition: bitmap.h:60
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 speci...
Definition: bitmap.h:42
static bitmap empty
Represent an empty bitmap.
Definition: bitmap.h:30
bitmap(const image &original)
Initializes a new instance of the bitmap class from the specified existing image. ...
Definition: bitmap.h:38