From: Sascha on
When drawing onto the client area what is the precision available. Is
the precision 1 pixel unit or maybe 0.1 pixel unit or maybe (I hope)
0,01 pixel unit

For example;

I want to draw a Rectangle that starts extactly at the pixel position
(1.3,10). Will the rectangle be drawn exactly in that position or will
it be drawn at (1,10) by the computer.

Example = Rectangle(1.3, 10, 200, 200);
From: Arny on


On 05.06.2010 07:58, Sascha wrote:
> When drawing onto the client area what is the precision available. Is
> the precision 1 pixel unit or maybe 0.1 pixel unit or maybe (I hope)
> 0,01 pixel unit
>
> For example;
>
> I want to draw a Rectangle that starts extactly at the pixel position
> (1.3,10). Will the rectangle be drawn exactly in that position or will
> it be drawn at (1,10) by the computer.
>
> Example = Rectangle(1.3, 10, 200, 200);

The smallest physical unit is always 1 pixel, no possible way around
that. What the smallest logical unit is, depends on the drawing system.

For GDI, the logical mapping mode is set by SetMapMode().
GDI+ has improved ways of dealing with this, a quick search resulted in
this: http://msdn.microsoft.com/en-us/library/ms536399%28VS.85%29.aspx

- RaZ
From: Jackie on
Sascha wrote:
> When drawing onto the client area what is the precision available. Is
> the precision 1 pixel unit or maybe 0.1 pixel unit or maybe (I hope)
> 0,01 pixel unit
>
> For example;
>
> I want to draw a Rectangle that starts extactly at the pixel position
> (1.3,10). Will the rectangle be drawn exactly in that position or will
> it be drawn at (1,10) by the computer.
>
> Example = Rectangle(1.3, 10, 200, 200);

Unfortunately, the smallest point is a pixel with a certain physical
size. The display can't render something on just half of this point, so
the position on the display would be 1x10. If you have anti-aliasing
enabled, it may look a bit like it's on 1.3 rather than 1 (but more
blurred). It's not the display doing this though, but rather .NET trying
to make it look so.

--
Regards,
Jackie
From: Jackie on
Jackie wrote:
> Sascha wrote:
>> When drawing onto the client area what is the precision available. Is
>> the precision 1 pixel unit or maybe 0.1 pixel unit or maybe (I hope)
>> 0,01 pixel unit
>>
>> For example;
>>
>> I want to draw a Rectangle that starts extactly at the pixel position
>> (1.3,10). Will the rectangle be drawn exactly in that position or will
>> it be drawn at (1,10) by the computer.
>>
>> Example = Rectangle(1.3, 10, 200, 200);
>
> Unfortunately, the smallest point is a pixel with a certain physical
> size. The display can't render something on just half of this point, so
> the position on the display would be 1x10. If you have anti-aliasing
> enabled, it may look a bit like it's on 1.3 rather than 1 (but more
> blurred). It's not the display doing this though, but rather .NET trying
> to make it look so.
>

Sorry, I thought this was posted in the C#/.NET group I'm subscribing to.
Just saw Point and Rectangle which I am used to from .NET.

--
Regards,
Jackie