Class: Wx::SVGBitmapHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/wx/doc/gen/svg_file_dc.rb

Overview

Note:

This class is untracked and should not be derived from nor instances extended!

Abstract base class for handling bitmaps inside a SVGFileDC.

To use it you need to derive a new class from it and override #process_bitmap to generate a properly a formed SVG image element (see www.w3.org/TR/SVG/struct.html#ImageElement). Two example bitmap handlers are provided in /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 (SVGBitmapEmbedHandler) will embed the PNG image in the SVG file using base 64 encoding. The handler can be changed by calling Wx::SVGFileDC#set_bitmap_handler.

Category: Device Contexts

Requires:

  • USE_SVG

Direct Known Subclasses

SVGBitmapEmbedHandler, SVGBitmapFileHandler

Instance Method Summary collapse

Instance Method Details

#process_bitmap(bitmap, x, y, stream) ⇒ Boolean

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 Wx::SVGFileDC class so it is important that the XML is properly formed.

Parameters:

  • bitmap (Wx::Bitmap)

    A valid bitmap to add to SVG.

  • x (Integer)

    Horizontal position of the bitmap.

  • y (Integer)

    Vertical position of the bitmap.

  • stream (Wx::OutputStream)

    The stream to write SVG contents to.

Returns:

  • (Boolean)


101
# File 'lib/wx/doc/gen/svg_file_dc.rb', line 101

def process_bitmap(bitmap, x, y, stream) end