POINTCOORD
- 来源: https://www.freebasic.net/wiki/wikka.php?wakka=KeyPgPointCoord
- 最后更新: 2017-12-28
在图形模式下查询 Draw 画笔位置
语法
Declare Function PointCoord( ByVal func As Long ) As Single用法
result = PointCoord( func )说明
PointCoord 函数可用于查询图形模式下 Draw 画笔的 x 和 y 位置。result 值取决于传递的 func 值:
| func 值 | 返回值 |
|---|---|
| 0 | x 物理坐标,等同于 PMap( PointCoord( 2 ), 0 ) |
| 1 | y 物理坐标,等同于 PMap( PointCoord( 3 ), 1 ) |
| 2 | x 视图坐标 |
| 3 | y 视图坐标 |
示例
start GeSHi
vb
Screen 12
Print "--- Default window coordinate mapping ---"
Print "DRAW pen position, at the default (0,0):"
Print "Physical:", PointCoord( 0 ), PointCoord( 1 )
Print "View:", PointCoord( 2 ), PointCoord( 3 )
Draw "BM 50,50"
Print "DRAW pen position, after being moved to (50,50):"
Print "Physical:", PointCoord( 0 ), PointCoord( 1 )
Print "View:", PointCoord( 2 ), PointCoord( 3 )
Print "--- Changing window coordinate mapping ---"
Window Screen (-100, -100) - (100, 100)
Draw "BM 0,0"
Print "DRAW pen position, after being moved to (0,0):"
Print "Physical:", PointCoord( 0 ), PointCoord( 1 )
Print "View:", PointCoord( 2 ), PointCoord( 3 )
Draw "BM 50,50"
Print "DRAW pen position, after being moved to (50,50):"
Print "Physical:", PointCoord( 0 ), PointCoord( 1 )
Print "View:", PointCoord( 2 ), PointCoord( 3 )
Sleepend GeSHi
与 QB 的区别
- FreeBASIC 新增
另请参阅
PMapWindow
返回 目录