Description
An image loading and rendering library for sdl2 / sdl2-cairo.
README.md
sdl2-cairo-image
An image loading and rendering library for sdl2 / sdl2-cairo
Installation
This module can easily install via Cabal.
> cabal update
> cabal install sdl2-cairo-image
Usage
Loading image
Assume one import this module as
import qualified SDL.Cairo.Image as I
One can load an image within an IO a
. For example,
main = do
img <- I.loadRGBA8 PNG "wherever/your/image/is/img.png"
If this file is loaded correctly then img
will be a Image PixelRGBA8
. If failed, img
will be a default 5x5 image (i.e. I.defImageRGBA8
).
Displaying image
Please read here!