Copyright | (c) Daan Leijen 2003 (c) shelarcy 2007 |
---|---|
License | wxWindows |
Maintainer | wxhaskell-devel@lists.sourceforge.net |
Stability | provisional |
Portability | portable |
Safe Haskell | None |
Language | Haskell98 |
Images, Media, Sounds, and action!
- class Media w where
- sound :: FilePath -> Sound ()
- playLoop :: Sound a -> IO ()
- playWait :: Sound a -> IO ()
- image :: FilePath -> Image ()
- imageCreateFromFile :: String -> IO (Image ())
- imageCreateFromPixels :: Size -> [Color] -> IO (Image ())
- imageGetPixels :: Image a -> IO [Color]
- imageCreateFromPixelArray :: IArray a Color => a Point Color -> IO (Image ())
- imageGetPixelArray :: IArray a Color => Image b -> IO (a Point Color)
- bitmap :: FilePath -> Bitmap ()
- bitmapCreateFromFile :: FilePath -> IO (Bitmap ())
- bitmapFromImage :: Image a -> IO (Bitmap ())
Media
Abstract layer between MediaCtrl
and Sound
. This class intends to
avoid breaking backward-compatibility.
If use this method with Sound
, play a sound fragment asynchronously.
If use this method with MediaCtrl
, play media that is loaded by
mediaCtrlLoad
.
Sound
sound :: FilePath -> Sound () Source #
Return a managed sound object. The file path points to
a valid sound file, normally a .wav
.
playWait :: Sound a -> IO () Source #
Play a sound fragment synchronously (i.e. wait till completion).
Images
image :: FilePath -> Image () Source #
Return a managed image. Images are platform independent representations
of pictures, using an array of rgb pixels. See Graphics.UI.WXCore.Image for
low-level pixel manipulation. The file path should point to
a valid image file, like .jpg
, .bmp
, .xpm
, or .png
, for example.
Instances: Sized
.
imageCreateFromFile :: String -> IO (Image ()) #
usage: (imageCreateFromFile name
).
imageGetPixels :: Image a -> IO [Color] #
Get the pixels of an image.
imageCreateFromPixelArray :: IArray a Color => a Point Color -> IO (Image ()) #
Create an image from a pixel array
imageGetPixelArray :: IArray a Color => Image b -> IO (a Point Color) #
Get the pixels of an image as an array
Bitmaps
bitmapCreateFromFile :: FilePath -> IO (Bitmap ()) #
Load a bitmap from an image file (gif, jpg, png, etc.)
bitmapFromImage :: Image a -> IO (Bitmap ()) Source #
Create a bitmap from an image with the same color depth.