Class WmfImage

Class WmfImage

이름 공간 : Aspose.Imaging.FileFormats.Wmf 모임: Aspose.Imaging.dll (25.4.0)

우리의 API를 사용하여 Microsoft Windows Metafile (WMF) 이미지를 조작하십시오.변수 길이 기록 내에 저장된 벡터 및 비트 맵 데이터를 모두 처리합니다.사용자 지정 이미지 팔레트를 설정하는 동안 쉽게 이미지를 재구성, 회전 및 플립합니다.WMF 파일을 압축 WMZ 형식으로 변환하거나 라스터 이미지 형식으로 저장플랫폼 및 응용 프로그램에 걸쳐 다양한 사용을 제공합니다.

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

Inheritance

object DisposableObject DataStreamSupporter Image VectorImage MetaImage WmfImage

Implements

IDisposable , IObjectWithBounds , IObjectWithSizeF

상속 회원들

MetaImage.GetUsedFonts() , MetaImage.GetMissedFonts() , MetaImage.ResizeCanvas(Rectangle) , MetaImage.GetCanNotSaveMessage(ImageOptionsBase) , MetaImage.SaveData(Stream) , 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.Modify(RectangleF, float, float, 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.UpdateContainer(Image) , Image.GetCanNotSaveMessage(ImageOptionsBase) , Image.GetFitRectangle(Rectangle) , Image.GetImage2Export(ImageOptionsBase, Rectangle, IImageExporter) , Image.GetFitRectangle(Rectangle, int[]) , Image.OnPaletteChanged(IColorPalette, IColorPalette) , Image.OnPaletteChanging(IColorPalette, IColorPalette) , Image.ReleaseManagedResources() , 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.timeout , DataStreamSupporter.CacheData() , DataStreamSupporter.Save() , DataStreamSupporter.Save(Stream) , DataStreamSupporter.Save(string) , DataStreamSupporter.Save(string, bool) , DataStreamSupporter.SaveData(Stream) , DataStreamSupporter.ReleaseManagedResources() , DataStreamSupporter.OnDataStreamContainerChanging(StreamContainer) , DataStreamSupporter.DataStreamContainer , DataStreamSupporter.IsCached , DisposableObject.Dispose() , DisposableObject.ReleaseManagedResources() , DisposableObject.ReleaseUnmanagedResources() , DisposableObject.VerifyNotDisposed() , DisposableObject.Disposed , object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()

Examples

다음 예제는 wmz 이미지를 wmf fromat로 변환하는 방법을 보여줍니다.

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

다음 예제는 wmf 이미지를 wmz fromat로 변환하는 방법을 보여줍니다.

string file = "castle.wmf";
                                                                                string baseFolder = System.IO.Path.Combine("D:", "Compressed");
                                                                                string inputFile = System.IO.Path.Combine(baseFolder, file);
                                                                                string outFile = inputFile + ".wmz";
                                                                                using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(inputFile))
                                                                                {
                                                                                    Aspose.Imaging.ImageOptions.VectorRasterizationOptions vectorRasterizationOptions = new Aspose.Imaging.ImageOptions.WmfRasterizationOptions() { PageSize = image.Size};
                                                                                    image.Save(outFile, new Aspose.Imaging.ImageOptions.WmfOptions() {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});
                                                                                                                    }
                                                                                                                }

