Groups | Blog | Home
all groups > dotnet drawing api > may 2006 >

dotnet drawing api : Is there a limit in DrawLines


Peter Klinge
5/31/2006 12:00:00 AM
Hi,

I'm using Graphics.DrawLines (Pen, PointF[]) to draw a long curve with
thousands of points - works perfectly on printers.
Now I have found, that the preview functionality seems to have problems,
if I pass more than 6000 or 7000 points. Now I'm a bit concerned, that
there are different limits for different printers, Windows versions, ...
Unfortunately I haven't found any hint, that there is a limit for the
number of points.
Has anyone found similar problems or has anyone a hint for that limit or
has anyone a hint, how to ask the graphics engine, how many points could
be processed.

Göran_Andersson
5/31/2006 11:38:48 AM
[quoted text, click to view]

What kind of problems?

[quoted text, click to view]
Peter Klinge
6/1/2006 1:39:40 PM
Göran Andersson schrieb:
[quoted text, click to view]

If I pass more than 6000 or 7000 points, the curve will not been drawn.
Also it seems, that the graphics object is destroyed (or what ever) - no
further drawing operations in the same print job (the same page) will be
done.
As the result I see an incomplete page, where all graphic elements are
visible, I have drawn before that operation, but all elements after that
operation aren't visible.

Bob Powell [MVP]
6/1/2006 10:31:57 PM
Is any exception thrown or does the operation just seem to stop?

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.



[quoted text, click to view]

Doug Forster
6/2/2006 12:00:00 AM
Hi Peter,

Well its been a while and I can't remember the details but I have definitely
have had issues where adjacent points were the same or mapped to the same
device point under a transform. Otherwise it would be easy enough to split
your long curves up into smaller sections to test the length limit theory.

Cheers
Doug Forster

Peter Klinge
6/2/2006 12:00:00 AM
Bob Powell [MVP] schrieb:
[quoted text, click to view]

No, there isn't any exception. The operation of printing one page stops
at the point of calling DrawLines with more than appr. 7000 points. The
result is a incomplete printed page.

Peter Klinge
6/2/2006 12:00:00 AM
Doug Forster schrieb:
[quoted text, click to view]

Hi Doug,

in general it's not a problem to find this limit on my PC. But I don't
know, if the limit is depending from environment. And so I don't know,
if the limit found on my PC is a general limit for all PC's at
customers, where our program will be used. That's why this isn't a point
for me.

Ciao,
Bob Powell [MVP]
6/2/2006 7:28:52 PM
I think this would be a problem with the printer driver. I need to run some
tests to see if anything like this happens on screen.

Have you tried it on several printers?

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.



[quoted text, click to view]

Doug Forster
6/6/2006 12:00:00 AM
Hi Peter,

[quoted text, click to view]

Yes I can understand that, but have you actually determined that the
problem -is- actually a point limit (even if only valid in your own
environment)? In other words do you have a set of points that fails to draw
in one hit but which will draw when split into two parts using exactly the
same set of points. I was trying to make the point there -may- be other
factors at play.

Cheers
Doug Forster



Peter Klinge
6/15/2006 12:16:01 PM
Bob Powell [MVP] schrieb:
[quoted text, click to view]
Sorry, that I answer only today.

Yes, I have tried with several printers. It seems, that it works with
all that printers, but it doesn't work with preview. I don't know, if
the preview functionality is using the printer driver of the default
printer, but my line draw works with all printers installed in my system
(FinePrint, pdfFactory, some HP printers, some Kyocera printers and one
OKI printer) and the default printer too.

Peter Klinge
6/15/2006 12:16:50 PM
Doug Forster schrieb:
[quoted text, click to view]
Hi Doug,

sorry, that I answer today only.

Yes, I have tested with exactly the same source code (and of course with
the same data). The only difference is the limit. If I set the limit to
5000 points, all works OK, if I set the limit to 9000, it will not work.
The point field is a dynamically allocated field (C# array list), and as
said before, the only difference is the limit of 5000 or 9000. Also it
works with all printers installed on my system, but not in preview.

ffekravar NO[at]SPAM slb.com
7/24/2006 2:11:25 PM
Hi Everybody,

I have been experiencing the same problem since almost one year, the limit on my PC is 8000, I have had to make the array in pieces less than 8000.
The problem is just on print preview, the printer works fine.

Any resolution/suggestion, I would welcome too?

Thanks,
Faroukh
AddThis Social Bookmark Button