回 帖 发 新 帖 刷新版面

主题:请版主讲解一个语句的用法

版主你好:
  你的“不要汉字系统显示汉字的源程序”的帖子中,有一个语句我没有完全读懂,
“LINE (x0, y0 + y)-STEP(15, 0), hzcol, , CVI(chr3$)”
语句中最后一项“CVI(chr3$)”的意义是什么(CVI函数我懂),我翻了几本书,书中都没有“LINE”语句最后一项用法的讲解,请版主讲解,谢谢!

回复列表 (共4个回复)

沙发

看帮助文件啊
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个点黑,黑白相间

板凳

我不懂英语,能否用中文讲解一下LINE语句中最后一项的意义,谢谢!

3 楼

那好吧
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 楼

谢谢飞鸟

我来回复

您尚未登录,请登录后再回复。点此登录或注册