您现在的位置:首页 >> 图形媒体 >> 图形媒体 >> 内容

Delphi一位图垂直镜像代码

时间:2011/9/3 15:02:34 点击:

  核心提示:procedure VertMirror(pBitMap:TBitmap);var bmp1: TBitmap; j: integer; p, p1: pByteArray;begin bmp1 :=...

procedure VertMirror(pBitMap:TBitmap);
var
  bmp1: TBitmap;
  j: integer;
  p, p1: pByteArray;
begin
  bmp1 := TBitmap.create;
  bmp1.assign(pBitMap);
  bmp1.PixelFormat := pf24bit;
  for j := 0 to pBitMap.Height - 1 do
  begin
    p  := pBitMap.ScanLine[j];
    p1 := Bmp1.ScanLine[pBitMap.Height - 1 - j];
    for i := 0 to pBitMap.Width - 1 do
    begin
      p[3 * i] := p1[3 * i];
      p[3 * i + 1] := p1[3 * i + 1];
      p[3 * i + 2] := p1[3 * i + 2];
    end;
  end;

Form1.Image1.picture.bitmap.Assign(pBitMap);

bmp1.free;

end;

作者:网络 来源:转载
共有评论 0相关评论
发表我的评论
  • 大名:
  • 内容:
本类推荐
  • 没有
本类固顶
  • 没有
  • 盒子文章(www.2ccc.com) © 2024 版权所有 All Rights Reserved.
  • 沪ICP备05001939号