Nana C++ Library  

An open-source C++ framework project
The Programmer's Guide 
nana::paint::image

Description

The class image is used for loading a picture file.

Model of

None 

Public base classes

None

Members

image() The default construction.
image(const image&) The copy construction.
~image() The destruction.
image& operator=(const image&) Assigns new image objects to the contents of an image.
bool open(const nana::char_t* file) Open a picture file.
bool empty() const Returns true if the image object is empty.
void close() Release the resource.
nana::size size() const Returns the size of the picture in pixel.
void paste(const nana::rectangle& r_src, graphics& dst, const nana::point & p_dst) const Paste the area of picture specified by r_src into the destination graphics specified by dst at position p_dst.
void stretch(const nana::rectangle& r_src, graphic& dst, const nana::rectangle& r_dst) const Paste the picture into the dst, stretching or compressing the picture to fit the given area.

Notes

1. Load a bitmap into a graphics.
    nana::paint::graphics graph;
    nana::paint::image    img(STR("C:\\ABitmap.bmp"));
    img.paste(img.size(), graph, nana::point());  //graph may create if it is empty

See also

None.


Move to The Nana Programmer's Guide Main Page