Drawing and moving the image
Moderators: SDS, support, admin
Drawing and moving the image
Hello,
I'd need to implement the following task:
A User draws on an large image (red). The Image is zoomed (black) and the user wants to draw a polyline(blue) which is started inside the clip rectangle with the given zoom, but the end is outside the visible area.
The user needs to move the clip rectangle but the line should still exist in "edit mode". At the moment the line is removed when the zoom changes.
thank you for your help.
Roman

I'd need to implement the following task:
A User draws on an large image (red). The Image is zoomed (black) and the user wants to draw a polyline(blue) which is started inside the clip rectangle with the given zoom, but the end is outside the visible area.
The user needs to move the clip rectangle but the line should still exist in "edit mode". At the moment the line is removed when the zoom changes.
thank you for your help.
Roman

Re: Drawing and moving the image
Hello Roman,
The drawing tools are implemented through the EntitiesCreator class which is defined under CADImport.Professional namespace. You should pay attention to the EntitiesCreator.Disable method, it terminates the usage of a drawing tool and removes the drawn object. It seems that you call this method in your zooming in/out routines.
Mikhail
The drawing tools are implemented through the EntitiesCreator class which is defined under CADImport.Professional namespace. You should pay attention to the EntitiesCreator.Disable method, it terminates the usage of a drawing tool and removes the drawn object. It seems that you call this method in your zooming in/out routines.
Mikhail
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support
Re: Drawing and moving the image
Hello Mikhail,
I didn't find the EntitiesCreator.Disable method where you mentioned, but after some research inside the CADEditor I found the code I postet at the bottom of this post (taken form CadEditorDemo)
Inside the method below i found this part.
It prevents moving the drawing when CreateNewEntity is true. Simply removing the (!this.CreateNewEntity) didn't work because the traces were drawn not where the traces should be...
Thank you for your help,
Roman
I didn't find the EntitiesCreator.Disable method where you mentioned, but after some research inside the CADEditor I found the code I postet at the bottom of this post (taken form CadEditorDemo)
Inside the method below i found this part.
Code: Select all
if ((!this.clipRectangle.Enabled) && (!this.CreateNewEntity))
{
LeftImagePosition -= (cX - e.X);
TopImagePosition -= (cY - e.Y);
cadPictBox.Invalidate();
}
Thank you for your help,
Roman
Code: Select all
private void cadPictBox_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
{
if (cadImage == null)
return;
if (!this.cadPictBox.Focused)
{
this.cadPictBox.Focus();
this.cadPictBox.Invalidate();
}
if ((!stopSnap) && (this.cadPictBox.ClientRectangle.Contains(e.X, e.Y)))
{
RectangleF tmpRect = ImageRectangleF;
cadImage.DrawSnapTrace(e.X, e.Y, this.cadPictBox, tmpRect);
}
else
{
this.cadImage.RefreshSnapTrace(this.cadPictBox);
this.stopSnap = false;
}
if (detMouseDown)
{
if (e.Button != MouseButtons.Right)
{
if (ChangeEntityOnMouseMove(new Point(e.X, e.Y)))
return;
}
if ((!this.clipRectangle.Enabled) && (!this.CreateNewEntity))
{
LeftImagePosition -= (cX - e.X);
TopImagePosition -= (cY - e.Y);
cadPictBox.Invalidate();
}
cX = e.X;
cY = e.Y;
}
PreviousPosition = new PointF(e.X, e.Y);
DPoint vPt = GetRealPoint(e.X, e.Y, true);
stBar.Panels[2].Text = string.Format("{0} : {1} : 0", vPt.X, vPt.Y);
}
Re: Drawing and moving the image
Hello,
still no answer?
still no answer?