[id] = LoadBGPic(id, filename$[, table])
filename$
into memory and
assigns the identifier id
to it. If you pass Nil in id
, LoadBGPic()
will
automatically choose an identifier and return it.
Image formats that are supported on all platforms are PNG, JPEG, BMP,
IFF ILBM, GIF, and image formats you have a plugin for. Depending on the
platform Hollywood is running on, more image formats might be supported.
For example, on Amiga compatible systems Hollywood will be able to open all
image formats you have datatypes for as well. On Windows, LoadBGPic()
can also
load image formats supported by the Windows Imaging Component.
Starting with Hollywood 5.0, this function can also load vector formats like SVG if you have an appropriate plugin installed. Using a vector image as a BGPic has the advantage that when the size of the display changes (e.g. because the user is resizing the window), the BGPic can be adapted to the new size without any losses in quality because vector BGPics can be infinitely scaled without any sacrifices in quality. See Vector BGPics for more information on vector BGPics.
The third argument is optional. It is a table that can be used to set further options for the loading operation. The following fields of the table can be used:
Transparency:
LoadAlpha:
True
if the alpha channel of the
image shall be loaded, too. Please note that not all
pictures have an alpha channel and that not all
picture formats are capable of storing alpha channel
information. It is suggested that you use the PNG
format if you need alpha channel data. This tag
defaults to False
. (V4.5)
FillStyle:
Transparency
or the LoadAlpha
tags,
or when loading an image in a format that always
contains an alpha channel. FillStyle
is useful
especially in the latter case because some formats
always return an alpha channel but most of the time
you will not want to use this alpha channel when
loading such an image into a background picture.
See SetFillStyle for information on all available fill styles. (V5.0)
FillColor:
FillStyle
tag was set to #FILLCOLOR
, you
can use this tag to define the RGB color that shall
be used for backfilling. (V5.0)
TextureBrush:
FillStyle
tag was set to #FILLTEXTURE
, you
can use this tag to specify the identifier of the brush that
shall be used for texturing. (V5.0)
TextureX, TextureY:
FillStyle
was set to #FILLTEXTURE
. See SetFillStyle for details. (V5.0)
GradientStyle:
FillStyle
tag was set to #FILLGRADIENT
, you
can use this tag to specify the gradient type to use.
This can be #LINEAR
, #RADIAL
, or #CONICAL
. (V5.0)
GradientAngle:
#FILLGRADIENT
. The angle is expressed
in degrees. Only possible for #LINEAR
and #CONICAL
gradients. (V5.0)
GradientStartColor, GradientEndColor:
#FILLGRADIENT
. (V5.0)
GradientCenterX, GradientCenterX:
#RADIAL
or
#CONICAL
. Must be a floating point value between 0.0
and 1.0. See CreateGradientBGPic for details. (V5.0)
GradientBalance:
#CONICAL
. Must be a floating point value between
0.0 and 1.0. See CreateGradientBGPic for details. (V5.0)
GradientBorder:
#RADIAL
. Must be a floating point value between 0.0 and
and 1.0. See CreateGradientBGPic for details. (V5.0)
GradientColors:
GradientStartColor
and GradientEndColor
tags
are ignored. (V5.0)
ScaleWidth, ScaleHeight:
SmoothScale:
ScaleWidth
or ScaleHeight
is set, you can use this item to specify
whether or not Hollywood shall use anti-aliased scaling. Defaults to False
which means no anti-aliasing. Note that anti-aliased scaling is much slower
than normal scaling. (V5.3)
Loader:
Adapter:
LoadTransparency:
True
, the monochrome transparency of the image will
be loaded. Please note that this tag is specifically designed for monochrome
transparency channels, i.e. a transparent pen in a palette-based image. If
you want to load the alphachannel of an image, set the LoadAlpha
tag to
True
. This tag defaults to False
. (V6.0)
LoadPalette:
True
, Hollywood will load the BGPic as a palette BGPic.
This means that you can get and modify the BGPic's palette which is useful
for certain effects like color cycling. You can also make pens transparent using
the TransparentPen
tag (see below) or the LoadTransparency
tag (see above).
Palette BGPics also have the advantage of requiring less memory because 1 pixel
just needs 1 byte of memory instead of 4 bytes for 32-bit images. Note that if
you set the LoadPalette
tag to True
, your display will become a palette
display as soon as the BGPic is shown. Palette displays behave differently than
normal true colour displays and there are some things to be considered when
using them. See Palette displays for details. This tag defaults to False
.
(V9.0)
FillPen:
LoadPalette
tag has been set to True
(see above) and there is a transparent
pen in the image, you can use the FillPen
tag to specify the filling color for
all transparent areas in the image. This is the palette equivalent to the FillColor
tag which is only used for non-palette images. (V9.0)
TransparentPen:
LoadPalette
tag has been set to True
(see above), the TransparentPen
tag can be used to define a pen that should be made transparent. Pens are counted
from 0. Alternatively, you can also set the LoadTransparency
tag to True
to force Hollywood to use the transparent pen that is stored in the image file
(if the image format supports the storage of transparent pens). This tag defaults
to #NOPEN
. (V9.0)
UserTags:
If you use Transparency
, LoadTransparency
or LoadAlpha
your display will automatically
adopt the transparency settings of the BGPic when it is shown. In
other words, if you want to have a display with transparency simply load
a transparent BGPic and display it.
Please note that the Transparency
, LoadTransparency
and LoadAlpha
fields are mutually
exclusive. A BGPic can only have one transparency setting!
This command is also available from the preprocessor: Use @BGPIC to preload background pictures!
LoadBGPic(2, "MyBG.iff", {Transparency = $00FF00})This loads "MyBG.iff" as background picture 2 with the color green as transparency mask.