FreeBASIC マニュアルのトップに戻る

FreeBASIC PointCoord

目次→描画ライブラリー参考→描画画面関連POINTCOORD←オリジナル・サイト

POINTCOORD 左にメニュー・フレームが表示されていない場合は、ここをクリックして下さい

←リンク元に戻る プログラム開発関連に戻る

描画モードで Draw のペン位置を検索する

構文:
Declare Function PointCoord( ByVal func As Long ) As Single

用法:
result = PointCoord( func )

記述:
PointCoord 関数は、描画モードで Draw ペンの x と y 位置を問い合わせるのに用いることができます。
result(結果) 値は、渡された func 値に依存します:
func 値: return 値:
0 x 物理座標。PMap( PointCoord( 2 ), 0 ) と同じ
1 y 物理座標。PMap( PointCoord( 3 ), 1 ) と同じ
2 x 表示座標
3 y 表示座標

例:
注:FreeBASIC 1.08〜 で、SetEnviron を追加しなくても、日本語環境で描画画面が表示されるように改善されました。
' Sets the graphics method GDI
' 描画方法を GDI に設定
SetEnviron("fbgfx=GDI")

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 )

Sleep


QBからの違い:

参照:

描画画面関連に戻る
←リンク元に戻る プログラム開発関連に戻る
ページ歴史:2017-12-28 09:11:55
日本語翻訳:WATANABE Makoto、原文著作者:DkLwikki

ホームページのトップに戻る

表示-非営利-継承