小编Ter*_*Dog的帖子

STL 文件转换为可读文本文件

我现在正在研究 3D 模型(stl 文件等)以及它是如何从头开始制作的。我需要使用什么软件才能查看 stl 文件中的内容,如下所示:

solid dart
    facet normal 0.00000E+000 0.00000E+000 -1.00000E+000
        outer loop
            vertex 3.10000E+001 4.15500E+001 1.00000E+000
            vertex 3.10000E+001 1.00000E+001 1.00000E+000
            vertex 1.00000E+000 2.50000E-001 1.00000E+000
        endloop
    endfacet
endsolid dart
Run Code Online (Sandbox Code Playgroud)

我一直在寻找这类软件,但到目前为止,还没有找到。

3d stl-format

8
推荐指数
1
解决办法
1万
查看次数

使用 GraphicsPath 正确绘制文本

如下图所示,PictureBox 上的文本与 TextBox 中的文本不同。如果我使用它可以正常工作,Graphics.DrawString()但是当我使用图形路径时,它会截断并且不显示整个文本。你认为我的代码有什么问题?

在此处输入图片说明

这是我的代码:

public LayerClass DrawString(LayerClass.Type _text, string text, RectangleF rect, Font _fontStyle, PaintEventArgs e)
{
    using (StringFormat string_format = new StringFormat())
    {
        rect.Size = e.Graphics.MeasureString(text, _fontStyle);
        rect.Location = new PointF(Shape.center.X - (rect.Width / 2), Shape.center.Y - (rect.Height / 2));
        if(isOutlinedOrSolid)
        {
            using (GraphicsPath path = new GraphicsPath())
            {
                path.AddString(text, _fontStyle.FontFamily, (int)_fontStyle.Style, rect.Size.Height, rect, string_format);
                e.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
                e.Graphics.CompositingQuality = CompositingQuality.HighQuality;
                e.Graphics.CompositingMode = CompositingMode.SourceOver;
                e.Graphics.DrawPath(new Pen(Color.Red, 1), path);
            }
        }
        else
        {
            e.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
            e.Graphics.CompositingQuality …
Run Code Online (Sandbox Code Playgroud)

.net c# graphics gdi+ winforms

4
推荐指数
2
解决办法
2958
查看次数

翻转绘制文本/字符串的GraphicsPath

我在我的Text Class中有这个方法,我似乎无法翻转整个文本.
我正在使用Matrix来转换GraphicsPath用于绘制字符串的内容.

以下是我使用@ Jimi答案的代码:

    public LayerClass DrawString(LayerClass.Type _text, string text, RectangleF rect, Font _fontStyle, Brush brush, float angle, PaintEventArgs e)
    {
        using (StringFormat string_format = new StringFormat())
        {
            SizeF stringSize = e.Graphics.MeasureString(text, _fontStyle);
            rect.Location = new PointF(Shape.center.X - (rect.Width / 2), Shape.center.Y - (rect.Height / 2));
            GraphicsContainer gc = e.Graphics.BeginContainer();
            e.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
            e.Graphics.CompositingQuality = CompositingQuality.HighQuality;
            //e.Graphics.DrawRectangle(Pens.Red, Rectangle.Round(rect));

            RectangleF r = new RectangleF(rect.Location, rect.Size);
            GraphicsPath path = new GraphicsPath();
            if (text == "" || text == " …
Run Code Online (Sandbox Code Playgroud)

c# text gdi+ winforms graphicspath

3
推荐指数
1
解决办法
387
查看次数

从RC文件访问字符串?

我有此.rc文件,其中包含用于exe文件详细信息的版本,说明等。

如何获得在代码内使用的值?例如,我要获取ProductName

IDI_ICON1   ICON    DISCARDABLE "abc-logo.ico"

#if defined(UNDER_CE)
#include <winbase.h>
#else
#include <winver.h>
#endif

VS_VERSION_INFO VERSIONINFO
FILEVERSION 9, 9, 9, 9
PRODUCTVERSION 12, 01, 15, 1
FILEFLAGSMASK 0x3fL
FILEFLAGS 0
FILEOS VOS_NT_WINDOWS32
FILETYPE VFT_APP
FILESUBTYPE VFT2_UNKNOWN

BEGIN
    BLOCK "VarFileInfo"
    BEGIN
        VALUE "Translation", 0x0404, 1200
    END
    BLOCK "StringFileInfo"
    BEGIN
        BLOCK "040404b0"
        BEGIN
            VALUE "CompanyName", "Company A\0"
            VALUE "FileDescription", "Software A\0"
            VALUE "FileVersion", "1.0.0.0\0"
            VALUE "InternalName", "SoftwareX\0"
            VALUE "LegalCopyright", "Copyright (C) Software Inc. All Rights Reserved\0"
            VALUE "OriginalFilename", …
Run Code Online (Sandbox Code Playgroud)

c++ winapi fileversioninfo

2
推荐指数
1
解决办法
56
查看次数

foreach声明无法运作?

var maxHeight = draw._shapes.Aggregate((agg, next) =>next.height > agg.height ? next : agg);
if (draw._shapes.Count == 0)
    trackBar_Size.Maximum = 484;
else
{
    foreach (float heights in maxHeight)
    {
        if (heights < 412)
        {
            trackBar_Size.Maximum = 484;
        }
        else if (heights > 412)
        {
            trackBar_Size.Maximum = 415;
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

错误3 foreach语句不能对'sCreator.Shape'类型的变量进行操作,因为'sCreator.Shape'不包含'GetEnumerator'的公共定义

我在var maxHeight语句中遇到了这个错误.那么如何修复此错误并将LINQ结果用作浮点值?

c# linq

0
推荐指数
1
解决办法
104
查看次数

标签 统计

c# ×3

gdi+ ×2

winforms ×2

.net ×1

3d ×1

c++ ×1

fileversioninfo ×1

graphics ×1

graphicspath ×1

linq ×1

stl-format ×1

text ×1

winapi ×1