本文介绍了使用innerRing绘制多边形。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
问题如下。
我有2个点数组。在图形中我需要绘制多边形(数组1)而不绘制内部(数组2),如此图像。
[]
任何想法如何在C #?
The problem is the following.
I have 2 arrays of points. In a graphics I need to paint the polygon (array 1) without painting the inside (array 2), As this image.
http://wiki.openstreetmap.org/w/images/thumb/b/b4/Multipolygon_Illustration_1.svg/400px-Multipolygon_Illustration_1.svg.png[^]
Any idea how to do this in C#?
推荐答案
Bitmap img = new Bitmap( 200, 200 );
Graphics imgGraph = Graphics.FromImage( img );
imgGraph.CompositingMode = System.Drawing.Drawing2D.CompositingMode.SourceCopy;
imgGraph.FillPolygon( Brushes.Red, Points1 );
imgGraph.FillPolygon( Brushes.Transparent, Points2 );
这就是所有人!
That''s all folks!
这篇关于使用innerRing绘制多边形。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!