Robert May > Win32-GUI > Win32::GUI::BitmapInline

Download:
Win32-GUI/Win32-GUI-1.06.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Module Version: 0.03   Source   Latest Release: Win32-GUI-1.07

NAME ^

Win32::GUI::BitmapInline - Inline bitmap support for Win32::GUI

SYNOPSIS ^

To create a BitmapInline:

    perl -MWin32::GUI::BitmapInline -e "inline('image.bmp')" >>script.pl

To use a BitmapInline (in script.pl):

    use Win32::GUI();
    use Win32::GUI::BitmapInline ();
    
    $Bitmap1 = Win32::GUI::BitmapInline->new( q(
    Qk32AAAAAAAAAHYAAAAoAAAAEAAAABAAAAABAAQAAAAAAIAAAAAAAAAAAAAAABAAAAAQAAAAAAAA
    AACcnABjzs4A9/f3AJzO/wCc//8Azv//AP///wD///8A////AP///wD///8A////AP///wD///8A
    ////AHd3d3d3d3d3d3d3d3d3d3dwAAAAAAAABxIiIiIiIiIHFkVFRUVEQgcWVVRUVFRCBxZVVVVF
    RUIHFlVVVFRUUgcWVVVVVUVCBxZVVVVUVFIHFlVVVVVVQgcWZmZmZmZSBxIiIiIRERF3cTZlUQd3
    d3d3EREQd3d3d3d3d3d3d3d3
    ) );

DESCRIPTION ^

This module can be used to "inline" a bitmap file in your script, so that the script doesn't need to be accompained by several external files (less hassle when you need to redistribute your script or move it to another location).

FUNCTIONS

inline

The inline function is used to create an inlined bitmap resource; it will print on the currently selected filehandle (STDOUT by default) the packed data including the lines of Perl needed to use the inlined bitmap resource; it is intended to be used as a one-liner whose output is appended to your script.

The function takes the name of the bitmap file to inline as its first parameter; an additional, optional parameter can be given which will be the name of the bitmap object in the resulting scriptlet, eg:

    perl -MWin32::GUI::BitmapInline -e "inline('image.bmp','IMAGE')"
    
    $IMAGE = new Win32::GUI::BitmapInline( q( ...

If no name is given, the resulting object name will be $Bitmap1 (the next ones $Bitmap2 , $Bitmap3 and so on).

Note that the object returned by Win32::GUI::BitmapInline->new( ... ) is a regular Win32::GUI::Bitmap object.

With version 0.02 and later you can inline icons and cursors too. Nothing changes in the inlining process, just the file extension:

    perl -MWin32::GUI::BitmapInline -e "inline('harrow.cur')"  >>script.pl
    perl -MWin32::GUI::BitmapInline -e "inline('guiperl.ico')" >>script.pl

The module recognizes from the extension the type of object that it should recreate, so it will add these lines to script.pl:

    $Cursor1 = Win32::GUI::BitmapInline->newCursor( q( ...
    $Icon2 = Win32::GUI::BitmapInline->newIcon( q( ...

new

  my $bitmap = Win32::GUI::BitmapInline->new($data);

Returns a regular Win32::GUI::Bitmap object from the data created by the inlining process.

newCursor

Similar in behaviour to new(), except it returns a Win32::GUI::Cursor object.

newIcon

Similar in behaviour to new(), except it returns a Win32::GUI::Icon object.

REQUIRES ^

Win32::GUI
MIME::Base64
File::Spec
threads::shared

WARNINGS ^

VERSION ^

Win32::GUI::BitmapInline version 0.03, 24 January 2001.

AUTHOR ^

Aldo Calpini ( dada@perl.it ). Modifications by Robert May ( robertemay@users.sourceforge.net ).

syntax highlighting: