Class EmfImage

Class EmfImage

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

API for Enhanced Metafile Format (EMF) ベクトルイメージフォーマットのサポートは、デバイス独立でグラフィック画像を処理するための包括的なツールオリジナルの財産を保有するために開発された方法比率、次元、色、およびその他のグラフィック属性は、EMF Plus フォーマットサポートおよび掘削地域、リサイクルカンバの機能画像、回転、フリッピング、画像パレットの設定、輸出、輸入APS デバイス コンテキスト、圧縮および EMF を他のフォーマットに変換し、多様な操作とEMF画像のアプリケーション間の無線統合。

[JsonObject(MemberSerialization.OptIn)]
public sealed class EmfImage : MetaImage, IDisposable, IObjectWithBounds, IObjectWithSizeF

Inheritance

object DisposableObject DataStreamSupporter Image VectorImage MetaImage EmfImage

Implements

IDisposable , IObjectWithBounds , IObjectWithSizeF

相続人

MetaImage.GetUsedFonts() , MetaImage.GetMissedFonts() , MetaImage.ResizeCanvas(Rectangle) , MetaImage.Records , VectorImage.GetEmbeddedImages() , VectorImage.RemoveBackground() , VectorImage.RemoveBackground(RemoveBackgroundSettings) , VectorImage.Resize(int, int, ResizeType) , VectorImage.Resize(int, int, ImageResizeSettings) , VectorImage.RotateFlip(RotateFlipType) , VectorImage.Crop(Rectangle) , VectorImage.Rotate(float) , VectorImage.SizeF , VectorImage.WidthF , VectorImage.HeightF , VectorImage.Width , VectorImage.Height , Image.CanLoad(string) , Image.CanLoad(string, LoadOptions) , Image.CanLoad(Stream) , Image.CanLoad(Stream, LoadOptions) , Image.Create(ImageOptionsBase, int, int) , Image.Create(Image[]) , Image.Create(MultipageCreateOptions) , Image.Create(string[], bool) , Image.Create(string[]) , Image.Create(Image[], bool) , Image.GetFileFormat(string) , Image.GetFileFormat(Stream) , Image.GetFittingRectangle(Rectangle, int, int) , Image.GetFittingRectangle(Rectangle, int[], int, int) , Image.Load(string, LoadOptions) , Image.Load(string) , Image.Load(Stream, LoadOptions) , Image.Load(Stream) , Image.GetProportionalWidth(int, int, int) , Image.GetProportionalHeight(int, int, int) , Image.RemoveMetadata() , Image.CanSave(ImageOptionsBase) , Image.Resize(int, int) , Image.Resize(int, int, ResizeType) , Image.Resize(int, int, ImageResizeSettings) , Image.GetDefaultOptions(object[]) , Image.GetOriginalOptions() , Image.ResizeWidthProportionally(int) , Image.ResizeHeightProportionally(int) , Image.ResizeWidthProportionally(int, ResizeType) , Image.ResizeHeightProportionally(int, ResizeType) , Image.ResizeWidthProportionally(int, ImageResizeSettings) , Image.ResizeHeightProportionally(int, ImageResizeSettings) , Image.RotateFlip(RotateFlipType) , Image.Rotate(float) , Image.Crop(Rectangle) , Image.Crop(int, int, int, int) , Image.Save() , Image.Save(string) , Image.Save(string, ImageOptionsBase) , Image.Save(string, ImageOptionsBase, Rectangle) , Image.Save(Stream, ImageOptionsBase) , Image.Save(Stream, ImageOptionsBase, Rectangle) , Image.GetSerializedStream(ImageOptionsBase, Rectangle, out int) , Image.SetPalette(IColorPalette, bool) , Image.BitsPerPixel , Image.Bounds , Image.Container , Image.Height , Image.Palette , Image.UsePalette , Image.Size , Image.Width , Image.InterruptMonitor , Image.BufferSizeHint , Image.AutoAdjustPalette , Image.HasBackgroundColor , Image.FileFormat , Image.BackgroundColor , DataStreamSupporter.CacheData() , DataStreamSupporter.Save() , DataStreamSupporter.Save(Stream) , DataStreamSupporter.Save(string) , DataStreamSupporter.Save(string, bool) , DataStreamSupporter.DataStreamContainer , DataStreamSupporter.IsCached , DisposableObject.Dispose() , DisposableObject.Disposed , object.GetType() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()

