drawing rectangles on dwg image
Moderators: SDS, support, admin
drawing rectangles on dwg image
I am trying to load a dwg image, draw rectangles on it, and save it with cadimport.dll in asp.net.
cadImage = CADImage.CreateImageByExtension(imagePath);
cadImage.LoadFromFile(imagePath);
cadImage.Draw(graphics, rectangleF); << is not working for me.
I need to be able to draw the rectangles on an existing cadimage. Perhaps I am way off, I need to be pointed in the right direction. Please help.
Thank you.
cadImage = CADImage.CreateImageByExtension(imagePath);
cadImage.LoadFromFile(imagePath);
cadImage.Draw(graphics, rectangleF); << is not working for me.
I need to be able to draw the rectangles on an existing cadimage. Perhaps I am way off, I need to be pointed in the right direction. Please help.
Thank you.
Re: drawing rectangles on dwg image
Hello!
We recommend to use the following code:
Sergey.
We recommend to use the following code:
Code: Select all
private void btnAddPolyline_Click(object sender, System.EventArgs e)
{
if(this.cadImage == null)
{
this.cadImage = new CADImage();
this.cadImage.InitialNewImage();
this.cadImage.UseBufMetafile = false;
}
else
this.cadImage.UseBufMetafile = false;
CADPolyLine entPoly = new CADPolyLine();
entPoly.Closed = true;
entPoly.Color = CADConst.clNone;
CADVertex entVertex = new CADVertex();
entPoly.AddEntity(entVertex);
entVertex.Point = new DPoint(0,0,0);
entVertex = new CADVertex();
entPoly.AddEntity(entVertex);
entVertex.Point = new DPoint(0,100,0);
entVertex = new CADVertex();
entPoly.AddEntity(entVertex);
entVertex.Point = new DPoint(200,100,0);
entVertex = new CADVertex();
entPoly.AddEntity(entVertex);
entVertex.Point = new DPoint(200,0,0);
this.cadImage.Converter.OnCreate(entPoly);
this.cadImage.Converter.Loads(entPoly);
this.cadImage.Converter.Entities.Add(entPoly);
this.cadImage.GetExtents();
this.DoResize();
SaveAsDXF(@"c:\Rectangle.dxf");
}
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support