CUSTOM
- 来源: https://www.freebasic.net/wiki/wikka.php?wakka=KeyPgCustomgfx
- 最后更新: 2020-12-19
Put 图形语句的参数,用于选择自定义方法
语法
Put [ target, ] [ STEP ] ( x,y ), source [ ,( x1,y1 )-( x2,y2 ) ], Custom, custom_function_ptr [, parameter]参数
Custom
必填。
custom_function_ptr
用户自定义函数的名称。
parameter
可选的指针,传递给自定义函数;如果省略,默认值为零(0)。
说明
Custom 选择用户自定义函数作为图像缓冲区位图传输的方法。
Custom 方法使用用户定义的函数来计算要绘制到目标缓冲区的最终像素值。该函数将对源图像的每个像素调用一次,并接收源像素值和目标像素值,以及 Put 函数传递的数据指针。返回的像素值将用于绘制到目标缓冲区。函数的形式如下:
vb
declare function identifier ( _
byval source_pixel as ulong, _
byval destination_pixel as ulong, _
byval parameter as any ptr _
) as ulongidentifier 是函数名称。
source_pixel 是源图像的当前像素值。
destination_pixel 是目标图像的当前像素值。
parameter 是由 Put 命令传递的参数。如果省略,其值为零。