xtd 0.2.0
Loading...
Searching...
No Matches
xtd::drawing::native::image Class Referencefinal
Inheritance diagram for xtd::drawing::native::image:
xtd::static_object

Definition

Contains image native API.

Namespace
xtd::drawing::native
Library
xtd.drawing.native
Warning
Internal use only

Classes

struct  property_item
 Encapsulates a metadata property to be included in an image file. More...
 

Protected Static Methods

static void blur (intptr handle, int32 radius)
 Blurs the image whith the specified radius.
 
static void color_palette (intptr image, std::vector< std::tuple< xtd::byte, xtd::byte, xtd::byte, xtd::byte > > &entries, int32 &flags)
 Gets the color palette used for the image.
 
static intptr create (const xtd::string &filename, std::map< size_t, size_t > &frame_resolutions)
 Creates an image from specified filename and get the frame_solution collection.
 
static intptr create (const xtd::string &filename, bool use_icm, std::map< size_t, size_t > &frame_resolutions)
 Creates an image from specified filename and get the frame_solution collection.
 
static intptr create (std::istream &stream, std::map< size_t, size_t > &frame_resolutions)
 Creates an image from specified std::istream and get the frame_solution collection.
 
static intptr create (std::istream &stream, bool use_icm, std::map< size_t, size_t > &frame_resolutions)
 Creates an image from specified std::istream and get the frame_solution collection.
 
static intptr create (const char *const *bits)
 Creates an image from bits.
 
static intptr create (int32 width, int32 height)
 Creates an empty image from size.
 
static intptr create (int32 width, int32 height, float horizontal_resolution, float vertical_resolution)
 Creates an empty image from size, and horzontal and vertical resolution.
 
static intptr create (int32 width, int32 height, int32 format)
 Creates an empty image from size, and pixel format.
 
static intptr create (int32 width, int32 height, int32 stride, int32 format, intptr scan0)
 Creates an empty image from size, pixel format and pixel datas.
 
static void destroy (intptr image)
 Destroys the image.
 
static size_t flags (intptr image)
 Gets attribute flags for the pixel data of this Image.
 
static intptr from_hicon (intptr icon)
 Creates a bitmap from a Windows handle to an icon.
 
static xtd::byteget_alpha (intptr image)
 Get the access to the alpah from this image.
 
static xtd::byteget_data (intptr image)
 Get the access to the data from this image.
 
static intptr get_hbitmap (intptr image)
 Creates a GDI bitmap object from this image.
 
static intptr get_hbitmap (intptr image, xtd::byte a, xtd::byte r, xtd::byte g, xtd::byte b)
 Creates a GDI bitmap object from this image.
 
static intptr get_hicon (intptr image)
 Returns the handle to an icon.
 
static float horizontal_resolution (intptr image)
 Gets the horizontal resolution, in pixels per inch, of the image.
 
static void lock_bits (intptr image, int32 left, int32 top, int32 width, int32 height, int32 flags, int32 format, int32 &image_data_height, int32 &image_data_pixel_format, int32 &image_data_reserved, intptr &image_data_scan0, int32 &image_data_stride, int32 &image_data_width)
 Locks a xtd::drawing::bitmap into system memory.
 
static void make_transparent (intptr image, xtd::byte transparent_color_a, xtd::byte transparent_color_r, xtd::byte transparent_color_g, xtd::byte transparent_color_b)
 Makes the specified color transparent for this bitmap.
 
static void physical_dimension (intptr image, int32 &width, int32 &height)
 Gets the width and height of this image.
 
static std::vector< int32property_id_list (intptr image)
 Gets IDs of the property items stored in the image.
 
static std::vector< property_itemproperty_items (intptr image)
 Gets all the property items (pieces of metadata) stored in the image.
 
static size_t pixel_format (intptr image)
 Gets the pixel format for the image.
 
static size_t raw_format (intptr image)
 Gets the file format of the image.
 
static void rescale (intptr image, int32 width, int32 height)
 Rescale the image.
 
static void rotate_flip (intptr image, int32 rotate_flip_type)
 Rotates, flips, or rotates and flips the image.
 
static void set_resolution (intptr image, int32 x_dpi, int32 y_dpi)
 Sets the resolution for this bitmap.
 
static void save (intptr image, const xtd::string &filename)
 Saves image to the specified output filename.
 
static void save (intptr image, const xtd::string &filename, size_t raw_format)
 Saves image to the specified output filename and raw format.
 
static void save (intptr image, std::ostream &stream, size_t raw_format)
 Saves image to the specified stream and raw format.
 
