Solved

LineTo(x,y) and extra parameter?

Posted on 1998-05-18
4
291 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
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…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

734 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