Examples

下記の例では、emz 画像を emf fromat に変換する方法を示しています。

string file = "example.emz";
                                                                                string baseFolder = System.IO.Path.Combine("D:", "Compressed");
                                                                                string inputFile = System.IO.Path.Combine(baseFolder, file);
                                                                                string outFile = inputFile + ".emf";
                                                                                using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(inputFile))
                                                                                {
                                                                                    Aspose.Imaging.ImageOptions.VectorRasterizationOptions vectorRasterizationOptions = new Aspose.Imaging.ImageOptions.EmfRasterizationOptions {PageSize = image.Size};
                                                                                    image.Save(outFile, new Aspose.Imaging.ImageOptions.EmfOptions {VectorRasterizationOptions = vectorRasterizationOptions});
                                                                                }

下記の例では、EMF画像をEMZ画像に変換する方法を示しています。

string file = "input.emf";
                                                                                string baseFolder = System.IO.Path.Combine("D:", "Compressed");
                                                                                string inputFile = System.IO.Path.Combine(baseFolder, file);
                                                                                string outFile = inputFile + ".emz";
                                                                                using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(inputFile))
                                                                                {
                                                                                    Aspose.Imaging.ImageOptions.VectorRasterizationOptions vectorRasterizationOptions = new Aspose.Imaging.ImageOptions.EmfRasterizationOptions() { PageSize = image.Size};
                                                                                    image.Save(outFile, new Aspose.Imaging.ImageOptions.EmfOptions() {VectorRasterizationOptions = vectorRasterizationOptions, Compress = true});
                                                                                }

下記の例では、圧縮された画像を変換する方法を示しています(エムズ.wmz, *.svgz) に ラスター スライド

string[] files = new[] {"example.emz", "example.wmz", "example.svgz"};
                                                                                                                string baseFolder = System.IO.Path.Combine("D:","Compressed");
                                                                                                                foreach (var file in files)
                                                                                                                {
                                                                                                                    string inputFile = System.IO.Path.Combine(baseFolder, file);
                                                                                                                    string outFile = inputFile + ".png";
                                                                                                                    using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(inputFile))
                                                                                                                    {
                                                                                                                        Aspose.Imaging.ImageOptions.VectorRasterizationOptions vectorRasterizationOptions = (Aspose.Imaging.ImageOptions.VectorRasterizationOptions)image.GetDefaultOptions(new object[] { Color.White, image.Width, image.Height });
                                                                                                                        image.Save(outFile, new Aspose.Imaging.ImageOptions.PngOptions(){VectorRasterizationOptions = vectorRasterizationOptions});
                                                                                                                    }
                                                                                                                }

この例では、ファイルから EMF 画像をアップロードし、EmfRasterizationOptions を使用して SVG に変換する方法を示しています。

string dir = "c:\\temp\\";

                                                                                                                      // Using Aspose.Imaging.Image.Load is a unified way to load all types of images including EMF.
                                                                                                                      using (Aspose.Imaging.FileFormats.Emf.EmfImage emfImage = (Aspose.Imaging.FileFormats.Emf.EmfImage)Aspose.Imaging.Image.Load(dir + "test.emf"))
                                                                                                                      {
                                                                                                                          Aspose.Imaging.ImageOptions.SvgOptions saveOptions = new Aspose.Imaging.ImageOptions.SvgOptions();

                                                                                                                          // Text will be converted to shapes.
                                                                                                                          saveOptions.TextAsShapes = true;

                                                                                                                          Aspose.Imaging.ImageOptions.EmfRasterizationOptions rasterizationOptions = new Aspose.Imaging.ImageOptions.EmfRasterizationOptions();

                                                                                                                          // The background color of the drawing surface.
                                                                                                                          rasterizationOptions.BackgroundColor = Aspose.Imaging.Color.WhiteSmoke;

                                                                                                                          // The page size.
                                                                                                                          rasterizationOptions.PageSize = emfImage.Size;

                                                                                                                          // If embedded emf exists, then render emf; otherwise render wmf.
                                                                                                                          rasterizationOptions.RenderMode = Aspose.Imaging.FileFormats.Emf.EmfRenderMode.Auto;

                                                                                                                          // Set the horizontal margin
                                                                                                                          rasterizationOptions.BorderX = 50;

                                                                                                                          // Set the vertical margin
                                                                                                                          rasterizationOptions.BorderY = 50;

                                                                                                                          saveOptions.VectorRasterizationOptions = rasterizationOptions;

                                                                                                                          emfImage.Save(dir + "test.output.svg", saveOptions);
                                                                                                                      }

