Re: [Fxruby-users] Converting Image Formats
Status: Inactive
Brought to you by:
lyle
|
From: Carsten E. <ca...@ci...> - 2003-12-17 22:19:52
|
Sander Jansen wrote:
>Lyle,
>
>I don't think that will work, img is still a FXBMPImage. What you really want
>to do is call (the ruby alternatives)
>
>fxloadBMP(parameters);
>
>and
>
>fxsaveJPG(parameters);
>
>You don't need the image class if you're not going to show it on screen.
>
> Sander
>
>
>
Thanks Sander,
I tried this and it works perfectly, just for reference here's the ruby
code, to make it work:
-----------------------------------
require 'fox'
include Fox
img = nil
FXFileStream.open("image.bmp", FXStreamLoad) do |stream|
img = fxloadBMP(stream)
end
FXFileStream.open("image.jpg", FXStreamSave) do |stream|
fxsaveJPG(stream, img[0], img[1], img[2], img[3], 100)
end
-----------------------------------
Cheers,
Carsten.
|