本文共 393 字,大约阅读时间需要 1 分钟。
浮雕算法: r=(r-r)+number
b=(b-b)+number
g=(g-g)+number
模糊算法:
取一个像素块(3*3或5*5或7*7),求出像素块总的r、g、b值,然后取平均值做当前像素点的r、g、b值。
锐化算法:
r=r+(r-r)+number
b=b+(b-b)+number
g=g+(g-g)+number
其中r,g,b是像素对应的rgb值,r,g,b是该点相临像素的rgb值,number是决定浮雕效果的阀值,取值(100~150)之间效果较好。
得到像素r、g、b值,可使用api的getpixel函数,函数原型可民自己去查一下(在delphi ide中输入函数名按住ctrl键,然后用鼠标单击函数名)。
tcolor=>rgb
r:=byte(bcolor)
b:=byte(bcolor shr 8)
g:=byte(bcolor shr 16)
转载地址:http://xbedi.baihongyu.com/