Constructors

EmfImage()

EMF画像で作業を開始し、新しいインスタンスを開始します。Aspose.Imaging.FileFormats.Emf.EmfImage クラス. EMF 画像を迅速に組み込むのに最適あなたのプロジェクトは、簡単で効率的です。

[JsonConstructor]
public EmfImage()

EmfImage(int、 int)

Aspose.Imaging.FileFormats.Emf.EmfImage クラスの新しい例を作成して幅を指定します。この構造は、初期化プロセスを簡素化します。特定のサイズのEMF画像で、開発の効率を高めるワークフロー

public EmfImage(int width, int height)

Parameters

width int

広さ。

height int

高さです。

Properties

BitsPerPixel

ビット/ピクセル数は、このパラメーターとして、ラスター画像に特定の数を回復します。ベクター画像には適用されません. ピクセルの深さを迅速に確認する正確な分析と操作のための画像、正確な処理を確保するためにイメージデータです。

public override int BitsPerPixel { get; }

不動産価値

int

Exceptions

NotImplementedException

ベクトル画像に不適切です。

FileFormat

オブジェクトに関連するファイル形式の値にアクセスします。スムーズな処理のためのオブジェクトに関連するファイルの形式と、互換性チェック. ファイル形式を取得することによって作業流を簡素化情報は簡単。

public override FileFormat FileFormat { get; }

不動産価値

FileFormat

Header

この属性でEMFメタフィルヘッダーレコードを復元または変更します。アプリ内のメタフィルデータを効率的に管理し、作業流を改善するメタフィルヘッダー情報へのアクセスを簡素化します。

public EmfMetafileHeader Header { get; set; }

不動産価値

EmfMetafileHeader

高さF

画像の高さを回復し、正確な rendering と layout の調整を容易にします。高さの特性へのアクセスは、互換性と無線の統合を確保します。さまざまなプラットフォームやアプリケーション

public override float HeightF { get; }

不動産価値

float

IsCached

オブジェクトのデータが現在暗号化されているかどうかを示す値にアクセスする追加のデータ読み込みの必要性を排除し、効率を迅速に向上させるcache データが即時アクセス可能であるかどうかを決定する。効率化されたデータ収集プロセスによるワークフロー。

public override bool IsCached { get; }

不動産価値

bool

Records

オブジェクトに関連する記録を復元または変更します。データの操作と処理を改善するための記録の収集を管理する。オブジェクトの記録と密接に相互作用することによって作業流を最適化します。

public override MetaObjectList Records { get; set; }

不動産価値

MetaObjectList

ウィドフ

画像の幅へのアクセス、正確に必要な情報を提供画像の幅を迅速に取り戻し、互換性を確保します。さまざまなアプリケーションやプラットフォーム内の適切な配置。

public override float WidthF { get; }

不動産価値

float

Methods

CacheData()

効率的にデータをキャッシュし、基礎からリダンダントロードを防ぐAspose.Imaging.DataStreamSupporter.DataStreamContainer この方法でアプリケーションにおけるパフォーマンスとデータアクセスのスムーズ化、リソースの最適化応答能力を向上させるための利用

public override void CacheData()

Examples

この例では、ファイルからEMF画像をアップロードする方法を示し、そのすべての記録をリストします。

