Skip to content

Commit

Permalink
New translations wp-insert-picture.md (Japanese)
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaud4d committed Jan 30, 2025
1 parent 64a6240 commit 927c0d0
Showing 1 changed file with 32 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,59 +8,59 @@ displayed_sidebar: docs

<!--REF #_command_.WP Insert picture.Params-->

| 引数 || | 説明 |
| -------------- | ----------------------- | --------------------------- | ---------------------------------------------------------- |
| targetObj | Object | &#8594; | レンジまたは要素または4D Write Pro ドキュメント |
| picture | Picture | &#8594; | Picture field or variable, or path to picture file on disk |
| pictureFileObj | 4D.File | &#8594; | A File object representing a picture file. |
| mode | Integer | &#8594; | 挿入モード |
| rangeUpdate | Integer | &#8594; | レンジ更新モード |
| 戻り値 | Object | &#8592; | ピクチャーを参照しているオブジェクト |
| 引数 || | 説明 |
| -------------- | ----------------------- | --------------------------- | ------------------------------------------ |
| targetObj | Object | &#8594; | レンジまたは要素または4D Write Pro ドキュメント |
| picture | Picture | &#8594; | ピクチャーフィールドまたは変数、あるいはディスク上のピクチャーファイルへのパス |
| pictureFileObj | 4D.File | &#8594; | ピクチャーファイルを表す4D.File オブジェクト |
| mode | Integer | &#8594; | 挿入モード |
| rangeUpdate | Integer | &#8594; | レンジ更新モード |
| 戻り値 | Object | &#8592; | ピクチャーを参照しているオブジェクト |

<!-- END REF-->

#### 説明

The **WP Insert picture** command<!--REF #_command_.WP Insert picture.Summary--> inserts a *picture* or a *pictureFileObj* in the specified *targetObj* according to the passed insertion *mode* and *rangeUpdate* parameters, and returns a reference to the picture element.<!-- END REF--> The picture will be inserted as a character in the *targetObj*.
**WP Insert picture** コマンドは、<!--REF #_command_.WP Insert picture.Summary-->指定した挿入モード*mode* とレンジ更新モード*rangeUpdate* に従って、*picture* または*pictureFileObj* のピクチャーを*targetObj* で指定したレンジに挿入し、ピクチャー要素への参照を返します。<!-- END REF-->ピクチャーは文字として*targetObj* に挿入されます。

*targetObj* 引数には、以下のいずれかを渡すことができます:

- A range
- An element (table / row / paragraph / body / header / footer / inline picture / section / subsection)
- A 4D Write Pro document
- レンジ
- 要素(表組 / / 段落 / 本文 / ヘッダー / フッター / インライン画像 / セクション / サブセクション)
- 4D Write Pro ドキュメント

For the second parameter, you can pass either:
第二引数には、以下のいずれかを渡すことができます:

- In *picture*:
- A picture field or variable
- A string containing a path to a picture file stored on disk, in the system syntax.
If you use a string, you can pass either a full pathname, or a pathname relative to the database structure file. またファイル名を渡すこともでき、その場合、ファイルはデータベースのストラクチャーファイルと同じ階層に置かれている必要があります。 ファイル名を渡す場合には、ファイルの拡張子も指定する必要があります。 You can also pass a file name, in which case the file must be located next to the database structure file.
- In *pictureFileObj* : a `File` object representing a picture file.
- *picture* 引数の場合:
- ピクチャーフィールドまたは変数
- ディスク上のピクチャーファイルへのパスを格納した文字列(システムシンタックス)
文字列を使用する場合には、フルパス名またはデータベースのストラクチャーファイルを起点とした相対パス名を指定することができます。 またファイル名を渡すこともでき、その場合、ファイルはデータベースのストラクチャーファイルと同じ階層に置かれている必要があります。 ファイル名を渡す場合には、ファイルの拡張子も指定する必要があります。 ファイル名を渡す場合には、ファイルの拡張子も指定する必要があります。
- *pictureFileObj* 引数の場合: ピクチャーファイルを表す`File` オブジェクト

