// Create an image graphics object ---- an line object created from an image import ImageLineSymbol CreateLineImageObject(OcadObject obj, ImageSymDef symdef) { if (obj.coords == null || obj.coords.Length < 2) return null; SymPath path = CreateSymPath(obj.coords); LineStyle lineStyle = ImportLineStyle(obj.DiamFlags); return new ImageLineSymbol(symdef, path, ColorFromCompressedCMYK(obj.Col), ToWorldDimensions(obj.LineWidth), lineStyle); }
// Create an area iamge object ---- an area object created from an image import ImageAreaSymbol CreateAreaImageObject(OcadObject obj, ImageSymDef symdef) { SymPathWithHoles path = CreateAreaSymPath(obj.coords); return new ImageAreaSymbol(symdef, path, ColorFromCompressedCMYK(obj.Col)); }
public ImageLineSymbol(ImageSymDef def, SymPath path, Color lineColor, float thickness, LineStyle lineStyle) { this.def = def; this.path = path; this.lineColor = lineColor; this.thickness = thickness; this.lineStyle = lineStyle; boundingBox = path.BoundingBox; boundingBox.Inflate(thickness / 2, thickness / 2); }
// Get the one and only image symdef for this map. Used for iamge objects -- created with OCAD image import command. ImageSymDef GetImageSymDef() { if (imageSymDef == null) { imageSymDef = new ImageSymDef(); map.AddSymdef(imageSymDef); } return imageSymDef; }
public ImageAreaSymbol(ImageSymDef def, SymPathWithHoles path, Color fillColor) { this.def = def; this.path = path; this.fillColor = fillColor; boundingBox = path.BoundingBox; }