In osgEarth 3.0 more than one ImageControl displays the same image

classic Classic list List threaded Threaded
3 messages Options
bpattison bpattison
Reply | Threaded
Open this post in threaded view
|

In osgEarth 3.0 more than one ImageControl displays the same image

In osgEarth 3.0 more than one ImageControl displays the same image.   For example.

    uimage uimg0("plus.png", ImageSourceType::FILE_IMAGE);
    osg::ref_ptr<osg::Image> image0 = uimg0.osg_image_ptr();
    uimage uimg1("minus.png", ImageSourceType::FILE_IMAGE);
    osg::ref_ptr<osg::Image> image1 = uimg1.osg_image_ptr();
    if (image0.valid())
    {
      s_imageControl0 = new osgEarth::ImageControl(image0.get());
      s_imageControl0->setHorizAlign(osgEarth::Control::ALIGN_CENTER);
      s_imageControl0->setFixSizeForRotation(true);
      center->addControl(s_imageControl0);
      s_imageControl1 = new osgEarth::ImageControl(image1.get());
      s_imageControl1->setHorizAlign(osgEarth::Control::ALIGN_CENTER);
      s_imageControl1->setFixSizeForRotation(true);
      center->addControl(s_imageControl1);



In the screen shot above, there should be a plus and a minus image. Instead its just minus. My guess is that ImageControl is using the same texture for all ImageControls.

fyi, uimage is a class that we developed which is a wrapper for ImageMagick.

Any assistance you can provide would be greatly appreciated.

-brian
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: In osgEarth 3.0 more than one ImageControl displays the same image

Brian, this bug is logged here:
https://github.com/gwaldron/osgearth/issues/1522

Feel free to contribute a fix if you have the time. It's unlikely we are going to be able to work on it in the short term.
Glenn Waldron / Pelican Mapping
bpattison bpattison
Reply | Threaded
Open this post in threaded view
|

Re: In osgEarth 3.0 more than one ImageControl displays the same image

Thank you for logging it. I don't a fix, but I'll definitely contribute it if we figure something out.