static float screen_dpi ()
 Get the screen dpi.
 
static void size (intptr image, int32 &width, int32 &height)
 Gets the width and height, in pixels, of the image.
 
static void unlock_bits (intptr image, int32 &image_data_height, int32 &image_data_pixel_format, int32 &image_data_reserved, intptr &image_data_scan0, int32 &image_data_stride, int32 &image_data_width)
 Unlocks this Bitmap from system memory.
 
static float vertical_resolution (intptr image)
 Gets the vertical resolution, in pixels per inch, of the image.
 

Member Function Documentation

◆ blur()

static void xtd::drawing::native::image::blur ( intptr  handle,
int32  radius 
)
staticprotected

Blurs the image whith the specified radius.

Parameters
imageThe image handle.
radiusThe radius of the blur, specified as a <length>
Note
No blur effect, if the radius is 0.
Warning
Internal use only

◆ color_palette()

static void xtd::drawing::native::image::color_palette ( intptr  image,
std::vector< std::tuple< xtd::byte, xtd::byte, xtd::byte, xtd::byte > > &  entries,
int32 flags 
)
staticprotected

Gets the color palette used for the image.

Parameters
imageThe image handle.
entriesA std::vector<std::tuple<xtd::byte, xtd::byte, xtd::byte, xtd::byte>> (alpha, red, green and blue componenents of color) that represents the color palette used for the image.
flagsA value that specifies how to interpret the color information in the array of colors
Remarks
The following flag values are valid:
  • 0x00000001 The color values in the array contain alpha information.
  • 0x00000002 The colors in the array are grayscale values.
  • 0x00000004 The colors in the array are halftone values.
Warning
Internal use only

◆ create() [1/9]

static intptr xtd::drawing::native::image::create ( const xtd::string filename,
std::map< size_t, size_t > &  frame_resolutions 
)
staticprotected

Creates an image from specified filename and get the frame_solution collection.

Parameters
filenameThe filename of the image.
frame_resolutionsan std::map<size_t, size_t> containing the frame dimention and the image count collection (see frame_dimension.h for more information).
Returns
A new image handle.
Remarks
This method returns information about multiple-frame images, which come in two styles: multiple page and multiple resolution.
A multiple-page image is an image that contains more than one image. Each page contains a single image (or frame). These pages (or images, or frames) are typically displayed in succession to produce an animated sequence, such as an animated .gif file.
A multiple-resolution image is an image that contains more than one copy of an image at different resolutions. This is commonly used by MIP mapping where the displayed image size determines the resolution of the image used for drawing. GDI+ can support an arbitrary number of pages (or images, or frames), as well as an arbitrary number of resolutions. The defined dimensions are properties of the frame_dimension.
Warning
Internal use only

◆ create() [2/9]

static intptr xtd::drawing::native::image::create ( const xtd::string filename,
bool  use_icm,
std::map< size_t, size_t > &  frame_resolutions 
)
staticprotected

Creates an image from specified filename and get the frame_solution collection.

Parameters
filenameThe filename of the image.
frame_resolutionsan std::map<size_t, size_t> containing the frame dimention and the image count collection (see frame_dimension.h for more information).
use_icmtrue to use color correction for this Bitmap; otherwise, false.
Returns
A new image handle.
Remarks
This method returns information about multiple-frame images, which come in two styles: multiple page and multiple resolution.
A multiple-page image is an image that contains more than one image. Each page contains a single image (or frame). These pages (or images, or frames) are typically displayed in succession to produce an animated sequence, such as an animated .gif file.
A multiple-resolution image is an image that contains more than one copy of an image at different resolutions. This is commonly used by MIP mapping where the displayed image size determines the resolution of the image used for drawing. GDI+ can support an arbitrary number of pages (or images, or frames), as well as an arbitrary number of resolutions. The defined dimensions are properties of the frame_dimension.
Warning
Internal use only

◆ create() [3/9]

static intptr xtd::drawing::native::image::create ( std::istream &  stream,
std::map< size_t, size_t > &  frame_resolutions 
)
staticprotected

Creates an image from specified std::istream and get the frame_solution collection.

