Hi,
I updated the code as follows.
Code:
wxImageHandler * tgaLoader = new wxJPEGHandler();
wxImage::AddHandler(tgaLoader);
wxImage wximage;
wximage.LoadFile(_T(/home/lahiru/Pictures/IMG_6064.JPG), wxBITMAP_TYPE_JPEG);
wxMemoryOutputStream img_data(NULL,0);
Hi all,
After trying for few hours, I was able to convert the wxImage into an
osg:Image, and apply it as a texture.
I am posting the code below as it might help someone else as well.
Code:
wxBitmap bmp(wximage);
wxNativePixelData data(bmp);
wxNativePixelData::Iterator p(data);
osg::Image*
Hi,
I modified the code to convert a wxImage to osg Image as follows. However, for
some reason the resulting osg Image is not accurate. When I apply the resulted
osg Image as a texture, it shows nothing but a gray colored QUAD.
Am I doing something wrong in the code below?
I really appreciate
Hi Thibault,
Thanks for the sample code!
However, it is actually to covert an osg:Image to a wxImage right?
Well... in my case, I need to convert a wxImage to an osg:Image. So that I can
apply it as a texture on my GL_QUAD.
Anyway, I will look more into your sample code... I might find a
Hi Thibault,
Thanks a lot for the reply!
I will check this out.
Thanks again!
Best Regards,
Lahiru
--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=32135#32135
___
osg-users mailing list
Hi all,
I am trying to create a wxImage (bitmap) in runtime using wxMemoryDC, draw a
gradient rect on it and apply the bitmap as a texture on a QUAD.
But I still couldn't find a proper way to convert the proceed wxImage (with
gradient) into a osg:Image.
I really appreciate if you can help me
Hi Lahiru
I use the attached code when converting from wxImage to osg::Image.
The code is slightly modified to be independent from my project, but
should be a good starting point.
You might very well rethink how wxImageHandlers are created (i.e. if
you call wxInitAllImageHandlers() at the
7 matches
Mail list logo