Class: Wx::SVGBitmapFileHandler

Inherits:
SVGBitmapHandler 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!

Handler saving bitmaps to external PNG files and linking to it from the SVG.

This handler is used by default by SVGFileDC. PNG files are created in the same folder as the SVG file and are named using the SVG filename appended with _image#.png. When using Wx::SVGFileDC#set_bitmap_handler to set this handler with the default constructor, the PNG files are created in the runtime location of the application. The save location can be customized by using the wxSVGBitmapFileHandler(const wxFileName&) constructor.

Category: Device Contexts

See Also:

  • Wx::SVGFileDC#set_bitmap_handler.

Requires:

  • USE_SVG

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Wx::SVGBitmapFileHandler

Create a Wx::SVGBitmapFileHandler and specify the location where the file will be saved.

Parameters:

  • path (String)

    The path of the save location. If path contains a filename, the autogenerated filename will be appended to this name.



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

def initialize(path) end

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)


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

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