using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace 绘制字体
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
Graphics g = e.Graphics;
g.TranslateTransform(AutoScrollPosition.X,AutoScrollPosition.Y);
Point position = new Point(0, 8);
foreach(FontFamily f in FontFamily.Families)//电脑上所有的字体
{
if(f.IsStyleAvailable(FontStyle.Regular))//符合字体普通格式的字体(比如加粗,斜线)
C# 在窗体中绘制字符串
最新推荐文章于 2022-08-19 11:53:32 发布