c# - SharpDx Direct2D draw layers on top of each other -
i creating application using sharpdx render control want draw multiple layers in control on top of each other using direct2d rendertarget , layers should visible. problem when call rendertarget.clear(color.transparent) clear screen black , can not see other layers. if not call clear method not clear current layer, drawing line using mouse move needed clear layer. can not draw each layer every time because can have thousands of objects draw can slow down application. how clear layer transparent background, can see other layers @ same time? or there other way this?
//sample code
if(!newobject) drawallgeometry(rendertarget, strokewidth); else { layer = new layer(rendertarget, rendertarget.size); var layerparam = new layerparameters() { contentbounds = rectanglef.infinite }; rendertarget.pushlayer(ref layerparam, layer); rendertarget.clear(color.transparent); /* code makes screen black. want layer transparent, can see drawings of drawallgeometry() */ rendertarget.drawrectangle(new rectanglef(canvassp.x, -canvassp.y, width, height), new solidcolorbrush(rendertarget, color.green), strokewidth * 5); rendertarget.poplayer(); }
Comments
Post a Comment