[UFO-devel] Hallo Wieder - Clarification of my problem - I will pay $ for your consulting!
Status: Beta
Brought to you by:
schmidtjf
From: <hv...@st...> - 2007-05-11 01:43:32
|
Hi again, I'm having some serious trouble trying to figure out how to pass an image so that libUFO displays it. I'm trying to follow the directions which you outlined on this email that I found archived on the mailing list, but I can't for the life of me get it to work. I'm really panicking, because I need to have this functionality working soon. As far as I can tell from the specifications on sourceforge, UGL_Image must be passed as an argument to UImage, and then you can pass UImageIO as an argument to UGL_Image? (And UGL_Image can take a flat array of unsigned char, each representing one color of a pixel). If you could write out a quick example which reads in an image from an array or something (not a file, I can do that with UIcon) and explain a bit how it functions I'd be happy to Paypal you $25 for all the time you've spent helping me. Consider it a "donation" for all the hard work you've put into this great toolkit! Mit sehr Freundlichen Grussen, Andrew "It is not that trivial but it is possible. If you do not care about performance too much (at least in the beginning), you can use the built-in image class (UImage) and assign this as icon of a label (or button). That means, you create your own image buffer and feed it as RGB(A) data to an UImageIO class, create an image and so on. I have attached a small example (image.cpp) which shows how to do that (based on the base.cpp example). Compile it via: g++ -o image image.cpp `pkg-config --cflags --libs ufo` Otherwise you can draw the image yourself using OpenGL methods. To do this, you have to subclass UWidget and override UWidget::paintWidget(UGraphics*) with your own code (set up matrices and OpenGL state, draw image, revert OpenGL matrices and states). " |