Parameters
streamThe std::istream containing the image.
frame_resolutionsan std::map<size_t, size_t> containing the frame dimention and the image count collection (see frame_dimension.h for more information).
Returns
A new image handle.
Remarks
This method returns information about multiple-frame images, which come in two styles: multiple page and multiple resolution.
A multiple-page image is an image that contains more than one image. Each page contains a single image (or frame). These pages (or images, or frames) are typically displayed in succession to produce an animated sequence, such as an animated .gif file.
A multiple-resolution image is an image that contains more than one copy of an image at different resolutions. This is commonly used by MIP mapping where the displayed image size determines the resolution of the image used for drawing. GDI+ can support an arbitrary number of pages (or images, or frames), as well as an arbitrary number of resolutions. The defined dimensions are properties of the frame_dimension.
Warning
Internal use only

◆ create() [4/9]

static intptr xtd::drawing::native::image::create ( std::istream &  stream,
bool  use_icm,
std::map< size_t, size_t > &  frame_resolutions 
)
staticprotected

Creates an image from specified std::istream and get the frame_solution collection.

Parameters
streamThe std::istream containing the image.
use_icmtrue to use color correction for this Bitmap; otherwise, false.
frame_resolutionsan std::map<size_t, size_t> containing the frame dimention and the image count collection (see frame_dimension.h for more information).
Returns
A new image handle.
Remarks
This method returns information about multiple-frame images, which come in two styles: multiple page and multiple resolution.
A multiple-page image is an image that contains more than one image. Each page contains a single image (or frame). These pages (or images, or frames) are typically displayed in succession to produce an animated sequence, such as an animated .gif file.
A multiple-resolution image is an image that contains more than one copy of an image at different resolutions. This is commonly used by MIP mapping where the displayed image size determines the resolution of the image used for drawing. GDI+ can support an arbitrary number of pages (or images, or frames), as well as an arbitrary number of resolutions. The defined dimensions are properties of the frame_dimension.
Warning
Internal use only

◆ create() [5/9]

static intptr xtd::drawing::native::image::create ( const char *const *  bits)
staticprotected

Creates an image from bits.

Parameters
bitsThe bits containing the image.
Returns
A new image handle.
Remarks
This method is used for creating an imgae from an XPM (or XBM) image.
Warning
Internal use only

◆ create() [6/9]

static intptr xtd::drawing::native::image::create ( int32  width,
int32  height 
)
staticprotected

Creates an empty image from size.

Parameters
widthThe width for the empty image.
heightThe height for the empty image.
Returns
A new image handle.
Warning
Internal use only

◆ create() [7/9]

static intptr xtd::drawing::native::image::create ( int32  width,
int32  height,
float  horizontal_resolution,
float  vertical_resolution 
)
staticprotected

Creates an empty image from size, and horzontal and vertical resolution.

Parameters
widthThe width for the new image.
heightThe height for the new image.
Returns
A new image handle.
Warning
Internal use only

◆ create() [8/9]

static intptr xtd::drawing::native::image::create ( int32  width,
int32  height,
int32  format 
)
staticprotected

Creates an empty image from size, and pixel format.

Parameters
widthThe width for the empty image.
heightThe height for the empty image.
formatThe pixel format for the new image.
Returns
A new image handle.
Warning
Internal use only

◆ create() [9/9]

static intptr xtd::drawing::native::image::create ( int32  width,
int32  height,
int32  stride,
int32  format,
intptr  scan0 
)
staticprotected

Creates an empty image from size, pixel format and pixel datas.

Parameters
widthThe width for the empty image.
heightThe height for the empty image.
strideInteger that specifies the byte offset between the beginning of one scan line and the next. This is usually (but not necessarily) the number of bytes in the pixel format (for example, 2 for 16 bits per pixel) multiplied by the width of the bitmap. The value passed to this parameter must be a multiple of four.
formatThe pixel format for the new image.
scan0Pointer to an array of bytes that contains the pixel data.
Returns
A new image handle.
Warning
Internal use only

◆ destroy()

static void xtd::drawing::native::image::destroy ( intptr  image)
staticprotected

Destroys the image.

Parameters
imageThe image handle to destroy.
Warning
Internal use only

◆ flags()

static size_t xtd::drawing::native::image::flags ( intptr  image)
staticprotected

Gets attribute flags for the pixel data of this Image.

Parameters
imageThe image handle.
Returns
The integer representing a bitwise combination of image flags for this Image (see image_flags.h for more information).
Warning
Internal use only

◆ from_hicon()

static intptr xtd::drawing::native::image::from_hicon ( intptr  icon)
staticprotected

Creates a bitmap from a Windows handle to an icon.

Parameters
hiconA handle to an icon.
Returns
A new bitmap handle.
Warning
Internal use only

◆ get_alpha()

static xtd::byte * xtd::drawing::native::image::get_alpha ( intptr  image)
staticprotected

