我有指示在圖形上繪製文本。像字符串一樣,字體細節。 現在,我想從這些指令中獲取形狀。可能是繪製字符'A'的點的列表。需要從c中的框架字體的文本中獲取文本輪廓或文本繪圖形狀#
我的AIM是將文本繪圖轉換成形狀圖。需要避免使用的DrawString API(沒有錯的API,它只是我需要
示例代碼:
GraphicsPath path = new GraphicsPath();
path.StartFigure();
path.AddString("Sample Text", new FontFamily("arial"),
1, 50, new Point(0, 0),
StringFormat.GenericTypographic);
path.CloseFigure();
PointF[] pt=path.PathPoints;
你試過的代碼在哪裏? – niksofteng
我已更新我的問題,它只顯示文字大綱。我需要填充文字形狀。不只是oulines –
@PradeepMalage:這是可以預料的。文本由大綱路徑表示。如果你想繪製它填充,你必須*填充*的路徑,而不是撫摸它。 – Joey