Application.PixelsToPoints メソッド (Publisher)

測定をピクセルから ポイント (1 ピクセル = 0.75 ポイント) に変換します。 変換した単位を単精度浮動小数点型 (Single) の値として取得します。

構文

PixelToPoints ()

expressionApplication オブジェクトを 表す変数。

パラメーター

名前 必須 / オプション データ型 説明
必須 単精度浮動小数点型 (Single) ポイント単位に変換するピクセルの値を指定します。

戻り値

1 行

注釈

ポイント単位からピクセル単位に変換するには、 PointsToPixels メソッドを使用します。

次の使用例は、ユーザーが入力したピクセル単位の値を、ポイント単位に変更します。

Dim strInput As String 
Dim strOutput As String 
 
Do While True 
 ' Get input from user. 
 strInput = InputBox( _ 
 Prompt:="Enter measurement in pixels (0 to cancel): ", _ 
 Default:="0") 
 
 ' Exit the loop if user enters zero. 
 If Val(strInput) = 0 Then Exit Do 
 
 ' Evaluate and display result. 
 strOutput = Trim(strInput) & " pixels = " _ 
 & Format(Application _ 
 .PixelsToPoints(Value:=Val(strInput)), _ 
 "0.00") & " points" 
 
 MsgBox strOutput 
Loop 

サポートとフィードバック

Office VBA またはこの説明書に関するご質問やフィードバックがありますか? サポートの受け方およびフィードバックをお寄せいただく方法のガイダンスについては、Office VBA のサポートおよびフィードバックを参照してください。