Lisp HUG Maillist Archive

Save GP image to stream

Hi List,

I know how to load an external image from stream (thanks to Jeffrey Massung!):

(let ((ext-image (make-instance 'gp:external-image :data png-data :type :png)))

Now, is it possible to externalize and write an image from GP to a stream? write-external-image and externalize-and-write-image only takes a filename as argument.

Thanks,
Erik



_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


Re: Save GP image to stream

>>>>> On Sun, 16 Nov 2014 17:36:29 +0100, Erik Ronström said:
> 
> Hi List,
> 
> I know how to load an external image from stream (thanks to Jeffrey Massung!):
> 
> (let ((ext-image (make-instance 'gp:external-image :data png-data :type :png)))
> 
> Now, is it possible to externalize and write an image from GP to a stream? write-external-image and externalize-and-write-image only takes a filename as argument.

This is not currently documented, but the second argument to
write-external-image can be a stream with an element type compatible with
'(unsigned-byte 8).  It is somewhat limited though, because externalize-image
only externalizes to BMP.

-- 
Martin Simmons
LispWorks Ltd
http://www.lispworks.com/

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


Updated at: 2020-12-10 08:33 UTC