What is PixelOffsetMode?

MSDN does not explain this to those who do not yet know what it is. I searched, but found that it sets the rendering quality. But how? What, for example, does

Indicates that the pixels are offset by -5 units, both horizontally and vertically, for high-speed smoothing. ( MSDN )

mean?

+6
source share
1 answer

During drawing, you use double values ​​to represent your logical graphical objects, such as lines, circles, etc.

But during rendering, the framework should convert your logical counterparts to physical integer pixels.

During this process structure, some kind of rounding, anti-aliasing is used .

Thus, during smoothing, you can have different algorithms that will give different results; Usually they all need to calculate the β€œdistance” between the logical pixel and its physical coordinates, so the different modes of this setting affect the accuracy of this distance.

Here is a good example of different modes (mostly different shades of gray - different distances):

enter image description here

NOTE: the .net framework also has settings for the actual smoothing ( SmoothingMode ), which basically means how we smooth, and not how we calculate the distance within the country

+5
source

Source: https://habr.com/ru/post/982293/


All Articles