手写板输入到memo中:<br>procedure txttojpeg(txt,filename:string;brush_color:tcolor;font:tfont;<br>font_color:tcolor;width,height:integer);<br>var<br>temp:tbitmap;<br>jpeg:tjpegimage;<br>i:integer;<br>begin<br>temp:=tbitmap.create;<br>try<br>temp.height:=height;<br>temp.width:=width;<br>temp.transparent:=true;<br>temp.canvas.brush.color:=brush_color;<br>temp.canvas.font:=font;<br>temp.canvas.font.color:=font_color;<br>for i:=0 to form1.memo1.lines.count-1 do<br>begin<br>j:=j+15;<br>temp.canvas.textout(10,j,form1.memo1.lines.strings);//表示距离,top,left.<br>end;<br>jpeg:=tjpegimage.create;<br>try<br>jpeg.assign(temp);<br>jpeg.savetofile(filename);<br>finally<br>jpeg.free;<br>end;<br>finally<br>temp.destroy;<br>end;<br>end;<br><br><br>button1click()<br>begin<br>form1.savedialog1.filter:='图片(*.jpg)|*.jpg|(*.*)|*.*';<br>if form3.savedialog1.execute then<br>txttojpeg(memo1.lines.text,savedialog1.filename+'.jpg',b_c,f,f_c,memo1.width,memo1.height);<br>form1.image1.picture.loadfromfile(form1.savedialog1.filename+'.jpg');<br>end;