主题:请版主讲解一个语句的用法
喜欢QB
[专家分:200] 发布于 2005-06-29 18:12:00
版主你好:
你的“不要汉字系统显示汉字的源程序”的帖子中,有一个语句我没有完全读懂,
“LINE (x0, y0 + y)-STEP(15, 0), hzcol, , CVI(chr3$)”
语句中最后一项“CVI(chr3$)”的意义是什么(CVI函数我懂),我翻了几本书,书中都没有“LINE”语句最后一项用法的讲解,请版主讲解,谢谢!
回复列表 (共4个回复)
沙发
飞鸟12 [专家分:2830] 发布于 2005-06-29 18:37:00
看帮助文件啊
LINE [[STEP](x1!,y1!)]-[STEP](x2!,y2!) [,[color%] [,[B | BF] [,style%]]]
?STEP Specifies that coordinates are relative to the current
graphics cursor position.
?(x1!,y1!), The screen coordinates of the start of the line and of
(x2!,y2!) the end of the line.
?color% A color attribute that sets the color of the line or
rectangle. The available color attributes depend on your
graphics adapter and the screen mode set by the most
recent SCREEN statement.
?B Draws a rectangle instead of a line.
?BF Draws a filled box.
?style% A 16-bit value whose bits set whether or not pixels are
drawn. Use to draw dashed or dotted lines.
Example:
'This example requires a color graphics adapter.
SCREEN 13
LINE (110, 70)-(190, 120), , B
LINE (0, 0)-(320, 200), 15, , &HFF00
FF00H 即 1111111100000000B
画直线时 8个点白8个点黑
又如 LINE (0, 0)-(320, 200), 15, , &HAAAA
AAAAH 即 1010101010101010B
画直线时 1个点白1个点黑,黑白相间
板凳
喜欢QB [专家分:200] 发布于 2005-06-29 18:45:00
我不懂英语,能否用中文讲解一下LINE语句中最后一项的意义,谢谢!
3 楼
飞鸟12 [专家分:2830] 发布于 2005-06-29 18:53:00
那好吧
style%就是画线的方式
运行一下,下面的程序,我想你应该就会明白的
SCREEN 13
LINE (20, 10)-STEP(15, 0), , , &HFFFF
LOCATE 2, 10: PRINT "&HFFFF"
LINE (20, 26)-STEP(15, 0), , , &HFF00
LOCATE 4, 10: PRINT "&HFF00"
LINE (20, 42)-STEP(15, 0), , , &HFF
LOCATE 6, 10: PRINT "&H00FF"
LINE (20, 58)-STEP(15, 0), , , &HAAAA
LOCATE 8, 10: PRINT "&HAAAA"
LINE (20, 74)-STEP(15, 0), , , &HAAFF
LOCATE 10, 10: PRINT "&HAAFF"
LINE (20, 90)-STEP(15, 0), , , &HFFAA
LOCATE 12, 10: PRINT "&HFFAA"
END
注:程序中都只画了一个“周期”的直线(16个点)
4 楼
喜欢QB [专家分:200] 发布于 2005-06-29 19:05:00
谢谢飞鸟
我来回复