xtd 0.2.0
Loading...
Searching...
No Matches
bitmap.h
Go to the documentation of this file.
1
4#pragma once
5#include "../drawing_export.h"
8#include "image.h"
9
11namespace xtd {
13 namespace drawing {
27 public:
29
32 static bitmap empty;
34
36
40 explicit bitmap(const image& original);
44 bitmap(const image& original, const xtd::drawing::size& new_size);
49 bitmap(const image& original, int32 width, int32 height);
53 bitmap(const image& original, const rectangle& new_rect);
57 explicit bitmap(const xtd::ustring& filename);
62 explicit bitmap(const xtd::ustring& filename, bool use_icm);
66 explicit bitmap(std::istream& stream);
72 explicit bitmap(std::istream& stream, bool use_icm);
75 explicit bitmap(const char* const* bits);
79 bitmap(int32 width, int32 height);
85 bitmap(int32 width, int32 height, const graphics& g);
97 bitmap(int32 width, int32 height, int32 stride, xtd::drawing::imaging::pixel_format format, intptr scan0);
102
104
108 bitmap clone(const rectangle& rect) const;
111 bitmap clone(const rectangle_f& rect) const;
112
114 bitmap(const bitmap& bitmap) = default;
115 bitmap& operator =(const bitmap& bitmap) = default;
117
122
127 intptr get_hbitmap(const color& background) const;
128
133
139
159
167 void make_transparent(const color& transparent_color);
168
174
179 void set_resolution(int32 x_dpi, int32 y_dpi);
180
186
188
195
196 private:
197 bitmap() = default;
198 };
199 }
200}
Contains xtd::drawing::imaging::bitmap_data class.
Encapsulates a GDI+ bitmap, which consists of the pixel data for a graphics image and its attributes....
Definition bitmap.h:26
bitmap(const xtd::ustring &filename, bool use_icm)
Initializes a new instance of the bitmap class from the specified file.
void set_resolution(int32 x_dpi, int32 y_dpi)
Sets the resolution for this xtd::drawing::bitmap.
bitmap clone(const rectangle_f &rect) const
Creates a copy of the section of this xtd::drawing::bitmap defined with a specified rectangle.
bitmap(std::istream &stream)
Initializes a new instance of the bitmap class from the specified data stream.
intptr get_hbitmap() const
Creates a GDI bitmap object from this xtd::drawing::bitmap.
drawing::color get_pixel(int32 x, int32 y) const
Gets the color of the specified pixel in this bitmap.
bitmap(int32 width, int32 height)
Initializes a new instance of the xtd::drawing::bitmap class with the specified size.
bitmap(const image &original)
Initializes a new instance of the bitmap class from the specified existing image.
bitmap(int32 width, int32 height, int32 stride, xtd::drawing::imaging::pixel_format format, intptr scan0)
Initializes a new instance of the xtd::drawing::bitmap class with the specified size.
void make_transparent(const color &transparent_color)
Makes the specified color transparent for this xtd::drawing::bitmap.
static bitmap empty
Represent an empty bitmap.
Definition bitmap.h:32
void unlock_bits(const xtd::drawing::imaging::bitmap_data &data)
Unlocks this xtd::drawing::bitmap from system memory.
bitmap(int32 width, int32 height, xtd::drawing::imaging::pixel_format format)
Initializes a new instance of the xtd::drawing::bitmap class with the specified size.
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...
intptr get_hbitmap(const color &background) const
Creates a GDI bitmap object from this xtd::drawing::bitmap.
xtd::drawing::imaging::bitmap_data lock_bits(const rectangle &rect, xtd::drawing::imaging::image_lock_mode flags, xtd::drawing::imaging::pixel_format format)
Locks a xtd::drawing::bitmap into system memory.
bitmap(int32 width, int32 height, const graphics &g)
Initializes a new instance of the xtd::drawing::bitmap class with the specified size and with the res...
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...
static bitmap from_hicon(intptr icon)
Creates a xtd::drawing::bitmap from a Windows handle to an icon.
intptr get_hicon() const
Returns the handle to an icon.
bitmap(const char *const *bits)
Initializes a new instance of the bitmap class from the specified data xpm.
void set_pixel(int32 x, int32 y, const drawing::color &color)
Sets the color of the specified pixel in this xtd::drawing::bitmap.
bitmap(const image &original, int32 width, int32 height)
Initializes a new instance of the bitmap class from the specified existing image, scaled to the speci...
xtd::drawing::imaging::bitmap_data lock_bits(const 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::ustring &filename)
Initializes a new instance of the bitmap class from the specified file.
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.
bitmap clone(const rectangle &rect) const
Creates a copy of the section of this xtd::drawing::bitmap defined with a specified rectangle.
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.h:49
Defines an object used to draw lines and curves. This class cannot be inherited.
Definition graphics.h:70
Represents a Windows icon, which is a small bitmap image that is used to represent an object....
Definition icon.h:28
An abstract base class that provides functionality for the bitmap and metafile descended classes.
Definition image.h:49
Specifies the attributes of a bitmap image. The xtd::drawing::imaging::bitmap_data class is used by t...
Definition bitmap_data.h:22
Stores a set of four floating-point numbers that represent the location and size of a rectangle....
Definition rectangle_f.h:34
Stores a set of four integers that represent the location and size of a rectangle.
Definition rectangle.h:44
Stores an ordered pair of integers, which specify a height and width.
Definition size.h:31
Represents text as a sequence of UTF-8 code units.
Definition ustring.h:47
#define drawing_export_
Define shared library export.
Definition drawing_export.h:13
int_least32_t int32
Represents a 32-bit signed integer.
Definition types.h:131
intmax_t intptr
Represent a pointer or a handle.
Definition types.h:153
pixel_format
Specifies the format of the color data for each pixel in the image.
Definition pixel_format.h: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.h: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.h:10