public override string EmitGDICode(string graphicsName, GDIGenerationTool helper) { Rectangle rect = new Rectangle(Location.X - helper.AreaBounds.X, Location.Y - helper.AreaBounds.Y, Size.Width, Size.Height); string str = helper.GeneratePaintToolInit(this) + generatePointArray(rect) + generateTypeArray() + "ScalePoints(ref " + this.Name + "Points, (float)shapeBoundsNew.Width / shapeBoundsOld.Width,\r\n" + "(float)shapeBoundsNew.Height / shapeBoundsOld.Height);\r\n//\r\n" + "//Create the path\r\npath = new GraphicsPath(" + this.Name + "Points," + this.Name + "Types);\r\n" + "path.CloseAllFigures();\r\n"; if (painter.PaintFill) { str += graphicsName + ".FillPath(" + this.Name + "Brush, path);\r\n"; } if (painter.PaintBorder) { str += graphicsName + ".DrawPath(" + this.Name + "Pen, path);\r\n"; } str += helper.GeneratePaintToolCleanup(this); helper.GenerateScalePoints(); return(str); }
public override string EmitGDICode(string graphicsName, GDIGenerationTool helper) { string str = "//Polygon: " + this.Name + "\r\n" + helper.GeneratePaintToolInit(this) + generatePointArray(helper) + generateTypeArray() + "//Create the path\r\npath = new GraphicsPath(" + this.Name + "Points," + this.Name + "Types);\r\n" + "path.CloseAllFigures();\r\n" + "//Paint the shape\r\n"; if (painter.PaintFill) { str += graphicsName + ".FillPath(" + this.Name + "Brush, path );\r\n"; } if (painter.PaintBorder) { str += graphicsName + ".DrawPath(" + this.Name + "Pen, path);\r\n"; } str += helper.GeneratePaintToolCleanup(this); return(str); }
public override string EmitGDICode(string graphicsName, GDIGenerationTool helper) { Rectangle rect = new Rectangle(Location.X - helper.AreaBounds.X, Location.Y - helper.AreaBounds.Y, Size.Width, Size.Height); string str = helper.GeneratePaintToolInit(this) + generatePointArray(rect) + generateTypeArray() + "ScalePoints(ref " + this.Name + "Points, (float)shapeBoundsNew.Width / shapeBoundsOld.Width,\r\n" + "(float)shapeBoundsNew.Height / shapeBoundsOld.Height);\r\n//\r\n" + "//Create the path\r\npath = new GraphicsPath(" + this.Name + "Points," + this.Name + "Types);\r\n" + "path.CloseAllFigures();\r\n"; if (painter.PaintFill) str += graphicsName + ".FillPath(" + this.Name + "Brush, path);\r\n"; if (painter.PaintBorder) str += graphicsName + ".DrawPath(" + this.Name + "Pen, path);\r\n"; str += helper.GeneratePaintToolCleanup(this); helper.GenerateScalePoints(); return str; }
public override string EmitGDICode(string graphicsName, GDIGenerationTool helper) { string str = "//Line: " + this.Name + "\r\n" + helper.GeneratePaintToolInit(this) + generatePointArray(helper) + "//Paint the shape\r\n"; str += graphicsName + ".DrawCurve(" + this.Name + "Pen," + this.Name + "Points);\r\n"; str += helper.GeneratePaintToolCleanup(this); return(str); }
public override string EmitGDICode(string graphicsName, GDIGenerationTool helper) { string str = "//Circle: " + this.Name + "\r\n" + helper.GeneratePaintToolInit(this) + "//Paint the shape\r\n"; if (painter.PaintFill) str += graphicsName + ".FillEllipse("+this.Name+"Brush, shapeBoundsNew);\r\n"; if (painter.PaintBorder) str += graphicsName + ".DrawEllipse("+this.Name+"Pen, Rectangle.Round(shapeBoundsNew));\r\n"; str += helper.GeneratePaintToolCleanup(this); return str; }
public override string EmitGDICode(string graphicsName, GDIGenerationTool helper) { string str = "//Circle: " + this.Name + "\r\n" + helper.GeneratePaintToolInit(this) + "//Paint the shape\r\n"; if (painter.PaintFill) { str += graphicsName + ".FillEllipse(" + this.Name + "Brush, shapeBoundsNew);\r\n"; } if (painter.PaintBorder) { str += graphicsName + ".DrawEllipse(" + this.Name + "Pen, Rectangle.Round(shapeBoundsNew));\r\n"; } str += helper.GeneratePaintToolCleanup(this); return(str); }
public override string EmitGDICode(string graphicsName, GDIGenerationTool helper) { string str = "//Polygon: " + this.Name + "\r\n" + helper.GeneratePaintToolInit(this) + generatePointArray(helper)+ generateTypeArray() + "//Create the path\r\npath = new GraphicsPath("+this.Name + "Points,"+this.Name + "Types);\r\n"+ "path.CloseAllFigures();\r\n"+ "//Paint the shape\r\n"; if (painter.PaintFill) str += graphicsName + ".FillPath(" + this.Name + "Brush, path );\r\n"; if (painter.PaintBorder) str += graphicsName + ".DrawPath(" + this.Name + "Pen, path);\r\n"; str += helper.GeneratePaintToolCleanup(this); return str; }
public override string EmitGDICode(string graphicsName, GDIGenerationTool helper) { bool blnScaleText = (bool)GdiProperties.GetValue(SCALE_TEXT); bool blnEditText = (bool)GdiProperties.GetValue(EDIT_TEXT); string strText = blnEditText ? "dText[eShapeText." + this.Name + "]" : helper.FormatText(text); string strBounds = blnScaleText ? "shapeBoundsOld" : "shapeBoundsNew"; string str = "//Text: " + this.Name + "\r\n"; if (painter.PaintWithPath) { str += helper.SetShapeBounds(this); } else { str += helper.GeneratePaintToolInit(this); } str += "Font " + this.Name + "Font = new Font(\"" + font.FontFamily.Name + "\", " + font.Size.ToString() + "f * (" + Size.Width + "f / (float)shapeBoundsOld.Width), (FontStyle)" + (int)font.Style + ");\r\n" + "StringFormat " + this.Name + "Format = new StringFormat();\r\n" + this.Name + "Format.Alignment = (StringAlignment)" + (int)format.Alignment + ";\r\n"; if (blnScaleText) { str += "//Will apply the scaling factors to the graphics object\r\n" + graphicsName + ".ScaleTransform(scale.Width, scale.Height);\r\n"; } if (painter.PaintWithPath) { str += "path = new GraphicsPath();\r\n" + "path.AddString(" + strText + ", " + this.Name + "Font.FontFamily ,(int)" + this.Name + "Font.Style," + this.Name + "Font.Size,\r\n" + strBounds + "," + this.Name + "Format);\r\n" + helper.GeneratePaintToolInit(this, "path.GetBounds()", false) + "//Paint the text\r\n"; if (painter.PaintFill) { str += graphicsName + ".FillPath(" + this.Name + "Brush, path);\r\n"; } if (painter.PaintBorder) { str += graphicsName + ".DrawPath(" + this.Name + "Pen, path);\r\n"; } } else { str += graphicsName + ".DrawString(" + strText + ", " + this.Name + "Font, " + this.Name + "Brush, " + strBounds + ", " + this.Name + "Format);\r\n"; } if (blnScaleText) { str += graphicsName + ".ResetTransform();\r\n"; } str += "//Cleanup Text objects\r\n" + this.Name + "Font.Dispose();\r\n" + this.Name + "Format.Dispose();\r\n" + helper.GeneratePaintToolCleanup(this); return(str); }
public override string EmitGDICode(string graphicsName, GDIGenerationTool helper) { bool blnScaleText = (bool)GdiProperties.GetValue(SCALE_TEXT); bool blnEditText = (bool)GdiProperties.GetValue(EDIT_TEXT); string strText = blnEditText ? "dText[eShapeText." + this.Name + "]" : helper.FormatText(text); string strBounds = blnScaleText ? "shapeBoundsOld" : "shapeBoundsNew"; string str = "//Text: " + this.Name + "\r\n"; if (painter.PaintWithPath) str += helper.SetShapeBounds(this); else str += helper.GeneratePaintToolInit(this); str += "Font " + this.Name + "Font = new Font(\"" + font.FontFamily.Name + "\", " + font.Size.ToString() + "f * (" + Size.Width + "f / (float)shapeBoundsOld.Width), (FontStyle)" + (int)font.Style + ");\r\n" + "StringFormat " + this.Name + "Format = new StringFormat();\r\n" + this.Name + "Format.Alignment = (StringAlignment)" + (int)format.Alignment + ";\r\n"; if (blnScaleText) str += "//Will apply the scaling factors to the graphics object\r\n"+ graphicsName + ".ScaleTransform(scale.Width, scale.Height);\r\n"; if (painter.PaintWithPath) { str += "path = new GraphicsPath();\r\n" + "path.AddString(" +strText + ", " + this.Name + "Font.FontFamily ,(int)" + this.Name + "Font.Style," + this.Name + "Font.Size,\r\n" + strBounds+ "," + this.Name + "Format);\r\n" + helper.GeneratePaintToolInit(this, "path.GetBounds()",false) + "//Paint the text\r\n"; if (painter.PaintFill) str += graphicsName + ".FillPath(" + this.Name + "Brush, path);\r\n"; if (painter.PaintBorder) str += graphicsName + ".DrawPath(" + this.Name + "Pen, path);\r\n"; } else { str += graphicsName + ".DrawString("+ strText +", " + this.Name + "Font, " + this.Name + "Brush, "+ strBounds +", " + this.Name + "Format);\r\n"; } if (blnScaleText) str += graphicsName + ".ResetTransform();\r\n"; str += "//Cleanup Text objects\r\n"+ this.Name + "Font.Dispose();\r\n"+ this.Name +"Format.Dispose();\r\n"+ helper.GeneratePaintToolCleanup(this); return str; }
public override string EmitGDICode(string graphicsName, GDIGenerationTool helper) { string str = "//Line: " + this.Name + "\r\n" + helper.GeneratePaintToolInit(this) + generatePointArray(helper) + "//Paint the shape\r\n"; str += graphicsName + ".DrawCurve(" + this.Name + "Pen," + this.Name + "Points);\r\n"; str += helper.GeneratePaintToolCleanup(this); return str; }