XRC: add GetBitmapBundle function
The function creates wxBitmapBundle from <bitmaps> xrc tag. Co-authored-by: VZ <vz-github@zeitlins.org>
This commit is contained in:
@@ -340,8 +340,9 @@ or translations are done.
|
||||
|
||||
@subsection overview_xrcformat_type_bitmap Bitmap
|
||||
|
||||
Bitmap properties contain specification of a single bitmap or icon. In the most
|
||||
basic form, their text value is simply a relative URL of the bitmap to use.
|
||||
Bitmap properties contain specification of a single bitmap, icon, a set of bitmaps
|
||||
or SVG file. In the most basic form, their text value is simply a relative URL of
|
||||
the bitmap to use.
|
||||
For example:
|
||||
@code
|
||||
<object class="tool" name="wxID_NEW">
|
||||
@@ -363,6 +364,31 @@ percent-encoded, e.g. here is the correct way to specify a bitmap with the path
|
||||
Bitmap file paths can include environment variables that are expanded if
|
||||
wxXRC_USE_ENVVARS was passed to the wxXmlResource constructor.
|
||||
|
||||
It is possible to specify the multi-resolution bitmap by a set of bitmaps or
|
||||
an SVG file, which are mutually exclusive. The set of bitmaps should contain
|
||||
one or more relative URLs of a bitmap, separated by @c ';'.
|
||||
For example, to specify two bitmaps, to be used in standard and 200% DPI
|
||||
scaling respectively, you could write:
|
||||
@code
|
||||
<bitmap>new.png;new_2x.png</bitmap>
|
||||
@endcode
|
||||
|
||||
Here the first bitmap is special, as its size determines the logical size of
|
||||
the bitmap. In other words, this bitmap is the one used when DPI scaling
|
||||
is not in effect. Any subsequent bitmaps can come in any order and will be used
|
||||
when the DPI scaling factor is equal, or at least close, to the ratio of their
|
||||
size to the size of the first bitmap. Using @c _2x naming convention here is common,
|
||||
but @e not required, the names of the bitmaps can be arbitrary, e.g.
|
||||
@code
|
||||
<bitmap>new_32x32.png;new_64x64.png</bitmap>
|
||||
@endcode
|
||||
would work just as well.
|
||||
When using SVG file you must also specify @c default_size attribute
|
||||
(even if the size is specified in SVG file, it may be different from the size needed here):
|
||||
@code
|
||||
<bitmap default_size="32,32">new.svg</bitmap>
|
||||
@endcode
|
||||
|
||||
Alternatively, it is possible to specify the bitmap using wxArtProvider IDs.
|
||||
In this case, the property element has no textual value (filename) and instead
|
||||
has the @c stock_id XML attribute that contains stock art ID as accepted by
|
||||
|
||||
Reference in New Issue
Block a user