by Khyati » 08 Apr 2011, 08:33
Thanks!
I tried with following code, but it doesn't give exact value of co-ordinates of the position, where my mouse clicks.
<<<<
method MainForm.CadEditorCtrl_PictureBox_MouseDown(sender: System.Object; e: System.Windows.Forms.MouseEventArgs);
var
i,j: Integer;
Pos_CAD : System.Drawing.Point; /// recalculated co-ordinates
Pos_Win : CADImport.DPoint; /// co-ordinates, got from mouseEventhandler
begin
entPt[cnt] := new CADImport.CADCircle(); /// draw a small circle
Pos_Win := new CADImport.DPoint(e.X, e.Y, 0);
Pos_CAD := new System.Drawing.Point;
Pos_CAD := cadEditorControl1.Image.GetPoint(Pos_Win);
entPt[cnt].Point := new CADImport.DPoint(Pos_CAD.X, Pos_CAD.Y, 0);
entPt[cnt].Radius := 100;
entPt[cnt].Color := Color.Aqua;
entPt[cnt].Loaded(cadEditorControl1.Image.Converter);
cadEditorControl1.Image.Converter.OnCreate(entPt[cnt]);
cadEditorControl1.Image.CurrentLayout.AddEntity(entPt[cnt]);
cadEditorControl1.Invalidate();
end;
>>>>
I want to draw a circle where user presses mouse click and display it, at the same time.
For that, i want mouse-click's co-ordinates, which are shown on status bar panel of cad editor control.