SetBgImage
Prev | PHPlot Function Reference | Next

## SetBgImage

SetBgImage — Set a graphic file to be used in the graph background

## Synopsis

    $plot->SetBgImage($input_file, [$mode])

## Description

`SetBgImage` sets an image file to be used as the graph background. The image can be scaled or tiled to fit.

## Parameters

`$input_file`

  Path to the file to be used. The file can be any type allowed by GD, which usually includes JPEG, GIF, and PNG.

`$mode`

  Optional display mode for the background image: one of the strings 'centeredtile', 'tile', or 'scale'. The default is 'centeredtile'.

## Notes

If a background image has been set, background color (set with SetBackgroundColor) is ignored.

Scale mode scales the supplied background image file to fit the image area of the entire graph. Tile and centeredtile modes repeat the supplied background image file as needed to fit the image area of the graph. The difference is that centeredtile offsets the start position within the background image by half its size, which works better for some images.

SetBgImage sets a background for the entire image area, while SetPlotAreaBgImage sets a background for the plot area (generally, the area between the axes). If both are used, the plot area background overlays that portion of the overall background.

Prev | Up | Next
SetBackgroundColor | Home | SetBrowserCache