用字符构造Font的问题 千千静听的字体保存为如下字符串:-13,0,0,0,700,0,0,0,134,3,2,4,49,幼圆如何用此字符串构造一个Font哪位朋友能指点指点,多谢多谢! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 LZ 可以用 可序列化 用2进制生成 object 同时font 在propergridview 中只有9个数据 都是int Color等 分别保存到文本就可以了我刚刚做了一个demo 可行性分析是没有问题的 using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.Runtime.InteropServices;namespace WindowsFormsApplication73{ public partial class Form1 : Form { [DllImport("gdi32")] static extern IntPtr CreateFontW( Int32 nHeight, Int32 nWidth, Int32 nEscapement, Int32 nOrientation, Int32 fnWeight, UInt32 fdwItalic, UInt32 fdwUnderline, UInt32 fdwStrikeOut, UInt32 fdwCharSet, UInt32 fdwOutputPrecision, UInt32 fdwClipPrecision, UInt32 fdwQuality, UInt32 fdwPitchAndFamily, IntPtr lpszFace); public Form1() { InitializeComponent(); Label L1 = new Label(); L1.Parent = this; L1.Text = "默认的字体"; Label L2 = new Label(); L2.Parent = this; L2.Location = new Point(0, 30); L2.Font = Font.FromHfont(CreateFontW(-13, 0, 0, 0, 700, 0, 0, 0, 134, 3, 2, 4, 49, Marshal.UnsafeAddrOfPinnedArrayElement("幼圆".ToCharArray(), 0))); L2.Text = "幼圆字体"; } }} 如何使用C#关闭Word对话框 C# new运算符和C++ new运算符的 区别 .net中继承母模板页出现问题? 如何用C#打印出这个图形??? 换系统导致时间格式差异 一个关于水晶报表移植的问题 关于接口写法的问题,希望路过的高人拉我一把~~谢谢先! C#网页按钮点击问题 如何创建一个List<T>集合的副本? 数据库连接不上了,求救 路径问题 dataset.Tables.Compute问题
同时font 在propergridview 中只有9个数据
都是int Color等 分别保存到文本就可以了
我刚刚做了一个demo 可行性分析是没有问题的
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;namespace WindowsFormsApplication73
{
public partial class Form1 : Form
{
[DllImport("gdi32")]
static extern IntPtr CreateFontW(
Int32 nHeight,
Int32 nWidth,
Int32 nEscapement,
Int32 nOrientation,
Int32 fnWeight,
UInt32 fdwItalic,
UInt32 fdwUnderline,
UInt32 fdwStrikeOut,
UInt32 fdwCharSet,
UInt32 fdwOutputPrecision,
UInt32 fdwClipPrecision,
UInt32 fdwQuality,
UInt32 fdwPitchAndFamily,
IntPtr lpszFace); public Form1()
{
InitializeComponent(); Label L1 = new Label();
L1.Parent = this;
L1.Text = "默认的字体"; Label L2 = new Label();
L2.Parent = this;
L2.Location = new Point(0, 30);
L2.Font = Font.FromHfont(CreateFontW(-13, 0, 0, 0, 700, 0, 0, 0, 134, 3, 2, 4, 49, Marshal.UnsafeAddrOfPinnedArrayElement("幼圆".ToCharArray(), 0)));
L2.Text = "幼圆字体";
}
}
}