[Delphi]View PlainCopyprint?
- function Tfrmlabelpages. Pwdimg (img:timage): string;
- Var
- I,j,k:integer;
- Vpoint:tpoint;
- Vleft:integer;
- ARRSTR:Array [1..36]of string;
- Strresult: string;
- Begin
- Strresult: = ";
- arrstr[1]: = ' 0 '; arrstr[2]:=' 1 '; arrstr[3]:=' 2 '; arrstr[4]:=' 3 ';
- arrstr[5]: = ' 4 '; arrstr[6]:=' 5 '; arrstr[7]:=' 6 '; arrstr[8]:=' 7 ';
- arrstr[9]: = ' 8 '; arrstr[10]:=' 9 '; arrstr[11]:=' A '; arrstr[12]:=' B ';
- arrstr[]: = ' C '; arrstr[14]:=' D '; arrstr[15]:=' E '; arrstr[16]:=' F ';
- arrstr[]: = ' G '; arrstr[18]:=' H '; arrstr[19]:=' I '; arrstr[20]:=' J ';
- arrstr[]: = ' K '; arrstr[22]:=' L '; arrstr[23]:=' M '; arrstr[24]:=' N ';
- arrstr[]: = ' O '; arrstr[26]:=' P '; arrstr[27]:=' Q '; arrstr[28]:=' R ';
- arrstr[]: = ' S '; arrstr[30]:=' T '; arrstr[31]:=' U '; arrstr[32]:=' V ';
- arrstr[]: = ' W '; arrstr[34]:=' X '; arrstr[35]:=' Y '; arrstr[36]:=' Z ';
- For j:=1 to 4 do
- begin
- Randomize;
- K: = Strtoint (Format ('%.1d ', [Random (36)]));
- Strresult: = strresult + trim (Arrstr[k])
- end;
- Vleft: = 10;
- IMG. Picture: = nil;
- For I: = 1 to Length (strresult) does
- begin
- With Img do
- begin
- Canvas. Font. Size: = Random (ten) + 9;
- Canvas. Font. Color: = RGB (Random () and $C 0,
- Random ( $C 0, Random () and $C 0);
- if Random (2) =1 Then
- Canvas. Font. Style: = [Fsbold]
- Else Canvas. Font. Style: = [];
- begin
- Canvas. Font. Name: = Screen. fonts[10];
- Vpoint. X: = Random (4) + vleft;
- Vpoint. Y: = Random (5);
- Canvas. TextOut (Vpoint. X, Vpoint. Y,strresult[i]);
- Vleft: = Vpoint. X + Canvas. TextWidth (Strresult[i]);
- end;
- end;
- end;
- End
http://blog.csdn.net/yanjiaye520/article/details/7957397
Delphi Simulation website Verification Code (cool, put random text on the picture)