输出成图像,然后把图像水平镜像,打印镜像后的图像。下面是图像镜像的代码。
---------------------------------------------------
来自:卷起千堆雪tyn 时间:2001-4-2 4:21:22 ID:487996
procedure TMainForm.N16Click(Sender: TObject);
var
I,J :integer;
p,p1
ByteArray;
Bmp,Bmp1 :TBitmap;
begin
Bmp :=TBitmap.Create;
Bmp.Assign(MainImage.Picture.Bitmap);
Bmp1 :=TBitmap.Create ;
Bmp1.Assign(MainImage.Picture.Bitmap);
case (Sender as TMenuItem).Tag of
1://///////////水平镜像
begin
for J :=0 to Bmp.Height-1do
begin
p :=Bmp.ScanLine[J];
P1 :=Bmp1.ScanLine[J];
for I :=0 to Bmp.Width-1do
begin
p1[3*(Bmp.Width-1-I)+2] :=p[3*I+2];
p1[3*(Bmp.Width-1-I)+1] :=p[3*I+1];
p1[3*(Bmp.Width-1-I)] :=p[3*I];
end;
end;
BitBlt(MainImage.Canvas.Handle,0,0,MainImage.Width,MainImage.Height,
Bmp1.Canvas.Handle,0,0,SRCCOPY);
end;
2://////////////////垂直镜像
begin
for J :=0 to Bmp.Height-1do
begin
p :=Bmp.ScanLine[J];
P1 :=Bmp1.ScanLine[Bmp.Height-1-J];
for I :=0 to Bmp.Width-1do
begin
p1[3*I+2] :=p[3*I+2];
p1[3*I+1] :=p[3*I+1];
p1[3*I] :=p[3*I];
end;
end;
BitBlt(MainImage.Canvas.Handle,0,0,MainImage.Width,MainImage.Height,
Bmp1.Canvas.Handle,0,0,SRCCOPY);
end;
end;
Bmp.Free;
Bmp1.Free;
end;