在尝试使用GraphicsPath对象绘制字符串时,为什么会出现间隙? C#/。NET 3.5

时间:2015-03-06 15:49:19

标签: c# .net graphics

我正在尝试在3D平面上绘制一些文本字符的路径,以便在3D打印机上打印。我得到了应该画出最后一行的空白。我还尝试使用AddRectangle命令绘制一个矩形。我最终得到了一条线。

有谁知道我可能做错了什么?

以下是显示我所写内容的代码段:

graphics_path1.AddRectangle(new Rectangle(50,50,50,50));
graphics_path1.AddString("Test text...", new FontFamily(workingFontObject.FONT.Name), (int)workingFontObject.FONT.Style, workingFontObject.FONT.Size, new Point(8, 2), StringFormat.GenericTypographic);

RotateScaleOffsetGraphicsPath(graphics_path1, rotateAngle, RotateCenter, magnification, xyOffset);



    private void RotateScaleOffsetGraphicsPath(GraphicsPath workingGraphicsPath, float RotateAngle, PointF RotateCenter, float Magnification, PointF ROIOffset)
    {
        float Invert = (1.0f); //invert without any other modifications
        Matrix mm1 = new Matrix();  //Create a new matrix for transformations
        PointF bedCenter = new PointF(bedWidth/2,bedDepth/2);

        //mm1.RotateAt(RotateAngle, bedCenter, MatrixOrder.Append);//Rotate
        mm1.Translate(Invert*ROIOffset.X, Invert* ROIOffset.Y, MatrixOrder.Append);//set roi offset
        mm1.Scale(Magnification, Magnification, MatrixOrder.Append);//magnify, the 2 magnifications are x and y and can actually be different for a skewed growth

        //apply the transformation matrix on the graphical path
        workingGraphicsPath.Transform(mm1);
    }
  

块引用

Photo of gaps showing

enter image description here

0 个答案:

没有答案