Article | 60001723 |
Type | HowTo |
Product | Engine |
Version | 6 |
Date Added | 6/8/2012 |
Submitted by | Makarounis Giannis |
Keywords |
private void button6_Click(object sender, EventArgs e) { vdDocument doc = vfc.BaseControl.ActiveDocument; doc.Open(@"C:\Users\Administrator\Desktop\DWG & More\test.vdml"); //this drawing conatins an Image and a polyline on it that defines the clip boundary doc.CommandAction.Zoom("E",0,0); //The curve that clips the image vdCurve curve = doc.Model.Entities.Last as vdCurve; //The vdImage Object vdImage img = doc.Model.Entities[0] as vdImage; double mHeight = img.Height; double imagescale = mHeight / (double)img.ImageDefinition.Height; gPoints pts = curve.GetSamplePoints(0, 0); curve.ECSMatrix.Transform(pts); img.ECSMatrix.GetInvertion().Transform(pts); Matrix mat = new Matrix(); mat.ScaleMatrix(imagescale, -imagescale, 1.0d); mat.TranslateMatrix(0.0d, mHeight, 0.0d); mat.Invert(); mat.Transform(pts); img.ClipBoundary = pts; img.Update(); }