Graphics.UI.WXCore.Image

Description

Synopsis

Images

Set the icon of a frame.

Imagelist

imageListAddIconsFromFiles :: ImageList a -> Size -> [FilePath] -> IO () Source #

Initialize an image list with icons from files. Use a sizeNull to use the native size of the loaded icons.

Add an icon from a file to an imagelist.

Icons

withIconFromFile :: FilePath -> Size -> (Icon () -> IO a) -> IO a Source #

Load an icon (see iconCreateFromFile) and automatically delete it after use.

Load an icon from an icon file (ico,xbm,xpm,gif). The Size argument gives the desired size but can be sizeNull to retrieve the image in its natural size.

Get the size of an icon.

Cursors

withCursorFromFile :: FilePath -> (Cursor () -> IO a) -> IO a Source #

Load a cursor (see cursorCreateFromFile) and automatically delete it after use.

Load a cursor from an icon file (ico,xbm,xpm,gif). For a reason, this function is incompatible with iconCreateFromFile.

Bitmaps

withBitmapFromFile :: FilePath -> (Bitmap () -> IO a) -> IO a Source #

Load a bitmap (see bitmapCreateFromFile) and automatically delete it after use.

Load a bitmap from an image file (gif, jpg, png, etc.)

The size of a bitmap.

bitmapSetSize :: Bitmap a -> Size -> IO () Source #

Set the size of a bitmap.

Helpers

Get an image type from a file extension.

Get an image type from a file name.

Direct image manipulation

Get the pixels of an image.

imageCreateFromPixels :: Size -> [Color] -> IO (Image ()) Source #

Create an image from a list of pixels.

Get the pixels of an image as an array

Create an image from a pixel array

Get the size of an image

withImageData :: Image a -> (Ptr () -> IO b) -> IO b Source #

Do something with the pixels of an image

Pixel buffer

Create an image from a pixel buffer. Note: the image will delete the pixelbuffer.

Get the pixel buffer of an image. Note: use withPixelBuffer instead

An abstract pixel buffer (= array of RGB values)

Create a pixel buffer. (To be deleted with pixelBufferDelete).

Delete a pixel buffer.

Initialize the pixel buffer with a grey color. The second argument specifies the greyness as a number between 0.0 (black) and 1.0 (white).

Set the color of a pixel.

Get the color of a pixel

pixelBufferSetPixels :: PixelBuffer -> [Color] -> IO () Source #

Set all the pixels of a pixel buffer.

Get all the pixels of a pixel buffer as a single list.

The size of a pixel buffer