[4D でサポートされているフォーマット](../../FormEditor/pictures.md#native-formats-supported) であれば、どんなピクチャーフォーマットでも使用することができます。 [PICTURE CODEC LIST](../../commands-legacy/picture-codec-list.md) コマンドを使用することで、利用可能なピクチャーフォーマットの一覧を取得することができます。 ピクチャーに複数のフォーマット(コーデック)が格納されている場合、4D Write Pro はドキュメント内に表示用に1種類、印刷用に1種類(異なる場合)のフォーマットのみを保管します。その際、「最適」なフォーマットが自動的に選択されます。 [PICTURE CODEC LIST](../../commands-legacy/picture-codec-list.md) コマンドを使用することで、利用可能なピクチャーフォーマットの一覧を取得することができます。 ピクチャーに複数のフォーマット(コーデック)が格納されている場合、4D Write Pro はドキュメント内に表示用に1種類、印刷用に1種類(異なる場合)のフォーマットのみを保管します。その際、「最適」なフォーマットが自動的に選択されます。

In the *mode* parameter, pass one of the following constants to indicate the insertion mode to be used on the picture in the document:
*mode* 引数には、ドキュメント内のピクチャーに対して使用する挿入モードを指定する、以下の定数のいずれか一つを渡します:

| 定数 ||| 説明 |
| ---------- | ------- | - | -------------------- |
| wk append | Integer | 2 | コンテンツをターゲットの終わりに挿入する |
| wk prepend | Integer | 1 | コンテンツをターゲットの始めに挿入する |
| wk replace | Integer | 0 | ターゲットのコンテンツを置き換える |

If *targetObj* is a range, you can optionally use the *rangeUpdate* parameter to pass one of the following constants to specify whether or not the inserted picture is included in the resulting range:
*targetObj* がレンジである場合、オプションの*rangeUpdate* 引数に以下の定数のいづれか一つを渡すことで挿入されたピクチャーが結果のレンジに含まれるかどうかを指定することができます:

| 定数 ||| 説明 |
| --------------------- | ------- | - | ------------------------------------------------------------------ |
| wk exclude from range | Integer | 1 | Picture not included in the updated range |
| wk include in range | Integer | 0 | Picture included in the updated range (default) |
| 定数 ||| 説明 |
| --------------------- | ------- | - | ---------------------------------------------- |
| wk exclude from range | Integer | 1 | ピクチャーは更新されたレンジに含まれません |
| wk include in range | Integer | 0 | ピクチャーは更新されたレンジに含まれます(デフォルト) |

If you do not pass a *rangeUpdate* parameter, by default the inserted picture is included in the resulting range.
*rangeUpdate* 引数を省略した場合には、挿入したピクチャーは返されるレンジに含められます。

- *targetObj* がレンジではない場合、*rangeUpdate* は無視されます。

#### 例題 1

In the following example, a user selects the picture they want to insert into the range object and will be warned if this picture could not be inserted:
この例題では、ユーザーはレンジオブジェクトに挿入したいピクチャーを選択し、そのピクチャーが挿入できなかった場合に警告を出します:

```4d
var $wpRange : Object
Expand All @@ -69,29 +69,29 @@ In the following example, a user selects the picture they want to insert into th
var $fail : Boolean
$fail:=False
//ask user to choose a picture on the disk that they want to insert
//ユーザーに挿入するピクチャーを選択してもらいます
$imgRef:=Open document("")
//if user does not cancel
// ユーザーがキャンセルしなかった場合
If(OK=1)
//if the file is a supported picture file
// サポートされている形式のピクチャーファイルの場合
If(Is picture file(document))
// insert picture selected by user
// ユーザーが選択したピクチャーを挿入します
WP Insert picture($wpRange;document;wk replace)
Else
$fail:=True
End if
Else
$fail:=True
End if
//if the insertion failed, alert the user
// 挿入に失敗した場合には、ユーザーに警告します
If($fail)
ALERT("Picture insertion failed")
End if
```

#### 例題 2

You want to insert a picture in the body of the documment:
ピクチャーをドキュメントの本文に挿入したい場合を考えます:

```4d
var $file : 4D.File
Expand Down

0 comments on commit 927c0d0

Please sign in to comment.