Get the access to the alpah from this image.

Parameters
imageA handle to an image.
Returns
An alpha pointer of the image.
Warning
Internal use only

◆ get_data()

static xtd::byte * xtd::drawing::native::image::get_data ( intptr  image)
staticprotected

Get the access to the data from this image.

Parameters
imageA handle to an image.
Returns
A data pointer of the image.
Warning
Internal use only

◆ get_hbitmap() [1/2]

static intptr xtd::drawing::native::image::get_hbitmap ( intptr  image)
staticprotected

Creates a GDI bitmap object from this image.

Parameters
imageA handle to an image.
Returns
A new bitmap handle.
Warning
Internal use only

◆ get_hbitmap() [2/2]

static intptr xtd::drawing::native::image::get_hbitmap ( intptr  image,
xtd::byte  a,
xtd::byte  r,
xtd::byte  g,
xtd::byte  b 
)
staticprotected

Creates a GDI bitmap object from this image.

Parameters
imageA handle to an image.
aThe alpha componant of the background color.
rThe red componant of the background color.
gThe green componant of the background color.
bThe blue componant of the background color.
Returns
A new bitmap handle.
Warning
Internal use only

◆ get_hicon()

static intptr xtd::drawing::native::image::get_hicon ( intptr  image)
staticprotected

Returns the handle to an icon.

Parameters
imageA handle to an image.
Returns
A new icon handle.
Warning
Internal use only

◆ horizontal_resolution()

static float xtd::drawing::native::image::horizontal_resolution ( intptr  image)
staticprotected

Gets the horizontal resolution, in pixels per inch, of the image.

Parameters
imageThe image handle.
Returns
The horizontal resolution, in pixels per inch, of the image.
Warning
Internal use only

◆ lock_bits()

static void xtd::drawing::native::image::lock_bits ( intptr  image,
int32  left,
int32  top,
int32  width,
int32  height,
int32  flags,
int32  format,
int32 image_data_height,
int32 image_data_pixel_format,
int32 image_data_reserved,
intptr image_data_scan0,
int32 image_data_stride,
int32 image_data_width 
)
staticprotected

Locks a xtd::drawing::bitmap into system memory.

Parameters
imageThe image handle.
topAn int32 that specifies the top of the bitmap to lock.
leftAn int32 that specifies the left of the bitmap to lock.
widthAn int32 that specifies the width of the bitmap to lock.
heightAn int32 that specifies the height of the bitmap to lock.
flagsAn image lock mode value that specifies the access level (read/write) for the bitmap.
formatA pixel format value that specifies the data format of this bitmap.
image_data_heightThe pixel height of the bitmap object. Also sometimes referred to as the number of scan lines.
image_data_pixel_formatA pixel format that specifies the format of the pixel information in the associated bitmap.
image_data_reservedReserved. Do not use.
image_data_scan0The address of the first pixel data in the bitmap.
image_data_strideThe stride width (also called scan width), in bytes, of the bitmap.
image_data_widthThe pixel width of the bitmap. This can also be thought of as the number of pixels in one scan line.
Returns
A xtd::drawing::imaging::bitmap_data that contains information about this lock operation.

◆ make_transparent()

static void xtd::drawing::native::image::make_transparent ( intptr  image,
xtd::byte  transparent_color_a,
xtd::byte  transparent_color_r,
xtd::byte  transparent_color_g,
xtd::byte  transparent_color_b 
)
staticprotected

Makes the specified color transparent for this bitmap.

Parameters
imageThe image handle.
transprent_color_aThe byte that represents the alpha component of the color to make transparent.
transprent_color_rThe byte that represents the red component of the color to make transparent.
transprent_color_gThe byte that represents the green component of the color to make transparent.
transprent_color_bThe byte that represents the blue component of the color to make transparent.

◆ physical_dimension()

static void xtd::drawing::native::image::physical_dimension ( intptr  image,
int32 width,
int32 height 
)
staticprotected

Gets the width and height of this image.

Parameters
imageThe image handle.
widthA int32 that represents the width of the image.
heightA int32 that represents the height of the image.
Warning
Internal use only

◆ property_id_list()

static std::vector< int32 > xtd::drawing::native::image::property_id_list ( intptr  image)
staticprotected

Gets IDs of the property items stored in the image.

Parameters
imageThe image handle.
Returns
An array of the property IDs, one for each property item stored in the image.
Warning
Internal use only

◆ property_items()

static std::vector< property_item > xtd::drawing::native::image::property_items ( intptr  image)
staticprotected

