Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/294.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
为什么在尝试使用GraphicsPath对象绘制字符串时会出现间隙?C#/.NET 3.5_C#_.net_Graphics - Fatal编程技术网

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

为什么在尝试使用GraphicsPath对象绘制字符串时会出现间隙?C#/.NET 3.5,c#,.net,graphics,C#,.net,Graphics,我试图在3D平面上绘制一些文本字符的路径,以便在3D打印机上打印。我得到了最后一条线应该画的地方。我还尝试使用AddRectangle命令绘制一个矩形。我以一句台词结束 有人知道我可能做错了什么吗 以下是我编写的代码片段: graphics_path1.AddRectangle(new Rectangle(50,50,50,50)); graphics_path1.AddString("Test text...", new FontFamily(workingFontObject.FONT.Na

我试图在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);
    }
大宗报价


如果不旋转,是否也会发生同样的情况?是的,我找到了文本(循环没有关闭)。至于矩形/正方形,我完全迷路了。你设置了剪辑吗?你能把直线/矩形向上移动一点来影响它吗?你在绘画活动中绘画吗?我不能影响矩形。我在用一个绘画活动,真奇怪!尝试添加另一个矩形(0,0,50,50)以查看它的位置。。!