Opacity with ImageBrush

Nov 22, 2010 at 7:11 AM



Thanks for the efforts on this!


I am trying to set Opacity on an ImageBrush for use with a Kit3DBrush, however, not seeing any transparency on my object.  Is Opacity property of the ImageBrush supported?  Maybe not, but hopefully so.  I am using it in the same way I used it in WPF so I think I used it correctly:

            ImageBrush mapBrush = new ImageBrush();
            mapBrush.ImageSource = new BitmapImage(new Uri(@"images\EarthMap10k.jpg", UriKind.Relative));
            mapBrush.Opacity = .2;
            Kit3DBrush kit3dMapBrush = new Kit3DBrush(mapBrush, 600, 400);
            DiffuseMaterial mapMat = new DiffuseMaterial(kit3dMapBrush);
            geomod.Material = mapMat;  //new DiffuseMaterial(new Kit3DBrush(new SolidColorBrush(Colors.Blue)));
            geomod.BackMaterial = mapMat;

In WPF this same approach allows me to display a partially transparent globe so I can see the back side of the globe through the sphere.


Thank you, and hope to see more soon!  The Viewport2DVisual3D would be awesome!


Nov 22, 2010 at 10:19 AM


Your code looks fine, maybe this is not possible yet in kit3d. Have you tried to set the material opacity directly?


Nov 23, 2010 at 5:58 AM

I didn't see any Opacity property on the DiffuseMaterial or Material objects.  I could set Opacity on the ModelVisual3D though!  :)  I think that may work then...  We'll see...