Re: [osg-users] Convert wxImage to osg:Image

2010-10-03 Thread Lahiru Lakmal
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);

Re: [osg-users] Convert wxImage to osg:Image

2010-10-03 Thread Lahiru Lakmal
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*

Re: [osg-users] Convert wxImage to osg:Image

2010-10-01 Thread Lahiru Lakmal
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

Re: [osg-users] Convert wxImage to osg:Image

2010-09-30 Thread Lahiru Lakmal
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

Re: [osg-users] Convert wxImage to osg:Image

2010-09-28 Thread Lahiru Lakmal
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

[osg-users] Convert wxImage to osg:Image

2010-09-27 Thread Lahiru Lakmal
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

Re: [osg-users] Convert wxImage to osg:Image

2010-09-27 Thread Thibault Genessay
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