S
shaofun
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TTextForm.FormMouseDown(Sender: TObject; Button: TMouseButton;<br>Shift: TShiftState; X, Y: Integer);<br>var<br> m:LOGFONT;<br> hdc1:HDC;<br> N,O:HGDIOBJ;<br>begin<br> m.lfEscapement:=StrToInt(edit2.text)*10;<br> m.lfHeight:=11;<br> m.lfWidth:=0;<br> m.lfWeight:=400;<br> m.lfItalic:=0;<br> m.lfUnderline:=0;<br> m.lfStrikeOut:=0;<br> m.lfOutPrecision:=0;<br> m.lfClipPrecision:=0;<br> m.lfQuality:=0;<br> m.lfPitchAndFamily:=0;<br> m.lfCharSet:=0;<br> StrPLCopy(m.lfFaceName,'宋体',31);<br> hdc1:=GetDC(Self.Handle);<br> N:=CreateFontIndirect(m);<br> O:=SelectObject(hdc1,N);<br> SetBKMode(hdc1,TRANSPARENT);<br> TextOut(hdc1,X,Y,PChar(edit1.text),length(edit1.text));<br> N:=SelectObject(hdc1,O);<br> DeleteObject(N);<br>end;<br><br>利用上面的代码写的文字<br>1.m.lfHeight为11时文字仍为0度,可将其设为12后,文字角度就为设计角度了,不知为何?<br>2.StrPLCopy(m.lfFaceName,'宋体',31);这行不起作用,不知为何?<br> <br><br> <br>[回应主题] <br>[到上一篇] <br>[版主首页] <br>[返回上级] <br>[发新文章] <br> <br><br><br> <br>