string dir = "c:\\temp\\";

                                                                                              // Using Aspose.Imaging.Image.Load is a unified way to load all types of images including WMF.
                                                                                              using (Aspose.Imaging.FileFormats.Emf.EmfImage emfImage = (Aspose.Imaging.FileFormats.Emf.EmfImage)Aspose.Imaging.Image.Load(dir + "test.emf"))
                                                                                              {
                                                                                                  // Cache data to load all records.
                                                                                                  emfImage.CacheData();
                                                                                                  System.Console.WriteLine("The total number of records: {0}", emfImage.Records.Count);

                                                                                                  // The key is a record type, the value is number of records of that type in the WMF image.
                                                                                                  System.Collections.Generic.Dictionary<system.type, int=""> types =
                                                                                                      new System.Collections.Generic.Dictionary<system.type, int="">();

                                                                                                  // Gather statistics 
                                                                                                  foreach (Aspose.Imaging.FileFormats.Emf.Emf.Records.EmfRecord obj in emfImage.Records)
                                                                                                  {
                                                                                                      System.Type objType = obj.GetType();
                                                                                                      if (!types.ContainsKey(objType))
                                                                                                      {
                                                                                                          types.Add(objType, 1);
                                                                                                      }
                                                                                                      else
                                                                                                      {
                                                                                                          types[objType]++;
                                                                                                      }
                                                                                                  }

                                                                                                  // Print statistics
                                                                                                  System.Console.WriteLine("Record Type                              Count");
                                                                                                  System.Console.WriteLine("----------------------------------------------");
                                                                                                  foreach (System.Collections.Generic.KeyValuePair<system.type, int=""> entry in types)
                                                                                                  {
                                                                                                      string objectType = entry.Key.Name;
                                                                                                      string alignmentGap = new string(' ', 40 - objectType.Length);
                                                                                                      System.Console.WriteLine("{0}:{1}{2}", entry.Key.Name, alignmentGap, entry.Value);
                                                                                                  }
                                                                                              }

                                                                                              //The output may look like this:
                                                                                              //The total number of records: 1188
                                                                                              //Record Type                              Count
                                                                                              //----------------------------------------------
                                                                                              //EmfMetafileHeader:                       1
                                                                                              //EmfSetBkMode:                            1
                                                                                              //EmfSetTextAlign:                         1
                                                                                              //EmfSetRop2:                              1
                                                                                              //EmfSetWorldTransform:                    1
                                                                                              //EmfExtSelectClipRgn:                     1
                                                                                              //EmfCreateBrushIndirect:                  113
                                                                                              //EmfSelectObject:                         240
                                                                                              //EmfCreatePen:                            116
                                                                                              //EmfSetPolyFillMode:                      1
                                                                                              //EmfBeginPath:                            120
                                                                                              //EmfMoveToEx:                             122
                                                                                              //EmfPolyBezierTo16:                       36
                                                                                              //EmfLineTo:                               172
                                                                                              //EmfCloseFigure:                          14
                                                                                              //EmfEndPath:                              120
                                                                                              //EmfStrokeAndFillPath:                    113
                                                                                              //EmfStrokePath:                           7
                                                                                              //EmfSetTextColor:                         2
                                                                                              //EmfExtCreateFontIndirectW:               2
                                                                                              //EmfExtTextOutW:                          2
                                                                                              //EmfStretchBlt:                           1
                                                                                              //EmfEof:                                  1</system.type,></system.type,></system.type,>

GetDefaultOptions(対象[])

あなたの画像のデフォルトオプションを無力に回復します. この機能を使用すると、プレセットの設定に迅速にアクセスすることができ、無線の統合を確保し、あなたのプロジェクトのための最適なパフォーマンス. あなたの作業流を簡素化するのに最適です。あなたの画像を通じて一貫した結果を達成します。

public override ImageOptionsBase GetDefaultOptions(object[] args)

Parameters

args object ( )

主張は。

Returns

ImageOptionsBase

デフォルトオプション

GetOriginalOptions()

オリジナルの画像オプションを取得します。

public override ImageOptionsBase GetOriginalOptions()

Returns

ImageOptionsBase

オリジナルの画像オプション

GetUsedFonts()

この方法でメタフィル内で使用された文字のリストを復元します。フォントの使用に関する知識、効率的な管理とフォントの最適化を促進レディングとディスプレイの忠誠度を向上させるための資源。

public override string[] GetUsedFonts()

Returns

string ( )

フォントリスト

ResizeCanvas(Rectangle)

この機能を使用してカンバを簡単にリサイクルします. 全体を調整するのに最適です。画像のサイズを変更することなく、その内容を変更します。さまざまなディスプレイサイズの画像を簡単に準備します。

public override void ResizeCanvas(Rectangle newRectangle)

Parameters

newRectangle Rectangle

新しい直角。

SetPalette(ボール、ボール)

画像パレットを設定します。

public override void SetPalette(IColorPalette palette, bool updateColors)

Parameters

palette IColorPalette

パレットを設定する。

updateColors bool

「真実」に設定された色は、新しいパレットに従って更新されます; そうでなければ、色指数は変わらないままです. 変更されていない指数は、いくつかの指数が相応するパレットエントリーを持っていない場合、ロード上の画像が崩壊する可能性があります。

Exceptions

NotImplementedException

 日本語