如何调用CreateFontIndirect()
在C#如何使用CreateFontIndirect()啊,如何传递给控件的Font属性呢? --------------------编程问答--------------------[DllImport("gdi32.dll", EntryPoint="CreateFontIndirect")]--------------------编程问答-------------------- 先贴上声明。回头贴调用… --------------------编程问答-------------------- 谢谢了,调用的内容等待中~~~~ --------------------编程问答-------------------- http://msdn.microsoft.com/en-us/library/aa288468(VS.71).aspx --------------------编程问答-------------------- 还没写,看到msdn上有例子。你瞅一眼。看是你要的不。 --------------------编程问答-------------------- 这个例子我看过了,但是如何传递给控件的Font呢,比如Label.Font --------------------编程问答-------------------- 还是需要你的指点阿~~~~ --------------------编程问答-------------------- 等待啊,呵呵 --------------------编程问答--------------------
public static extern int CreateFontIndirect(ref LOGFONT lpLogFont);
[StructLayout(LayoutKind.Sequential)]
public struct LOGFONT {
public int lfHeight;
public int lfWidth;
public int lfEscapement;
public int lfOrientation;
public int lfWeight;
public byte lfItalic;
public byte lfUnderline;
public byte lfStrikeOut;
public byte lfCharSet;
public byte lfOutPrecision;
public byte lfClipPrecision;
public byte lfQuality;
public byte lfPitchAndFamily;
public <green>LF_FACESIZE)</green> lfFaceName(1;
}
Label label = new Label();
LOGFONT lf = new LOGFONT();
lf.lfHeight = label.Font.Height;
lf.lfFaceName = label.Font.Name;
IntPtr handle = CreateFontIndirect(lf);
这样行不行? --------------------编程问答-------------------- IntPtr handle = CreateFontIndirect(lf);
这样的话,label的字体能改变么? --------------------编程问答-------------------- 因为我这里想改变Label文字的拉长和拉宽问题 --------------------编程问答-------------------- 貌似这个创建的字体不可以用于.net吧。这个不是truetype的。
不是很了解这个。 --------------------编程问答-------------------- http://dev.firnow.com/course/4_webprogram/asp.net/netjs/200798/70670.html --------------------编程问答-------------------- 为了10分! --------------------编程问答-------------------- 同上~ --------------------编程问答-------------------- 发现即使TrueType的也是不行的,哎~~~~
还有其他方法么?
补充:.NET技术 , C#