Board index » delphi » canvas.rectangle

canvas.rectangle

canvas.rectangle(0,0,20,20);
canvas.rextangle(20,0,40,20);

the left line of the second rectangle is not the right line of the first
rectangle. there is one pixel different (x direction).

just try it.

whats wrong here? please help me.

thanx-

 

Re:canvas.rectangle


Hi

    Nothing is wrong, this is the way windows GDI draws rectangles and also
other objects. Things are drawn from x1, y1 to x2 - 1, y2 - 1. You should
increase right and bottom coordinates by one to get what you want.

Tomaz

Quote
"Snafu News" <quan...@snafu.de> wrote in message

news:ah9lat$4n0$1@news.eusc.inter.net...
Quote
> canvas.rectangle(0,0,20,20);
> canvas.rextangle(20,0,40,20);

> the left line of the second rectangle is not the right line of the first
> rectangle. there is one pixel different (x direction).

> just try it.

> whats wrong here? please help me.

> thanx-

Other Threads