color of CANVAS.PIXELS[X,Y]
Moderators: SDS, support, admin
-
- Posts: 4
- Joined: 04 Oct 2010, 19:56
color of CANVAS.PIXELS[X,Y]
Alexander ,
I try to find the color of the pixel when i use the mouse down on the sgPaintBox ( property sgPaintBox: TsgDrawingNavigator read FsgPaintBox); ( Exemple Viewer )
The sgPaintBox is load with an AUTOCAD File
I Use this code :
procedure TFormViewPlan.imgFrameMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
var vPt: TFPoint;
vUnits : String;
acolor : Tcolor ;
Begin
vPt := sgPaintBox.GetDrawingCoords(X, Y, vUnits);
aColor := sgPaintBox.Canvas.Pixels
[Round(Vpt.X),Round(sgPaintBox.Picture.Height-Vpt.Y)] ;
end;
The color is Black
Where is my problem ?
Thank you
Jacques
I try to find the color of the pixel when i use the mouse down on the sgPaintBox ( property sgPaintBox: TsgDrawingNavigator read FsgPaintBox); ( Exemple Viewer )
The sgPaintBox is load with an AUTOCAD File
I Use this code :
procedure TFormViewPlan.imgFrameMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
var vPt: TFPoint;
vUnits : String;
acolor : Tcolor ;
Begin
vPt := sgPaintBox.GetDrawingCoords(X, Y, vUnits);
aColor := sgPaintBox.Canvas.Pixels
[Round(Vpt.X),Round(sgPaintBox.Picture.Height-Vpt.Y)] ;
end;
The color is Black
Where is my problem ?
Thank you
Jacques
Re: color of CANVAS.PIXELS[X,Y]
Hello Jacques,
The TsgDrawingNavigator.GetDrawingCoords function returns drawing coordinates in CAD units (TFPoint), not the pixel coordinates.
Mikhail
The TsgDrawingNavigator.GetDrawingCoords function returns drawing coordinates in CAD units (TFPoint), not the pixel coordinates.
Mikhail
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support
-
- Posts: 4
- Joined: 04 Oct 2010, 19:56
Re: color of CANVAS.PIXELS[X,Y]
Thank you Mikhail ,
Ok ,
How can i found the color of the pixel when i use the mouse down on a TsgDrawingNavigator ?
thank you
Jacques
Ok ,
How can i found the color of the pixel when i use the mouse down on a TsgDrawingNavigator ?
thank you
Jacques