Solved

LineTo(x,y) and extra parameter?

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
APK file name 7 64
Strange message in Delphi 10 Seattle 1 465
Multiple image collision 13 46
Delphi: Connect to running MS Outlook 4 32
A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

747 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

12 Experts available now in Live!

Get 1:1 Help Now