var
Bmp1, Bmp2: TBitmap;
Ptr1, Ptr2: PByteArray;
i, j: Integer;
begin
Bmp1 := TBitmap.Create;
Bmp2 := TBitmap.Create;
try
Canvas.Font.Name := '宋体';
Canvas.Font.Height := 100;
Bmp1.Width := Canvas.TextWidth('我');
Bmp1.Height := Canvas.TextHeight('我');
Bmp1.Canvas.Font := Canvas.Font;
Bmp1.Canvas.TextOut(0, 0, '我');
Bmp1.PixelFormat := pf8Bit;
Bmp1.SaveToFile('c:/a.bmp');
Bmp2.Width := Bmp1.Width;
Bmp2.Height := Bmp1.Height;
Bmp2.PixelFormat := pf8Bit;
for i := 0 to Bmp1.Height - 1do
begin
Ptr1 := Bmp1.ScanLine;
Ptr2 := Bmp2.ScanLine;
for j := 0 to Bmp1.Width - 1do
Ptr2[j] := Ptr1[Bmp1.Width - j - 1];
end;
Bmp2.SaveToFile('c:/b.bmp');
finally
Bmp1.Free;
Bmp2.Free;
end;
end;