hello there -
i’ve been searching for ways to rotate images by ‘arbitrary’ angles.
i’m basically trying to rotate an image based on a time thread - it
seems that Gdk::Pixbuf only allows for rotations of 90, 180, or 270
degrees - am i wrong? man i hope so… that would make things so very
much easier. i’ve played around with the Cairo context rotate method,
which accepts any angle, and provides a way to define the center of the
rotation - but i’ve had a million headaches trying to incorporate
cairo’s need to be painted when the window is realized into a
Gtk::Layout or Gnome::Canvas, with no luck.
assuming that in my hours of searching on google and here on the forum
i haven’t overlooked some obvious methods that would solve my problems,
i’ve been left trying various image libraries. i’ve tried RMagick which
has a handy rotate method, but is too slow to be used in the way i would
i stumbled upon Imlib2, which is quick and well documented and seems
like it should do everything i need - BUT…
win = Gtk::Window.new()
image = Imlib2::Image.load_image(“TradyBlix.png”)
gtkimg = Gtk::Image.new(“temp.png”)
…which ought to rotate my image by, well, 0 degrees -
rotates it instead to what seems like a random angle. if i run the
program several times in succession it rotates the image differently
any ideas what the heck is happening here? i’ve searched and
searched, and can’t seem to find any explanation.
any other ideas for ways to rotate an image in gtk would be
appreciated too. relying on the library to rotate and then save a temp
file to later load it under gtk seems barbaric, but i can’t figure out a
better way to do it.
thanks in advance -