zoukankan      html  css  js  c++  java
  • 浮雕效果

    procedure Effect_Emboss(Picture:TBitmap);

    var

    BB1,BB2:TBitmap;

    begin

    BB1:=TBitmap.Create;

    BB1.PixelFormat :=pf24bit;

    BB1.Assign(Picture.Bitmap);

    BB2:=TBitmap.Create;

    BB2.PixelFormat:=pf24bit;

    BB2.Assign(BB1);

    Emboss(BB2);

    Picture.Bitmap.Assigned(BB2);

    BB1.Free;

    BB2.Free;

    end;

    procedure Emboss(var Bmp:TBitmap);

    var

    x,y:integer;

    p1,p2:PByteArray;

    begin

    for y:=0 to Bmp.Height-2 do

    begin

    p1:=bmp.Scanline[y];

    p2:=bmp.Scanline[y+1];

    for x:=0 to Bmp.Width-4 do

    begin

    p1[x*3]:=(p1[x*3]+(p2[(x+3)*3] xor $FF)) shr 1;

    p1[x*3+1]:=(p1[x*3+1]+(p2[(x+3)*3+1] xor $FF)) shr 1;

    p1[x*3+2]:=(p1[x*3+2]+(p2[(x+3)*3+2] xor $FF)) shr 1;

    end;

    end;

    end;

  • 相关阅读:
    九连环
    Fruit Ninja(取随机数)
    Distinct Values(贪心)
    Harvest of Apples
    Don't Be a Subsequence
    ConvexScore
    守卫
    Trie树
    NOIP 2005 过河
    HDU 4597 Play Game 记忆化DP
  • 原文地址:https://www.cnblogs.com/djcsch2001/p/2035827.html
Copyright © 2011-2022 走看看