Y
yanmin11003
Unregistered / Unconfirmed
GUEST, unregistred user!
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls;
const
pbig =4;
type
TForm1 = class(TForm)
Button1: TButton;
Label1: TLabel;
Image1: TImage;
procedure Button1Click(Sender: TObject);
procedure TForm1.FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
procedure drpiont(var curclab : Tlabel;var curimage :Timage);
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
label1.Caption :='转化为点阵';
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
drpiont(label1,image1);
end;
procedure drpiont(var curclab : Tlabel;var curimage :Timage);
var
tleft,ttop,drleft,drtop : integer;
begin
curimage.Picture :=nil;
curimage.Width :=curclab.Width * pbig;
curimage.Height :=curclab.Height * pbig;
curclab.Transparent :=false;
curimage.Transparent :=false;
curimage.Canvas.Brush.Color :=clwhite;
curimage.Canvas.FillRect(curclab.Canvas.ClipRect);
for tleft :=0 to curclab.Width-1 do
for ttop :=0 to curclab.Height-1 do
if curclab.Canvas.Pixels[tleft,ttop] = curclab.Font.Color then
begin
drleft := tleft * pbig ;
drtop := ttop * pbig ;
while (drleft <drleft+pbig-1) do
begin
drleft :=drleft+1;
while(drtop<drtop+pbig-1) do
begin
drtop :=drtop+1;
curimage.Canvas.Pixels[drleft,drtop] :=curimage .Canvas.Pen.Color;
end;
end;
end;
curclab .Transparent:=false;
curimage.Transparent:=false;
end;
end.
在这个程序中我想把LABEL1上的字在image1上以点阵的形式画出来,看看错误思想在哪
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls;
const
pbig =4;
type
TForm1 = class(TForm)
Button1: TButton;
Label1: TLabel;
Image1: TImage;
procedure Button1Click(Sender: TObject);
procedure TForm1.FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
procedure drpiont(var curclab : Tlabel;var curimage :Timage);
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
label1.Caption :='转化为点阵';
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
drpiont(label1,image1);
end;
procedure drpiont(var curclab : Tlabel;var curimage :Timage);
var
tleft,ttop,drleft,drtop : integer;
begin
curimage.Picture :=nil;
curimage.Width :=curclab.Width * pbig;
curimage.Height :=curclab.Height * pbig;
curclab.Transparent :=false;
curimage.Transparent :=false;
curimage.Canvas.Brush.Color :=clwhite;
curimage.Canvas.FillRect(curclab.Canvas.ClipRect);
for tleft :=0 to curclab.Width-1 do
for ttop :=0 to curclab.Height-1 do
if curclab.Canvas.Pixels[tleft,ttop] = curclab.Font.Color then
begin
drleft := tleft * pbig ;
drtop := ttop * pbig ;
while (drleft <drleft+pbig-1) do
begin
drleft :=drleft+1;
while(drtop<drtop+pbig-1) do
begin
drtop :=drtop+1;
curimage.Canvas.Pixels[drleft,drtop] :=curimage .Canvas.Pen.Color;
end;
end;
end;
curclab .Transparent:=false;
curimage.Transparent:=false;
end;
end.
在这个程序中我想把LABEL1上的字在image1上以点阵的形式画出来,看看错误思想在哪