xtd 0.2.0
bitmap.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "../drawing_export.hpp"
8#include "image.hpp"
9
11namespace xtd {
13 namespace drawing {
27 public:
29
32 static bitmap empty;
34
36
40 explicit bitmap(const xtd::drawing::image& original);
44 bitmap(const xtd::drawing::image& original, const xtd::drawing::size& new_size);
49 bitmap(const xtd::drawing::image& original, xtd::int32 width, xtd::int32 height);
53 bitmap(const xtd::drawing::image& original, const xtd::drawing::rectangle& new_rect);
57 explicit bitmap(const xtd::string& filename);
62 explicit bitmap(const xtd::string& filename, bool use_icm);
66 explicit bitmap(std::istream& stream);
72 explicit bitmap(std::istream& stream, bool use_icm);
76 [[deprecated("Replaced by xtd::drawing::image::from_xpm_data - Will be removed in version 0.4.0.")]]
77 explicit bitmap(const char* const* bits);
104
106
114
116 bitmap(const bitmap& bitmap) = default;
117 bitmap& operator =(const bitmap& bitmap) = default;
119
124
130
135
141
161
169 void make_transparent(const xtd::drawing::color& transparent_color);
170
176
182
188
190
197
198 private:
199 bitmap() = default;
200 };
201 }
202}
Contains xtd::drawing::imaging::bitmap_data struct.
Represents text as a sequence of character units.
Definition basic_string.hpp:71
Encapsulates a GDI+ bitmap, which consists of the pixel data for a graphics image and its attributes....
Definition bitmap.hpp:26
bitmap(std::istream &stream)
Initializes a new instance of the bitmap class from the specified data stream.
static bitmap from_hicon(xtd::intptr icon)
Creates a xtd::drawing::bitmap from a Windows handle to an icon.
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(const xtd::string &filename, bool use_icm)
Initializes a new instance of the bitmap class from the specified file.
xtd::drawing::imaging::bitmap_data 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)
Locks a xtd::drawing::bitmap into system memory.
bitmap(const xtd::string &filename)
Initializes a new instance of the bitmap class from the specified file.
static bitmap empty
Represent an empty bitmap.
Definition bitmap.hpp:32
void unlock_bits(const xtd::drawing::imaging::bitmap_data &data)
Unlocks this xtd::drawing::bitmap from system memory.
xtd::intptr get_hbitmap(const xtd::drawing::color &background) const
Creates a GDI bitmap object from this xtd::drawing::bitmap.
xtd::intptr get_hicon() const
Returns the handle to an icon.
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.
xtd::intptr get_hbitmap() const
Creates a GDI bitmap object from this xtd::drawing::bitmap.
void set_resolution(xtd::int32 x_dpi, xtd::int32 y_dpi)
Sets the resolution for this 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 croppin...
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 speci...
drawing::color get_pixel(xtd::int32 x, xtd::int32 y) const
Gets the color of the specified pixel in this bitmap.
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.
bitmap(const xtd::drawing::image &original)
Initializes a new instance of the bitmap class from the specified existing image.
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(const char *const *bits)
Initializes a new instance of the bitmap class from the specified data xpm.
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 speci...
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 res...
xtd::drawing::imaging::bitmap_data lock_bits(const xtd::drawing::rectangle &rect, xtd::drawing::imaging::image_lock_mode flags, xtd::drawing::imaging::pixel_format format)
Locks a xtd::drawing::bitmap into system memory.
void set_pixel(xtd::int32 x, xtd::int32 y, const xtd::drawing::color &color)
Sets the color of the specified pixel in this xtd::drawing::bitmap.
void make_transparent()
Makes the default transparent color transparent for this xtd::drawing::bitmap.
bitmap(std::istream &stream, bool use_icm)
Initializes a new instance of the bitmap class from the specified data stream.
void make_transparent(const xtd::drawing::color &transparent_color)
Makes the specified color transparent for this xtd::drawing::bitmap.
bitmap(xtd::int32 width, xtd::int32 height)
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.
Represents an ARGB (alpha, red, green, blue) color.
Definition color.hpp:46
Defines an object used to draw lines and curves. This class cannot be inherited.
Definition graphics.hpp:67
Represents a Windows icon, which is a small bitmap image that is used to represent an object....
Definition icon.hpp:28
An abstract base class that provides functionality for the bitmap and metafile descended classes.
Definition image.hpp:49
#define drawing_export_
Define shared library export.
Definition drawing_export.hpp:13
int32_t int32
Represents a 32-bit signed integer.
Definition int32.hpp:23
intmax_t intptr
Represent a pointer or a handle.
Definition intptr.hpp:23
pixel_format
Specifies the format of the color data for each pixel in the image.
Definition pixel_format.hpp:23
image_lock_mode
Specifies flags that are passed to the flags parameter of the xtd::drawing::bitmap::lock_bits method....
Definition image_lock_mode.hpp:20
Contains xtd::drawing::image class.
Contains xtd::drawing::imaging::image_lock_mode class.
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10
Specifies the attributes of a bitmap image. The xtd::drawing::imaging::bitmap_data struct is used by ...
Definition bitmap_data.hpp:22
Stores a set of four floating-point numbers that represent the location and size of a rectangle....
Definition rectangle_f.hpp:34
Stores a set of four integers that represent the location and size of a rectangle.
Definition rectangle.hpp:44
Stores an ordered pair of integers, which specify a height and width.
Definition size.hpp:31