Re: [Fxruby-users] Converting Image Formats
Status: Inactive
Brought to you by:
lyle
|
From: Sander J. <sx...@cf...> - 2003-12-17 16:02:30
|
Lyle,
I don't think that will work, img is still a FXBMPImage. What you really =
want=20
to do is call (the ruby alternatives)
fxloadBMP(parameters);
and=20
fxsaveJPG(parameters);
You don't need the image class if you're not going to show it on screen.=20
=09Sander
On Wednesday 17 December 2003 09:56 am, Lyle Johnson wrote:
> Carsten Eckelmann wrote:
> > is it possible to load a BMPImage and save it as a JPEG, just by usin=
g
> > the FOX library? I couldn't find this out by looking at the API.
>
> Good question (and the answer is yes). Load the BMP image from a file
> using code like this:
>
> img =3D FXBMPImage.new(getApp(), nil,
> IMAGE_KEEP|IMAGE_SHMI|IMAGE_SHMP)
> FXFileStream.open("image.bmp", FXStreamLoad) do |stream|
> img.loadPixels(stream)
> end
>
> and then save it as a JPEG using code like this:
>
> FXFileStream.open("image.jpg", FXStreamSave) do |stream|
> img.savePixels(stream)
> end
>
> Hope this helps,
>
> Lyle
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: IBM Linux Tutorials.
> Become an expert in LINUX or just sharpen your skills. Sign up for IBM=
's
> Free Linux Tutorials. Learn everything from the bash shell to sys admi=
n.
> Click now! http://ads.osdn.com/?ad_id=3D1278&alloc_id=3D3371&op=3Dclick
> _______________________________________________
> Fxruby-users mailing list
> Fxr...@li...
> https://lists.sourceforge.net/lists/listinfo/fxruby-users
|