Article View: borland.public.cppbuilder.nativeapi
Article #14925Problem drawing lines crossing image boundary
From: Ivan Johansen
Date: Sun, 27 Jul 2003 22:27
Date: Sun, 27 Jul 2003 22:27
37 lines
2477 bytes
2477 bytes
I am having trouble drawing lines that goes outside the image under
Windows 98. Even though I use TCanvas it looks like a winapi problem.
I just create a new application with a TImage on the form and add the
following code to the form constructor:
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
Image1->Canvas->Pen->Width = 2;
Image1->Canvas->MoveTo(316, 242);
Image1->Canvas->LineTo(317, -16181);
}
This should show a vertical line, but instead it draws two lines: one
from (316,242) to (105,242) and one from (105,242) to approximate
(317,-16181).
It only happens on Windows 98 and not on Windows 2000. I would like to
know if anyone can reproduce the problem or if it is caused by my video
driver? Does anyone know of any limitations in this area. The only
limitation mentioned in the Windows SDK is that Windows 9x uses 16 bit
numbers.
The following independent changes will correct the problem:
1. The width of the pen is changed to 1.
2. The x-coordinates are equal, for example both may be 316.
3. The second y-coordinate is changed to -16144 or higher.
4. The first y-coordinate is changed to 205 or below.
It looks like the problem occurs when the distance between the two
points are larger than 16386, one of the points are negative and the pen
width is more than 1.
I hope someone can tell me why this is happening or that it is a driver
problem.
Ivan Johansen
Technical Details
Message-ID:
<3f245110@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,c8c44e98956d82e9,start X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-07-27 15:25:14 PST Date: Mon, 28 Jul 2003 00:27:47 +0200 From: Ivan Johansen <NG2@Padowan.dk> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.nativeapi Subject: Problem drawing lines crossing image boundary Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 62.66.130.38 Message-ID: <3f245110@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1059344656 62.66.130.38 (27 Jul 2003 15:24:16 -0700) Lines: 38 Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail