# wxRichTextImage Class Reference
[Rich Text]

`#include <wx/richtext/richtextbuffer.h>`

Inheritance diagram for wxRichTextImage:
[legend]

## Detailed Description

This class implements a graphic object.

##

Library: wxRichText

Category: Rich Text

See also:
  wxRichTextBuffer, wxRichTextCtrl, wxRichTextImageBlock

## Public Member Functions
| wxRichTextImage (wxRichTextObject *parent=NULL)
| Default constructor.
| wxRichTextImage (const wxImage &image, wxRichTextObject *parent=NULL, wxRichTextAttr *charStyle=NULL)
| Creates a wxRichTextImage from a wxImage.
| wxRichTextImage (const wxRichTextImageBlock &imageBlock, wxRichTextObject *parent=NULL, wxRichTextAttr *charStyle=NULL)
| Creates a wxRichTextImage from an image block.
| wxRichTextImage (const wxRichTextImage &obj)
| Copy constructor.
virtual bool | Draw (wxDC &dc, const wxRichTextRange &range, const wxRichTextSelection &selection, const wxRect &rect, int descent, int style)
| Draw the item, within the given range.
virtual bool | Layout (wxDC &dc, const wxRect &rect, int style)
| Lay the item out at the specified position with the given size constraint.
virtual bool | GetRangeSize (const wxRichTextRange &range, wxSize &size, int &descent, wxDC &dc, int flags, wxPoint position=wxPoint(0, 0), wxArrayInt *partialExtents=NULL) const
| Returns the object size for the given range.
virtual wxTextAttrSize | GetNaturalSize () const
| Returns the 'natural' size for this object - the image size.
virtual bool | IsEmpty () const
| Returns true if the object is empty.
virtual bool | CanEditProperties () const
| Returns true if we can edit the object's properties via a GUI.
virtual bool | EditProperties (wxWindow *parent, wxRichTextBuffer *buffer)
virtual wxString | GetPropertiesMenuLabel () const
| Returns the label to be used for the properties context menu item.
virtual bool | UsesParagraphAttributes () const
| Returns true if this object takes note of paragraph attributes (text and image objects don't).
virtual bool | IsFloatable () const
| Returns true if this class of object is floatable.
virtual wxString | GetXMLNodeName () const
| Returns the XML node name of this object.
const wxBitmap & | GetImageCache () const
| Returns the image cache (a scaled bitmap).
void | SetImageCache (const wxBitmap &bitmap)
| Sets the image cache.
void | ResetImageCache ()
| Resets the image cache.
wxRichTextImageBlock & | GetImageBlock ()
| Returns the image block containing the raw data.
void | Copy (const wxRichTextImage &obj)
| Copies the image object.
virtual wxRichTextObject * | Clone () const
| Clones the image object.
virtual bool | LoadImageCache (wxDC &dc, bool resetCache=false)
| Creates a cached image at the required size.
## Protected Attributes
wxRichTextImageBlock | m_imageBlock
wxBitmap | m_imageCache

List of all members.

## Constructor & Destructor Documentation

wxRichTextImage::wxRichTextImage | ( | wxRichTextObject * | parent = `NULL` | ) | `[inline]`

Default constructor.

wxRichTextImage::wxRichTextImage | ( | const wxImage & | image,
|  | wxRichTextObject * | parent = `NULL`,
|  | wxRichTextAttr * | charStyle = `NULL` |
| ) |  |  |

Creates a wxRichTextImage from a wxImage.

wxRichTextImage::wxRichTextImage | ( | const wxRichTextImageBlock & | imageBlock,
|  | wxRichTextObject * | parent = `NULL`,
|  | wxRichTextAttr * | charStyle = `NULL` |
| ) |  |  |

Creates a wxRichTextImage from an image block.

wxRichTextImage::wxRichTextImage | ( | const wxRichTextImage & | obj | ) | `[inline]`

Copy constructor.

## Member Function Documentation

virtual bool wxRichTextImage::CanEditProperties | ( |  | ) | const`[inline, virtual]`

Returns true if we can edit the object's properties via a GUI.

Reimplemented from wxRichTextObject.

virtual wxRichTextObject* wxRichTextImage::Clone | ( |  | ) | const`[inline, virtual]`

Clones the image object.

Reimplemented from wxRichTextObject.

void wxRichTextImage::Copy | ( | const wxRichTextImage & | obj | ) |

Copies the image object.

virtual bool wxRichTextImage::Draw | ( | wxDC & | dc,
|  | const wxRichTextRange & | range,
|  | const wxRichTextSelection & | selection,
|  | const wxRect & | rect,
|  | int | descent,
|  | int | style |
| ) |  |  | `[virtual]`

Draw the item, within the given range.

Some objects may ignore the range (for example paragraphs) while others must obey it (lines, to implement wrapping)

Implements wxRichTextObject.

virtual bool wxRichTextImage::EditProperties | ( | wxWindow * | parent,
|  | wxRichTextBuffer * | buffer |
| ) |  |  | `[virtual]`

wxRichTextImageBlock& wxRichTextImage::GetImageBlock | ( |  | ) | `[inline]`

Returns the image block containing the raw data.

const wxBitmap& wxRichTextImage::GetImageCache | ( |  | ) | const`[inline]`

Returns the image cache (a scaled bitmap).

virtual wxTextAttrSize wxRichTextImage::GetNaturalSize | ( |  | ) | const`[virtual]`

Returns the 'natural' size for this object - the image size.

Reimplemented from wxRichTextObject.

virtual wxString wxRichTextImage::GetPropertiesMenuLabel | ( |  | ) | const`[inline, virtual]`

Returns the label to be used for the properties context menu item.

Reimplemented from wxRichTextObject.

virtual bool wxRichTextImage::GetRangeSize | ( | const wxRichTextRange & | range,
|  | wxSize & | size,
|  | int & | descent,
|  | wxDC & | dc,
|  | int | flags,
|  | wxPoint | position = `wxPoint(0, 0)`,
|  | wxArrayInt * | partialExtents = `NULL` |
| ) |  |  | const`[virtual]`

Returns the object size for the given range.

Returns false if the range is invalid for this object.

Implements wxRichTextObject.

virtual wxString wxRichTextImage::GetXMLNodeName | ( |  | ) | const`[inline, virtual]`

Returns the XML node name of this object.

This must be overridden for wxXmlNode-base XML export to work.

Reimplemented from wxRichTextObject.

virtual bool wxRichTextImage::IsEmpty | ( |  | ) | const`[inline, virtual]`

Returns true if the object is empty.

Reimplemented from wxRichTextObject.

virtual bool wxRichTextImage::IsFloatable | ( |  | ) | const`[inline, virtual]`

Returns true if this class of object is floatable.

Reimplemented from wxRichTextObject.

virtual bool wxRichTextImage::Layout | ( | wxDC & | dc,
|  | const wxRect & | rect,
|  | int | style |
| ) |  |  | `[virtual]`

Lay the item out at the specified position with the given size constraint.

Layout must set the cached size.

Implements wxRichTextObject.

virtual bool wxRichTextImage::LoadImageCache | ( | wxDC & | dc,
|  | bool | resetCache = `false` |
| ) |  |  | `[virtual]`

Creates a cached image at the required size.

void wxRichTextImage::ResetImageCache | ( |  | ) | `[inline]`

Resets the image cache.

void wxRichTextImage::SetImageCache | ( | const wxBitmap & | bitmap | ) | `[inline]`

Sets the image cache.

virtual bool wxRichTextImage::UsesParagraphAttributes | ( |  | ) | const`[inline, virtual]`

Returns true if this object takes note of paragraph attributes (text and image objects don't).

Reimplemented from wxRichTextObject.

## Member Data Documentation

wxRichTextImageBlock wxRichTextImage::m_imageBlock`[protected]`

wxBitmap wxRichTextImage::m_imageCache`[protected]`

|  | [ top ]