color of CANVAS.PIXELS[X,Y]
Posted: 09 Oct 2015, 14:19
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