graphicspath

Region.IsVisible(PointF) has very slow performance for large floating point values

风流意气都作罢 提交于 2019-11-28 13:44:10
I have run into a strange performance issue, and it would be great with an explanation to the behavior I'm experiencing. I'm using System.Drawing.Region.IsVisible(PointF) to determine if a point is inside a polygon. This usually works very well, but yesterday I noticed that the performance of the IsVisible method becomes very slow if the polygon is complex and it consists of large x- and y values. Below is some code to reproduce the issue (and an image that shows the shape of the polygon), sorry for the large array sizes, but the polygon needs to be quite complex before the issue appears. When

Flip the GraphicsPath that draws the text/string

时光总嘲笑我的痴心妄想 提交于 2019-11-28 01:33:56
I have this method in my Text Class and I can't seem to flip the whole text. I am using a Matrix to transform the GraphicsPath which is used to draw the string. Here's the code since I used @Jimi's answer: public LayerClass DrawString(LayerClass.Type _text, string text, RectangleF rect, Font _fontStyle, Brush brush, float angle, PaintEventArgs e) { using (StringFormat string_format = new StringFormat()) { SizeF stringSize = e.Graphics.MeasureString(text, _fontStyle); rect.Location = new PointF(Shape.center.X - (rect.Width / 2), Shape.center.Y - (rect.Height / 2)); GraphicsContainer gc = e

Creating a GraphicsPath from a semi-transparent bitmap

◇◆丶佛笑我妖孽 提交于 2019-11-27 15:15:43
问题 I want to create a GraphicsPath and a list of Points to form the outline of the non-transparent area of a bitmap. If needed, I can guarantee that each image has only one solid collection of nontransparent pixels. So for example, I should be able to record the points either clockwise or counter-clockwise along the edge of the pixels and perform a full closed loop. The speed of this algorithm is not important. However, the efficiency of the resulting points is semi-important if I can skip some