GraphicsPath IsVisible

  • Thread starter Thread starter Crirus
  • Start date Start date
C

Crirus

Hi
Is that true that this IsVisible method is incredible slow?

Seems that my app is much slower with only this added as a condition to draw
something

Crirus
 
Crirus said:
Is that true that this IsVisible method is incredible slow?

Seems that my app is much slower with only this added as a condition
to draw something

If you don't get an answer here:
microsoft.public.dotnet.framework.drawing
 
Crirus,
How complex is your GraphicsPath?

I currently do not use a GraphicsPath for clipping, I am thinking of using
it for drawing but need to figure out the logic, so I do not continue to
redraw the GraphicsPath, in a Paint event.

I would think the speed of GraphicsPath.IsVisible is dependant on how
complex your GraphicsPath is.

If the GraphicsPath has a number of unrelated figures in it, IsVisible would
need to check each figure, which obviously will take time.

I would also refer you to the microsoft.public.dotnet.framework.drawing
newsgroup.

Hope this helps
Jay
 
Well, Jay, there are only 2 circles in my path... and I dont know another
way to clip the image instead of GraphicsPath
 
No, I draw a bitmap with setPixel
Only certain regions must be drawed
I test if a point is inside the region in order to set that pixel
Seems that si much faster to draw the whole bounding region rectangle once
and redraw with clipping after is finished, so I get only that region drawed
 
Crirus,
I would not expect 2 circles to perform badly, 2000 circles yes, 2 circles
no. My concern is it is breaking the 2 circles into many rectangles &
checking each rectangle. Not sure how to check that, other then testing a
GraphicsPath with 2 circles & a GraphicsPath with 2 Rectangles to see if
there is a difference.

I'll try and play with it later this weekend, and get back to you.

I noticed you asked in the drawing newsgroup, but the person I expected to
"know" did not respond to you...

Is there anything mentioned on this GDI+ FAQ?

http://www.bobpowell.net/gdiplus_faq.htm

I'm not sure about other GDI+ FAQs you could check...

Hope this helps
Jay
 
Hi
I can tell you that IsVisible on my 2 circles is so slow so I droped the
ideea... to draw the whole 512x512 image that is 3 times bigger than path
inside it take about 2-3 seconds. To draw only inside the path with
IsVisible take 10 secs at least
Is eye noticeable :(((

Regards, Crirus
 
Hi
Is that true that this IsVisible method is incredible slow?

Seems that my app is much slower with only this added as a condition to draw
something

Crirus

This reply might be a bit late but yes, GraphicsPath.IsVisible can be incredibly slow. Use a Region instead, which you can create from the GraphicsPath:

Region MyRegion = new Region(GraphicsPath);

the .IsVisble method of the region is very fast.
 
Back
Top