wxWidgets: wxSVGBitmapHandler Class Reference

| Version: 3.2.6

Public Member Functions | List of all members
wxSVGBitmapHandler Class Referenceabstract
Class List by Category » Device Contexts

`#include <wx/dcsvg.h>`

Inheritance diagram for wxSVGBitmapHandler:
[legend]

## Detailed Description

Abstract base class for handling bitmaps inside a wxSVGFileDC.

To use it you need to derive a new class from it and override ProcessBitmap() to generate a properly a formed SVG image element (see http://www.w3.org/TR/SVG/struct.html#ImageElement).

Two example bitmap handlers are provided in wx/dcsvg.h. The first (default) handler will create PNG files in the same folder as the SVG file and uses links to them in the SVG. The second handler (wxSVGBitmapEmbedHandler) will embed the PNG image in the SVG file using base 64 encoding.

The handler can be changed by calling wxSVGFileDC::SetBitmapHandler().

##

Library: wxCore
Category: Device Contexts

Since
  3.1.0

## Public Member Functions
virtual bool | ProcessBitmap (const wxBitmap &bitmap, wxCoord x, wxCoord y, wxOutputStream &stream) const =0
| Writes the bitmap representation as SVG to the given stream. More...

## Member Function Documentation

## ◆ ProcessBitmap()

virtual bool wxSVGBitmapHandler::ProcessBitmap | ( | const wxBitmap & | bitmap,
|  | wxCoord | x,
|  | wxCoord | y,
|  | wxOutputStream & | stream
| ) |  | const
| pure virtual

Writes the bitmap representation as SVG to the given stream.

The XML generated by this function will be inserted into the SVG file inline with the XML generated by the main wxSVGFileDC class so it is important that the XML is properly formed.

Parameters

  bitmap | A valid bitmap to add to SVG.
  x | Horizontal position of the bitmap.
  y | Vertical position of the bitmap.
  stream | The stream to write SVG contents to.

Implemented in wxSVGBitmapFileHandler, and wxSVGBitmapEmbedHandler.