scanline 方法的使用
来源:互联网 发布:vivo软件商店网页版 编辑:程序博客网 时间:2024/04/28 16:52
声明: property scanline[row: integer]: pointer read getscanline ;(只读)
//以下函数把位图变也灰度(可调节)
procedure graybitmap(abitmap: tbitmap; value: integer=0);
var
pixel: prgbtriple; //用来接收返回值
w, h: integer;
x, y: integer;
avg: integer;
begin
abitmap.pixelformat := pf24bit;
w := abitmap.width;
h := abitmap.height;
for y := 0 to h - 1 do
begin
pixel := abitmap.scanline[y];
for x := 0 to w - 1 do
begin
avg := ((pixel^.rgbtred + pixel^.rgbtgreen + pixel^.rgbtblue) div 3)+ value;
if avg > 240 then avg := 240;
pixel^.rgbtred := avg;
pixel^.rgbtgreen := avg;
pixel^.rgbtblue := avg;
inc(pixel);
end;
end;
end;
附定义: prgbtriple = ^trgbtriple;
trgbtriple = tagrgbtriple;
tagrgbtriple = packed record
rgbtblue: byte;
rgbtgreen: byte;
rgbtred: byte;
end;
- scanline 方法的使用
- Delphi图像处理中ScanLine的使用
- Delphi图像处理中ScanLine的使用
- Delphi图像处理中ScanLine的使用
- scanline
- delphi bmp scanline
- AGG 光栅化(Scanline Rasterizer)
- [翻译]AGG reference 之 Scanline Containers
- Polygon Rasterization之Scanline Polygon Rasterization Algorithm
- 方法以及方法的使用
- 反射方法的使用
- gcc使用的方法
- Session使用的方法
- gcc使用的方法
- 使用剪切板的方法
- 方法的使用示例
- 方法prmisdefault的使用
- 使用MagicAjax的方法
- 【转】解析u-boot基于I.MX51_BBG的编译过程(一)
- 函数指针与指针函数
- 分页控件
- UML示例图(转)学习
- 5 使用局部函数值
- scanline 方法的使用
- ${ }的用法
- MFC实现Flash动画播放
- linux apache MPM 的模式(Prefork和Worker)选择与比较
- 基础知识---const/typedef/函数指针/回调函数
- C#中字段与属性
- differs in levels of indirection from 'void
- poj 2491
- Microsoft Visual Studio China Middle School Power Toy 1.0 发布