Class FileCreateSource

Class FileCreateSource

名称: Aspose.Imaging.Sources アセンション: Aspose.Imaging.dll (25.4.0)

作成のためのファイルソースを表します。

[JsonObject(MemberSerialization.OptIn)]
public sealed class FileCreateSource : FileSource

Inheritance

object Source FileSource FileCreateSource

相続人

FileSource.IsTemporal , Source.GetStreamContainer() , object.GetType() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()

Constructors

FileCreateSource(ストレッチ)

Aspose.Imaging.Sources.FileCreateSourceクラスの新しい例を開始します。

public FileCreateSource(string filePath)

Parameters

filePath string

作成するためのファイルパス

Examples

この例では、BmpOptions 例のソース属性によって指定されたディスクのどこかで新しい画像ファイルを作成します。第 2 つのパラメーターが FileCreateSource の構築者に移行されていない場合は、デフォルトで作成されるファイルには IsTemporal の属性が True に設定されます. IsTemporal が True に設定された場合、実行終了時にディスクに保存されるファイルはありません。

//Creates an instance of BmpOptions and set its various properties
                                                                                                                                                                                                                                                                                                                                                                            Aspose.Imaging.ImageOptions.BmpOptions bmpOptions = new Aspose.Imaging.ImageOptions.BmpOptions();
                                                                                                                                                                                                                                                                                                                                                                            bmpOptions.BitsPerPixel = 24;

                                                                                                                                                                                                                                                                                                                                                                            //Create an instance of FileCreateSource and assign it as Source for the instance of BmpOptions
                                                                                                                                                                                                                                                                                                                                                                            //If second parameter is not passed, then by default the file has IsTemporal set to True
                                                                                                                                                                                                                                                                                                                                                                            bmpOptions.Source = new Aspose.Imaging.Sources.FileCreateSource(@"C:\temp\output.bmp");

                                                                                                                                                                                                                                                                                                                                                                            //Creates an instance of Image 
                                                                                                                                                                                                                                                                                                                                                                            using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Create(bmpOptions, 500, 500))
                                                                                                                                                                                                                                                                                                                                                                            {
                                                                                                                                                                                                                                                                                                                                                                                //do some image processing
                                                                                                                                                                                                                                                                                                                                                                            }

FileCreateSource(ボール、ボール)

Aspose.Imaging.Sources.FileCreateSourceクラスの新しい例を開始します。

[JsonConstructor]
public FileCreateSource(string filePath, bool isTemporal)

Parameters

filePath string

作成するためのファイルパス

isTemporal bool

「真実」に設定すると、作成されたファイルは一時的になります。

Examples

この例では、BmpOptions 例のソース属性によって指定されたディスク位置で新しい画像ファイルを作成します。BmpOptions 例のいくつかの属性は、実際の画像を作成する前に設定されます。

//Create an instance of BmpOptions and set its various properties
                                                                                                                                                                                                                                                                                                             Aspose.Imaging.ImageOptions.BmpOptions bmpOptions = new Aspose.Imaging.ImageOptions.BmpOptions();
                                                                                                                                                                                                                                                                                                             bmpOptions.BitsPerPixel = 24;

                                                                                                                                                                                                                                                                                                             //Create an instance of FileCreateSource and assign it as Source for the instance of BmpOptions
                                                                                                                                                                                                                                                                                                             //Second Boolean parameter determines if the file to be created IsTemporal or not
                                                                                                                                                                                                                                                                                                             bmpOptions.Source = new Aspose.Imaging.Sources.FileCreateSource(@"C:\temp\output.bmp", false);

                                                                                                                                                                                                                                                                                                             //Create an instance of Image and initialize it with instance of BmpOptions by calling Create method
                                                                                                                                                                                                                                                                                                             using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Create(bmpOptions, 500, 500))
                                                                                                                                                                                                                                                                                                             {
                                                                                                                                                                                                                                                                                                                 //do some image processing

                                                                                                                                                                                                                                                                                                                 // save all changes
                                                                                                                                                                                                                                                                                                                 image.Save();
                                                                                                                                                                                                                                                                                                             }

Properties

FilePath

作成するためのファイルパスを取得します。

[JsonProperty]
public string FilePath { get; }

不動産価値

string

IsTemporal

ファイルが一時的であるかどうかを示す値を取得します。

[JsonProperty]
public override bool IsTemporal { get; }

不動産価値

bool

Methods

GetStreamContainer()

コンテナを流す。

public override StreamContainer GetStreamContainer()

Returns

StreamContainer

ストリームコンテナ

Remarks

慎重に使用します. 回収後、ストリームコンテナを解除する必要があります。

 日本語