Login  Register

(no subject)

Posted by Benjamin Schmid-2 on Oct 20, 2014; 12:07pm
URL: http://imagej.273.s1.nabble.com/no-subject-tp5010116p5010117.html

Hi Nibras,

On 10/20/14 1:23 PM, Nibras wrote:

> Hello,
>
> I've been trying to change the background color of the ImageJ 3D Viewer
> which am using in my application. I have not been able to do so so far.
>
> I tried a few options and they seem to fail.
> 1) Add a Background() to ImageUniverse.getScene() fails with
> AccessRestrictionExcetion,
> 2) Add a Background() to a BranchGroup() and add it to
> ImageUniver.getScene() has no effect.
> 3) Create Content using ContentGenerator. Add Background() directly or via
> BranchGroup() and add it via ImageUniverse.addContent() has no effect.
> 4) Create Content using ContentGenerator. Add it to BranchGroup() after
> adding a Background() and then add BranchGroup via
> ImageUniverse.addBranchGraph(). No effect and image doesn't display.
>
> I realized that I maybe able to add a Background if I rewrite the original
> scene instantiation code to add a Background as soon as it's added.
> However, I couldn't find any licensing information attached to the source.
> Will I be able to modify and reuse the code?
>
> The application am developing is an academic project.
>
The 3D Viewer's scene already contains a Background object, the color of
which you can change. This can be done from the GUI, or you can do it
programmatically. Executor.changeBackgroundColor() is called if you click
on View->Change background color. It also shows how you can use it from
within your own code:

https://github.com/fiji/3D_Viewer/blob/master/src/main/java/ij3d/Executer.java#L786

Best wishes,
Bene

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html