Solved

LineTo(x,y) and extra parameter?

Posted on 1998-05-18
4
287 Views
Last Modified: 2010-04-06
What happen when I'm calling LineTo(x,y) function(procedure) inside my own function and it requir an extra parameter-> " DC". I have tried to made handle (handle:HDC) but compiler dont accept it. So What is real parameter? I use ellipse(x,y,x1,y1) when I want draw note and it make it without any broplem.

My function look like this:
function MakeBarline(var Imaage:TImage; var x,y:integer):integer;  {definition}
function MakeBarline(var Imaage:TImage; var movX,movY:integer) {declaration}
var x,y :integer;
begin
   with image.canvas do
   Pen.color := clBlack;
   Pen.width := 2;
   MoveTo(x,y);
   LineTo(movX,movY) {this don't work};

end;
0
Comment
Question by:hanmannis
  • 2
4 Comments
 

Author Comment

by:hanmannis
ID: 1346052
Edited text of question
0
 
LVL 5

Accepted Solution

by:
JimBob091197 earned 100 total points
ID: 1346053
Hi

LineTo should work if you do this:

with image.Canvas do
begin
...
end;

You need the begin/end.  Without the begin & end you're not calling Canvas.LineTo but the API call instead.

If you want to call the API call, use:
LineTo(Image.Canvas.Handle, x, y);

Cheers,
JB
0
 
LVL 4

Expert Comment

by:d003303
ID: 1346054
...and anytime you want the compiler to use API functions instead of methods, prefix the function with the unit's name (e.g. Windows.LineTo(DC, x, y);)

Slash/d003303
0
 

Author Comment

by:hanmannis
ID: 1346055
Thank you for your answer but I don't get it work or perhaps there is som other "bug" in my application.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now