Guidance
指路人
g.yi.org
Guidance Forums / Reginald Rexx / Saving rxprint images as PNG or GIF etc.

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. Saving rxprint images as PNG or GIF etc.
#9820
Posted by: el_supremo 2007-01-15 11:40:39 Last edited by: Jeff Glatt 2007-06-20 13:32:01 (Total edited 1 time)
I've set up an object script which does a whole pile of funcdef to interface a fair bit of ImageMagick and MagickWand to Reginald. This then allows me to save the image produced by rxprint as a PNG or GIF, for example, which are only 3kb files instead of the 762kb file produced by a BMP.

I do this by sending the rxprint bitmap to the clipboard and then using these calls to MagickWand:
magickwandgenesis()
m_wand = newmagickwand()
magickreadimage(m_wand,"clipboard:")
magickwriteimage(m_wand,fn)
destroymagickwand(m_wand)
magickwandterminus()
where "fn" is the filename returned by the guifile statement in rxprint and can be any file format understood by ImageMagick (and that's a lot of formats - gif,tif,png,jpg,bmp, and many more). With a few extra function calls you can also do things like set the JPG compression, resize the image, add a frame, write more text on the image, and so on.

In order to use it you must, of course, have ImageMagick installed. The windows self extracting installer is a 6.7MB download which expands to about 20MB on disk. Once installed you only need to point my object file at your installation and off you go!

See: http://imagemagick.org/script/binary-releases.php#windows

For this kind of application the Q8 DLL version is best.

If there's any interest, I'll package up the current version of my object interface and some demo scripts.
Forum List • Thread List • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Tue 2024-10-8  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0