Z
zhengxb
Unregistered / Unconfirmed
GUEST, unregistred user!
我抄书上的程序,但运行时没有显示,书上是旋转的文字显示<br><br>unit Unit1;<br><br>interface<br><br>uses<br> Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;<br><br>type<br> TForm1 = class(TForm)<br> procedure FormMouseUp(Sender:TObject;Button:TMouseButton;<br> Shift:TShiftState;x,y:integer);<br> procedure FormCreate(Sender: TObject);<br> procedure FormClose(Sender: TObject; var Action: TCloseAction);<br> private<br> { Private declarations }<br> public<br> { Public declarations }<br> end;<br><br>var<br> Form1: TForm1;<br> m_LF:LOGFONT;<br> NewFont:HGDIOBJ;<br> OrgFont:HGDIOBJ;<br> hdc1:HDC;<br>implementation<br><br>{$R *.DFM}<br>procedure Tform1.FormMouseUp(Sender:TObject;Button:TMouseButton;<br> Shift:TShiftState;x,y:integer);<br>var<br> i:integer;<br>begin<br> i:=0;<br> while (i<3600) do<br> begin<br> m_LF.lfEscapement:=i;<br> NewFont:=CreateFontIndirect(m_LF);<br> OrgFont:=SelectObject(hdc1,NewFont);<br> TextOut(hdc1,x,y,'同志工作室',10);<br> NewFont:=SelectObject(hdc1,OrgFont);<br> DeleteObject(NewFont);<br> i:=i+100;<br> end;<br>end;<br><br><br><br><br>procedure TForm1.FormCreate(Sender: TObject);<br>begin<br> hdc1:=GetDc(self.Handle);<br> m_LF.lfHeight:=15;<br> m_LF.lfWidth:=15;<br> m_LF.lfEscapement:=0;<br> m_LF.lfWeight:=400;<br> m_LF.lfItalic:=0;<br> m_LF.lfUnderline:=0;<br> m_LF.lfStrikeOut:=0;<br> m_LF.lfOutPrecision:=0;<br> m_LF.lfClipPrecision:=0;<br> m_LF.lfQuality:=0;<br> m_LF.lfPitchAndFamily:=0;<br> m_LF.lfCharSet:=0;<br> setTextColor(hdc1,rgb(0,0,255));<br> setbkMode(hdc1,Transparent);<br> NewFont:=CreatefontIndirect(m_LF);<br> orgFont:=selectObject(hdc1,newfont);<br>end;<br><br>procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);<br>begin<br> Newfont:=selectobject(hdc1,orgfont);<br> deleteobject(newfont);<br>end;<br><br>end.<br>