tags:

views:

33

answers:

2

I've often noticed that gdi+ draws the same object (e.g. defined by some simple DrawLine calls) a bit different when drawing the object to a different location by using the Graphics.TranslateTransform(). It looks like some artifacts e.g. the ending of a 1 Pixel thin line appears "snapped off". And other pixel artifacts like that...

I'm also using ScaleTransform, but the same for all objects. Some artifacts disappear when changing the ScaleTransform slightly, but with the effect that they appear at another location/object, so no chance to eliminate all.

Any idea why this happens and how to avoid it ?

fritz

A: 

You tend to battle floating point round-off with the Graphics class, all transformations are calculated with single precision FP. You avoid it by scaling your model instead of letting Graphics do it.

Hans Passant
Scaling the model would be a lot a work. I guess I'll have to implement a Graphics class wrapper with my own transformation methods.
fritz