Skip to content

PRESET


绘制单个像素

语法

PReset [target ,] [STEP] (x, y) [,color]

参数

target

指定要绘制的缓冲区。

STEP

表示坐标是相对坐标

(x, y)

像素坐标。

color

颜色属性。

说明

target 指定要绘制的缓冲区。target 可以是用 ImageCreateGet (Graphics) 创建的图像。如果省略,target 默认为屏幕当前工作页面。

(x, y) 是像素坐标。如果存在 STEP,表示 (x, y) 坐标相对于图形光标位置。如果省略,(x, y) 相对于 target 的左上角。x 和 y 坐标受上次调用 View (Graphics)Window 语句的影响,并遵守 View (Graphics) 语句设置的当前裁剪区域。

color 指定颜色属性。如果省略,color 默认为当前背景颜色。参见 Colorcolor 与图形模式相关,详情参见 ColorScreen (Graphics)

示例

start GeSHi

vb
Screen 13

'Set background color to 15
Color , 15

'Draw a pixel with the background color at 10, 10
PReset (10,10)

'Draw a pixel with the background color at Last x cord +10, Last y cord +10
PReset Step (10,10)
Sleep

end GeSHi

与 QB 的区别

  • target 是 FreeBASIC 新增的

另请参阅

  • PSet

返回 目录

基于 FreeBASIC 官方文档翻译 如有侵权请联系我们删除
FreeBASIC 是开源项目,与微软公司无隶属关系