Class EmfImage
이름 공간 : Aspose.Imaging.FileFormats.Emf 모임: Aspose.Imaging.dll (25.4.0)
API for Enhanced Metafile Format (EMF) 벡터 이미지 형식 지원장치 독립에서 그래픽 이미지를 처리하기위한 포괄적 인 도구그들의 원래 재산을 보존하는 동시에 방법.비율, 차원, 색상 및 기타 그래픽 속성, 그것은 포함EMF 플러스 형식 지원 및 농작물 지역, 회복 캔버스에 대한 기능그리고 이미지, 회전, 플리핑, 이미지 팔레트 설정, 수출 및 수입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 fromat로 변환하는 방법을 보여줍니다.
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(이트, 이트)
Aspose.Imaging.FileFormats.Emf.EmfImage 클래스의 새로운 예를 만들기그리고 높이 매개 변수.이 건축기는 시작하는 과정을 단순화합니다.특정 차원을 가진 EMF 이미지, 개발의 효율성을 향상작업 흐름
public EmfImage(int width, int height)
Parameters
width
int
넓은 넓은
height
int
높이에 대하여
Properties
BitsPerPixel
Retrieve the bit-per-pixel count specific to raster images, 이 매개 변수로벡터 이미지에 적용되지 않습니다. 빠르게 픽셀의 깊이를 확인정확한 분석 및 조작을 위한 이미지, 정확한 처리 보장이미지 데이터 입니다.
public override int BitsPerPixel { get; }
부동산 가치
Exceptions
벡터 이미지에 적용되지 않습니다.
FileFormat
객체와 관련된 파일 형식 값에 액세스하십시오.파일의 형식은 원활한 처리를 위한 대상과 관련된 파일의 형식이며,호환성 검사. 파일 형식을 복구함으로써 작업 흐름을 단순화쉬운 정보를 제공합니다.
public override FileFormat FileFormat { get; }
부동산 가치
Header
이 속성으로 EMF 메타필 헤더 레코드를 복구하거나 수정합니다.귀하의 응용 프로그램 내에서 메타필 데이터를 효율적으로 관리합니다.메타필 헤더 정보에 대한 간단한 액세스를 제공합니다.
public EmfMetafileHeader Header { get; set; }
부동산 가치
높이F
이미지의 높이를 회복하여 정확한 레이아웃 및 레이아웃 조정을 촉진합니다.높이 속성에 액세스하면 호환성과 무선 통합을 보장합니다.다양한 플랫폼 및 응용 프로그램
public override float HeightF { get; }
부동산 가치
IsCached
객체의 데이터가 현재 암호화되어 있는지 여부를 나타내는 값에 액세스하십시오.추가 데이터 읽기의 필요성을 제거합니다. 효율성을 빠르게 향상시킵니다.cache 데이터가 즉시 액세스할 수 있는지 확인합니다.효율적인 데이터 복구 프로세스와 함께 작업 흐름.
public override bool IsCached { get; }
부동산 가치
Records
개체와 관련된 기록을 복구하거나 수정합니다.효율적으로 액세스하고데이터 조작 및 처리를 향상시키기 위해 기록 수집을 관리합니다.객체의 기록과 끊임없이 상호 작용함으로써 작업 흐름을 최적화합니다.
public override MetaObjectList Records { get; set; }
부동산 가치
윈도우
이미지의 폭에 대한 액세스, 정확한 필수 정보를 제공rendering and processing. 빠르게 이미지의 폭을 복구하여 호환성을 보장합니다.그리고 다양한 응용 프로그램 및 플랫폼 내에서 적절한 배열.
public override float WidthF { get; }
부동산 가치
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
기본 옵션
GetOriginalOptions()
원본 이미지 옵션을 제공합니다.
public override ImageOptionsBase GetOriginalOptions()
Returns
원본 이미지 옵션
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
‘진짜’ 색상으로 설정하면 새 패널에 따라 업데이트됩니다; 그렇지 않으면 색상 지수는 변하지 않습니다.