[fxruby-users] <kein Betreff>

Lyle Johnson lyle at lylejohnson.name
Sat Oct 17 14:12:38 EDT 2009

On Oct 17, 2009, at 6:02 AM, Helmut Hagemann wrote:

> Have a Probelm with @image.crop
> why the picture use not the new border by creat crop command?
> with width and height i see old values a used

I'm having trouble understanding exactly what is your question, but  
looking at your code, I think you may have misinterpreted the  
arguments for the FXImage#crop method. Here is the documentation:


The first two arguments to crop() are the (x, y) coordinates for the  
top left corner of the crop rectangle, and the 3rd and 4th arguments  
are the width and height. In your code, you call crop() like this:

	@mywidth = 0.5*@image.width
	@myheight = 0.5*@image.height
	@image.crop(@mywidth, @myheight, @image.width, @image.height, FXRGBA 
(236, 233, 215, 255))

So this says that it should start cropping in the middle of the  
(original) image, but the resulting image should have the same height  
and width as the original image. Can you maybe say what it is that you  
expected to see, or what is your desired end result?

Hope this helps,


"FXRuby: Create Lean and Mean GUIs with Ruby"
Now available from the Pragmatic Bookshelf!

More information about the fxruby-users mailing list