Gets all the property items (pieces of metadata) stored in the image.

Parameters
imageThe image handle.
Returns
An array of xtd::drawing::native::image::property_item strutures, one for each property item stored in the image.
Warning
Internal use only

◆ pixel_format()

static size_t xtd::drawing::native::image::pixel_format ( intptr  image)
staticprotected

Gets the pixel format for the image.

Parameters
imageThe image handle.
Returns
A pixel_format that represents the pixel format for the image.
Warning
Internal use only

◆ raw_format()

static size_t xtd::drawing::native::image::raw_format ( intptr  image)
staticprotected

Gets the file format of the image.

Parameters
imageThe image handle.
Returns
The image format that represents the file format of this image (see image_formats.h for more information).
Warning
Internal use only

◆ rescale()

static void xtd::drawing::native::image::rescale ( intptr  image,
int32  width,
int32  height 
)
staticprotected

Rescale the image.

Parameters
imageThe image handle.
widthThe width for the new image.
heightThe height for the new image.
Warning
Internal use only

◆ rotate_flip()

static void xtd::drawing::native::image::rotate_flip ( intptr  image,
int32  rotate_flip_type 
)
staticprotected

Rotates, flips, or rotates and flips the image.

Parameters
imageThe image handle.
rotate_flip_typeA value that specifies the type of rotation and flip to apply to the image (see rotate_flip_types.h for more information).
Warning
Internal use only

◆ set_resolution()

static void xtd::drawing::native::image::set_resolution ( intptr  image,
int32  x_dpi,
int32  y_dpi 
)
staticprotected

Sets the resolution for this bitmap.

Parameters
imageThe image handle.
x_dpiThe horizontal resolution, in dots per inch, of the xtd::drawing::bitmap.
y_dpiThe vertical resolution, in dots per inch, of the xtd::drawing::bitmap.

◆ save() [1/3]

static void xtd::drawing::native::image::save ( intptr  image,
const xtd::string filename 
)
staticprotected

Saves image to the specified output filename.

Parameters
imageThe image handle.
filenameThe file to save to.
Warning
Internal use only

◆ save() [2/3]

static void xtd::drawing::native::image::save ( intptr  image,
const xtd::string filename,
size_t  raw_format 
)
staticprotected

Saves image to the specified output filename and raw format.

Parameters
imageThe image handle.
filenameThe file to save to.
raw_formatThe image format that represents the file format of this image (see image_formats.h for more information).
Warning
Internal use only

◆ save() [3/3]

static void xtd::drawing::native::image::save ( intptr  image,
std::ostream &  stream,
size_t  raw_format 
)
staticprotected

Saves image to the specified stream and raw format.

Parameters
imageThe image handle.
streamThe stream to save to.
raw_formatThe image format that represents the file format of this image (see image_formats.h for more information).
Warning
Internal use only

◆ screen_dpi()

static float xtd::drawing::native::image::screen_dpi ( )
staticprotected

Get the screen dpi.

Returns
The screen dpi.
Warning
Internal use only

◆ size()

static void xtd::drawing::native::image::size ( intptr  image,
int32 width,
int32 height 
)
staticprotected

Gets the width and height, in pixels, of the image.

Parameters
imageThe image handle.
widthThe width, in pixels, of the image.
heightThe height, in pixels, of the image.
Warning
Internal use only

◆ unlock_bits()

static void xtd::drawing::native::image::unlock_bits ( intptr  image,
int32 image_data_height,
int32 image_data_pixel_format,
int32 image_data_reserved,
intptr image_data_scan0,
int32 image_data_stride,
int32 image_data_width 
)
staticprotected

Unlocks this Bitmap from system memory.

Parameters
imageThe image handle.
image_data_heightThe pixel height of the bitmap object. Also sometimes referred to as the number of scan lines.
image_data_pixel_formatA pixel format that specifies the format of the pixel information in the associated bitmap.
image_data_reservedReserved. Do not use.
image_data_scan0The address of the first pixel data in the bitmap.
image_data_strideThe stride width (also called scan width), in bytes, of the bitmap.
image_data_widthThe pixel width of the bitmap. This can also be thought of as the number of pixels in one scan line.

◆ vertical_resolution()

static float xtd::drawing::native::image::vertical_resolution ( intptr  image)
staticprotected

Gets the vertical resolution, in pixels per inch, of the image.

Parameters
imageThe image handle.
Returns
The vertical resolution, in pixels per inch, of the image.
Warning
Internal use only

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