/// <summary> /// Creates a thumbnail of the template shape. /// </summary> /// <param name="size">Size of tumbnail in pixels</param> /// <param name="margin">Size of margin around shape in pixels</param> /// <param name="transparentColor">Specifies a color that will be rendered transparent.</param> public Image CreateThumbnail(int size, int margin, Color transparentColor) { Image bmp = new Bitmap(size, size); using (Shape shapeClone = Shape.Clone()) shapeClone.DrawThumbnail(bmp, margin, transparentColor); return(bmp); }
private static Shape DoCloneShape(Shape shape, bool cloneModelObject) { Shape result = shape.Clone(); if (cloneModelObject) { DoCloneShapeModelObject(result); } else { // ToDo: For now, we delete assigned model objects. Resolve this issue later ("Cannot delete modelObject if there is a copied shape referencing the model object") if (result.ModelObject != null) { result.ModelObject = null; } } return(result); }