Solved

LineTo(x,y) and extra parameter?

Posted on 1998-05-18
4
289 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Delphi 2 68
creating threads in delphi 1 130
Tviruailstringtree sort multi columns on header click 1 74
Base1 Encode/Decode 3 81
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used.

791 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