Is there an easy way to center the entire diagram on a page once it has been drawn?
RectangleF b = goView1.Document.ComputeBounds();
goView1.Document.Bounds = b;
goView1.DocExtentCenter = new PointF(b.X+b.Width/2, b.Y+b.Height/2);[/code]
The code you provided does not seem to work.
2.6 introduced those two properties.
I am using the 2.6.2 eval version with the new code you gave me and all seems to be going OK.
That’s a result of anti-aliasing when lines are drawn. You can try setting different values for the following GoView properties relating to painting quality:
Walter, I am sooooooo close!!! I nearly have it! If you could just help me figure out which of the settings you sent me might be causing the images and lines to become all fraile looking then it would be perfect!
OK. I figured out that the DocExtentCenter code is the culprit. It causes all of the “iffy” scaling issues.
I’m guessing that you could just make sure that the values of GoView.DocPosition are integral.
Could you give an example of what you mean by “integral”?
Values that are integers.
I actually looked that one up on Wikipedia. I feel kinda dumb for asking that.
Odd, I thought I had answered this before.
As I’ve mentioned several times, using your code above does technically “center” the document, however it looks all thin and brittle. The weird thing is that if I click the vertical scrollbar (not horizontal -only vertical) the brittleness goes away and everything looks perfect! I don’t even have to scroll! Just clicking the scrollbar does the trick! This has to be a bug of some sort. Why would centering the document cause everything to look weird and then everything looks fine as soon as you click on a vertical scrollbar?
Did you check on whether the X,Y,Width,Height values are integral, and whether GoView.DocPosition has integral values?
The nodes are just GoImages.
For example, did you try setting GoView.PixelOffsetMode to HighSpeed?
I had it set to HighQuality. I will try HighSpeed.
Didn’t make a difference.
Hello,
I am actually coming back to my own post.
Now that I am back working on that.
I tried the suggestion you gave me Walter and it works but I think I did not explain clearly what I was trying to do.
I don’t want to position the diagram in the center of the document which is what the code you suggested does.
I want the start of the diagram to be on the top of the document but in the center of the line.
Thanks again
Susan