이 예제는 파일에서 WMF 이미지를 업로드하고 WmfRasterizationOptions를 사용하여 SVG로 변환하는 방법을 보여줍니다.

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.Wmf.WmfImage wmfImage = (Aspose.Imaging.FileFormats.Wmf.WmfImage)Aspose.Imaging.Image.Load(dir + "test.wmf"))
                                                                                                                      {
                                                                                                                          Aspose.Imaging.ImageOptions.SvgOptions saveOptions = new Aspose.Imaging.ImageOptions.SvgOptions();

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

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

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

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

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

                                                                                                                          saveOptions.VectorRasterizationOptions = rasterizationOptions;

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

Constructors

WmfImage()

Aspose.Imaging.FileFormats.Wmf.WmfImage 클래스의 새로운 예를 만드십시오.Windows Metafile (WMF) 이미지 데이터의 추가 조작 및 처리.건축기는 WMF 이미지와 함께 작업하기위한 기본 개체를 제공합니다.WMF 이미지 처리 능력의 무제한 통합 응용 프로그램에기능을 위한

[JsonConstructor]
public WmfImage()

WmfImage(이트, 이트)

Aspose.Imaging.FileFormats.Wmf.WmfImage 클래스를 사용하여 사용자 지정할 수 있는 새로운 사례를 설치하세요.폭 및 높이 매개 변수, 흰색 WMF 이미지의 생성을 촉진특정 차원에 적응합니다.이 건축기를 사용하여 역동적으로 생성합니다.정확한 차원을 가진 WMF 이미지, 유연한 이미지 생성 및귀하의 응용 프로그램 내에서의 조작.

public WmfImage(int width, int height)

Parameters

width int

넓은 넓은

height int

높이에 대하여

Properties

BitsPerPixel

이미지에 대한 픽셀 당 비트의 수를 회복하여 색상 수준을 나타냅니다.깊이 또는 granularity.이 속성을 사용하여 이미지의 색깔을 결정하십시오.표현 및 정확성, 호환성 검사 및 색상 관련을 촉진귀하의 신청서 내에서 처리합니다.

[JsonIgnore]
public override int BitsPerPixel { get; }

부동산 가치

int

Exceptions

NotImplementedException

FileFormat

이미지와 관련된 파일 형식 값에 액세스, 정보를 제공사진이 저장되는 형식에 대해.이 속성을 사용하여이미지의 파일 형식, 호환성 검사를 촉진하고귀하의 응용 프로그램 내에서 특정 형식 처리.

public override FileFormat FileFormat { get; }

부동산 가치

FileFormat

FrameBounds

프레임의 경계에 접근하여 프레임 내의 위치와 차원을 나타냅니다.이 자산을 사용하여 프레임에 대한 자세한 정보를 얻으십시오.공간 위치, 당신의 응용 프로그램 내에서 정확한 조작 및 렌더링을 가능하게합니다.

public Rectangle FrameBounds { get; }

부동산 가치

Rectangle

높이F

이미지의 높이에 액세스, 그것의 수직을 따라 픽셀의 수를 나타냅니다이 속성을 사용하여 이미지의 공간 차원과 측면을 확인하십시오.비율, 정확한 배열을 허용하고 응용 프로그램 내에서 조정을 수행합니다.

public override float HeightF { get; }

부동산 가치

float

Exceptions

NotImplementedException

Inch

액세스 또는 인치 속성을 변경하여 일반적으로 측정 단위를 나타냅니다.인쇄 또는 디스플레이 컨텍스트에서 물리적 차원을 지정하는 데 사용됩니다.이미지와 관련된 인치 값을 설정하거나 수신하는 재산,귀하의 응용 프로그램 내에서 물리적 차원의 정확한 표현을 촉진합니다.

public int Inch { get; set; }

부동산 가치

int

IsCached

객체의 데이터가 현재 암호화되어 있는지 여부를 나타내는 볼륨 값을 복구하십시오.추가 데이터 읽기 작업에 대한 필요성을 제거합니다.이 재산을 사용하십시오.객체의 데이터가 쉽게 사용할 수 있는지 결정함으로써 성능을 최적화합니다.귀하의 신청서 내에서 비싼 데이터 복구 프로세스가 필요하지 않습니다.

public override bool IsCached { get; }

부동산 가치

bool

Exceptions

NotImplementedException

윈도우

이미지의 폭에 액세스하여 그림을 따라 픽셀의 수를 나타냅니다.이 속성을 사용하여 이미지의 공간적 차원을 결정하십시오.그리고 측면 비율, 정확한 배열을 허용하고 내부에서 조정응용 프로그램

public override float WidthF { get; }

부동산 가치

float

Exceptions

NotImplementedException

Methods

AddRecord(WmfObject)

지정된 레코드 개체를 이미지에 삽입하여 콘텐츠를 풍요롭게 합니다.추가 데이터 또는 메타 데이터.이 방법을 사용하여 기록을 무조건 통합하십시오.이미지에 개체, 포괄적 인 데이터 저장 및 조직을 촉진귀하의 신청서 내에서

public int AddRecord(WmfObject record)

Parameters

record WmfObject

그 기록을

Returns

int

기록의 숫자

CacheData()

효율적으로 데이터를 암호화하여 추가 충전의 필요성을 제거합니다.아래 Aspose.Imaging.DataStreamSupporter.DataStreamContainer.이를 사용하십시오성능을 최적화하고 응용 프로그램 내에서 자원 사용을 최소화하는 방법현지 데이터 캐시를 저장하고 액세스함으로써.

public override void CacheData()

Examples

이 예제는 파일에서 WMF 이미지를 업로드하고 모든 기록을 나열하는 방법을 보여줍니다.

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.Wmf.WmfImage wmfImage = (Aspose.Imaging.FileFormats.Wmf.WmfImage)Aspose.Imaging.Image.Load(dir + "test.wmf"))
                                                                                              {
                                                                                                  // Cache data to load all records.
                                                                                                  wmfImage.CacheData();
                                                                                                  System.Console.WriteLine("The total number of records: {0}", wmfImage.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.Wmf.Objects.WmfObject obj in wmfImage.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: 613
                                                                                              //Record Type                              Count
                                                                                              //----------------------------------------------
                                                                                              //WmfSetBkMode:                            1
                                                                                              //WmfSetTextAlign:                         1
                                                                                              //WmfSetRop2:                              1
                                                                                              //WmfSetWindowOrg:                         1
                                                                                              //WmfSetWindowExt:                         1
                                                                                              //WmfCreateBrushInDirect:                  119
                                                                                              //WmfSelectObject:                         240
                                                                                              //WmfCreatePenInDirect:                    119
                                                                                              //WmfSetPolyFillMode:                      1
                                                                                              //WmfPolyPolygon:                          114
                                                                                              //WmfPolyLine:                             7
                                                                                              //WmfSetTextColor:                         2
                                                                                              //WmfCreateFontInDirect:                   2
                                                                                              //WmfExtTextOut:                           2
                                                                                              //WmfDibStrechBlt:                         1
                                                                                              //WmfEof:                                  1</system.type,></system.type,></system.type,>

Exceptions

NotImplementedException

GetDefaultOptions(객체[])

이미지와 관련된 기본 옵션을 복구하여 액세스를 제공합니다.사전 설정 또는 구성.이 방법을 사용하여 기본 액세스이미지 처리 작업을 위한 설정, 일관성과 편의성을 촉진귀하의 응용 프로그램의 기능 내에서

public override ImageOptionsBase GetDefaultOptions(object[] args)

Parameters

args object [ ] [ [ ]

그들의 논쟁들

Returns

ImageOptionsBase

기본 옵션

GetOriginalOptions()

원본 이미지 옵션을 제공합니다.

public override ImageOptionsBase GetOriginalOptions()

Returns

ImageOptionsBase

원본 이미지 옵션

GetPostScript()

이미지와 관련된 PostScript 데이터에 액세스하여 자세한 내용을 제공합니다.그것의 구조 또는 내용에 대한 정보.이 방법을 사용하여귀하의 응용 프로그램 내에서 추가 분석 또는 처리를 위한 PostScript 데이터,PostScript rendering 또는 manipulation과 관련된 고급 기능을 제공합니다.

public string GetPostScript()

Returns

string

포스트 스크립트

GetUsedFonts()

메타필 내에서 사용되는 글꼴 목록을 복구하여 메타필에 대한 통찰력을 제공합니다.그림에서 사용되는 텍스트 자원.이 방법을 사용하여 텍스트 사용을 분석합니다.그리고 귀하의 응용 프로그램 내에서 프레젠테이션 또는 추가 처리에 대한 글꼴 사용 가능성을 보장합니다.

public override string[] GetUsedFonts()

Returns

string [ ] [ [ ]

폰트 목록

ResizeCanvas(Rectangle)

이미지의 캔버스를 재구성하고, 이미지의 차원을 조정하면서 이미지를 유지합니다.이 방법을 사용하여 캔버스의 크기를 변경하지 않고 캔버스를 변경합니다.콘텐츠, 레이아웃 조정 및 구성 변경을 촉진응용 프로그램

public override void ResizeCanvas(Rectangle newRectangle)

Parameters

newRectangle Rectangle

새로운 직경을 니다.

Exceptions

NotImplementedException

SetPalette(바이올린, 바이올린)

그림에 지정된 팔레트를 적용하여 색상 조정이 가능합니다.이 방법을 사용하여 시각적 렌더링 및 비즈니스를 향상시킵니다.귀하의 응용 프로그램 내에서 특정 색상 효과.

public override void SetPalette(IColorPalette palette, bool updateColors)

Parameters

palette IColorPalette

팔레트를 설정합니다.

updateColors bool

‘진짜’ 색상으로 설정하면 새 패널에 따라 업데이트됩니다; 그렇지 않으면 색상 지표가 변함없이 남아 있습니다. 변경되지 않은 지표가 일부 지표가 패널 입력과 일치하지 않는 경우 충전에서 이미지를 파괴 할 수 있음을 명심하십시오.

Exceptions

NotImplementedException

 한국어