[Prev][Next][Index][Thread]

Re: Graphics



"Scott McKay" <swm@mediaone.net> writes:

> Chris Double just gave a pointer to an example on his web site that
> includes a program to load bitmaps.  I dunno about loading gifs,
> tho'; I didn't look at his code.

No, it doesn't do GIF's. The example just uses the Win32 LoadImage API
to load a bitmap from a file. It creates a subclass of <image> to keep
the bitmap information and do the right thing on draw-image, etc.

Any chance of a read-image-as that's specialised on locators to read
images from files in a future update of FunDev? Or a means of creating
<win32-bitmap> given an <hbitmap>? I tried:

  make(<win32-bitmap>, handle: the-handle);

but it required height, width and resource-id - and wouldn't draw when
I passed dummy values as those.

To the original poster, the example of loading windows bitmaps is at:

http://www.double.co.nz/dylan/projects/bitmap1.htm

For GIF's, you could write some Dylan code to read a GIF file, create
a subclass of <image>, and implement the image protocol. Or find a C
library that loads gif's and use the c-ffi to leverage that.

Chris.
-- 
http://www.double.co.nz/dylan




References: