Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

LineTo(x,y) and extra parameter?

Posted on 1998-05-18
4
Medium Priority
?
294 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Integration Management Part 2
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Suggested Courses

926 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