Recent

Author Topic: ImageToGraph  (Read 2194 times)

kapibara

  • Hero Member
  • *****
  • Posts: 532
ImageToGraph
« on: December 14, 2013, 11:37:32 pm »
It would be convenient if ImageToGraph accepted the mouse X, Y coordinates. Then there is no need to create an intermediate variable just to call ImageToGraph.

I added a small overloaded function to the source as a test, maybe it could be part of TAChart?

Code: [Select]
function ImageToGraph(const AX, AY: Integer): TDoublePoint; overload;
..
function TChart.ImageToGraph(const AX, AY: Integer): TDoublePoint;
begin
  Result.X := XImageToGraph(AX);
  Result.Y := YImageToGraph(AY);
end;
« Last Edit: December 14, 2013, 11:39:37 pm by kapibara »
Lazarus trunk / fpc 3.0.4 / Debian 10 - 64 bit

wp

  • Hero Member
  • *****
  • Posts: 7923
Re: ImageToGraph
« Reply #1 on: December 15, 2013, 12:05:21 am »
But you can use the result of function Point (unit types) as input parameter for ImageToGraph:
Code: [Select]
var
  p: TDoublePoint;
  ...
  p := Chart1.ImageToGraph(Point(X,Y));
Mainly Lazarus trunk / fpc 3.2.0 / all 32-bit on Win-10, but many more...

kapibara

  • Hero Member
  • *****
  • Posts: 532
Re: ImageToGraph
« Reply #2 on: December 15, 2013, 08:04:13 pm »
Thats an ok solution! I use that now.
Lazarus trunk / fpc 3.0.4 / Debian 10 - 64 bit

 

TinyPortal © 2005-2018