Skip to content

Load Image Data URL 2

RyanGlScott edited this page Oct 9, 2014 · 2 revisions

In 0.5.* and above, we can create the data URL directly from the contents.

{-# LANGUAGE OverloadedStrings #-}
module Main where

import Graphics.Blank

main :: IO ()
main = blankCanvas 3000 $ \ context -> do
    url <- readDataURL "image/jpeg" "images/Haskell.jpg"
    send context $ do
           img <- newImage url
           drawImage (img,[0,0])
Clone this wiki locally