Hello,
I am having problems using the ''resize'' and
''size'' methods of
Wx::Image. They seem to be undefined:
irb(main):021:0> image = Wx::Image.new("input.ppm")
=> #<Wx::Image:0xb7b49ef4>
irb(main):022:0> image.respond_to? "rescale"
=> true
irb(main):023:0> image.respond_to? "resize"
=> false
irb(main):024:0> image.respond_to? "size"
=> false
Installation details:
wxruby2-preview (0.0.40)
Ruby interface to the wxWidgets GUI library
ruby 1.8.5 (2006-08-25) [i486-linux]
Any help would be much appreciated.
Roman
Hi Roman Kingsland wrote:> I am having problems using the ''resize'' and ''size'' methods of > Wx::Image. They seem to be undefined: > > wxruby2-preview (0.0.40) > Ruby interface to the wxWidgets GUI library >Thanks for the report - it seems these two have been missed in the header files which generate the methods in Ruby. Will be fixed for the next release. In the meantime, you could probably use a MemoryDC to do something similar to those methods, drawing the original bitmap onto a suitably sized ''canvas'' image. Or if you''ve compiled your own wxruby2 I can give you a patch. a
Hi> In the meantime, you could probably use a MemoryDC to do something > similar to those methods, drawing the original bitmap onto a suitably > sized ''canvas'' image. Or if you''ve compiled your own wxruby2 I can give > you a patch.A patch would be great, thanks. Roman
Roman Kingsland wrote:>> In the meantime, you could probably use a MemoryDC to do something >> similar to those methods, drawing the original bitmap onto a suitably >> sized ''canvas'' image. Or if you''ve compiled your own wxruby2 I can give >> you a patch. >> > > A patch would be great, thanks. >Please find attached - to be applied in the base directory of the unpacked src .tar.gz. Once it''s applied, rake should only need to recompile the Image class, and re-link the wxruby2.so library. alex -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: wximage_size.patch Url: http://rubyforge.org/pipermail/wxruby-users/attachments/20070605/49ee67f4/attachment.pl