1

I'm trying to draw a vector file, now I have a problem in some of the samples when filling a graphics path (As an example of the graphics path I have a problem with):

MoveTo 40.5 20
LineTo 41.5 20
LineTo 41.5 25.5
LineTo 40.5 25.5
Close Path

Note: This is the simplest object, I have a lot of other complicated objects like this case.

Now this object doesn't have a pen, it has a brush only. The problem I have with Graphics.FillPath method when zoom out these objects sometimes disappear, then in the second zoom out they appear again, then disappear, appear etc...

Is there any option I can enable to stop this behavior?

SkryptX
  • 813
  • 1
  • 9
  • 24
user2179256
  • 659
  • 2
  • 9
  • 21
  • Anti-aliasing enabled? Maybe the path just becomes too small to render... Different from that: If you really want to paint advanced and resource-intensive stuff I maybe wouldn't use GDI. – SkryptX Oct 09 '15 at 00:37
  • Thanks for your response, I tried enable\disable Anti-aliasing, unfortunately the same result.... the problem as mentioned if I zoom out the first time disapper, the second time appear (which is smaller), on the 3rd zoom out disappear, 4th appear ..etc – user2179256 Oct 09 '15 at 00:41
  • Hmm... I'm not an expert of the code behind GDI but it's definitely no professional drawing library. I wouldn't be surprised if that is just a bug that happens. Besides that is drawing small objects often a problem in games too and often results in pragmatic but not perfect solutions. Maybe also write about what you want to draw so we can help you better with your project. – SkryptX Oct 09 '15 at 00:48
  • Also I found another article here on GDI and it's strange sides: http://stackoverflow.com/questions/19167463/oddly-drawn-graphicspath-with-graphics-fillpath And also a question is: How do you zoom? As I remember there is no native zooming in GDI+... – SkryptX Oct 09 '15 at 00:56
  • You could also try to not only use FillPath but also DrawPath. Maybe FillPath makes some rounding/arithmetic errors(like the link above shows do exist) and the fillarea becomes zero. With DrawPath you would still at least see the path, I think. – SkryptX Oct 09 '15 at 01:14

0 Answers0