Class SvgImage
이름 공간 : Aspose.Imaging.FileFormats.Svg 모임: Aspose.Imaging.dll (25.4.0)
우리의 API를 사용하여 Scalar Vector Graphics (SVG) 이미지 파일을 조작하십시오.XML 기반 텍스트 형식의 힘은 무조건적인 사용자 정의 및 규모를 제공합니다.쉽게 SVG 이미지를 충전하고, 벡터 요소를 rasterize하고, 다른 형식으로 변환하고,동시에 압축 수준을 제어하여 프로젝트에 대한 파일 크기와 품질을 최적화합니다.
[JsonObject(MemberSerialization.OptIn)]
public sealed class SvgImage : VectorImage, IDisposable, IObjectWithBounds, IObjectWithSizeF, IHasXmpData, IHasMetadata
Inheritance
object ← DisposableObject ← DataStreamSupporter ← Image ← VectorImage ← SvgImage
Implements
IDisposable , IObjectWithBounds , IObjectWithSizeF , IHasXmpData , IHasMetadata
상속 회원들
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
다음 예제는 svgz 이미지를 svg fromat로 변환하는 방법을 보여줍니다.
string file = "example.svgz";
string baseFolder = System.IO.Path.Combine("D:", "Compressed");
string inputFile = System.IO.Path.Combine(baseFolder, file);
string outFile = inputFile + ".svg";
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(inputFile))
{
Aspose.Imaging.ImageOptions.VectorRasterizationOptions vectorRasterizationOptions = new Aspose.Imaging.ImageOptions.SvgRasterizationOptions() { PageSize = image.Size};
image.Save(outFile, new Aspose.Imaging.ImageOptions.SvgOptions() {VectorRasterizationOptions = vectorRasterizationOptions});
}
다음 예제는 svg 이미지를 svgz fromat로 변환하는 방법을 보여줍니다.
string file = "juanmontoya_lingerie.svg";
string baseFolder = System.IO.Path.Combine("D:", "Compressed");
string inputFile = System.IO.Path.Combine(baseFolder, file);
string outFile = inputFile + ".svgz";
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(inputFile))
{
Aspose.Imaging.ImageOptions.VectorRasterizationOptions vectorRasterizationOptions = new Aspose.Imaging.ImageOptions.SvgRasterizationOptions() { PageSize = image.Size};
image.Save(outFile, new Aspose.Imaging.ImageOptions.SvgOptions() {VectorRasterizationOptions = vectorRasterizationOptions, Compress = true});
}
이 예제는 파일 스트림에서 SVG 이미지를 로드하고 PNG로 라스테리화하는 방법을 보여줍니다.
string dir = "c:\\temp\\";
// Load an SVG image from a file stream.
using (System.IO.Stream stream = System.IO.File.OpenRead(dir + "test.svg"))
using (Aspose.Imaging.FileFormats.Svg.SvgImage svgImage = new Aspose.Imaging.FileFormats.Svg.SvgImage(stream))
{
// In order to rasterize SVG we need to specify rasterization options.
Aspose.Imaging.ImageOptions.SvgRasterizationOptions rasterizationOptions = new Aspose.Imaging.ImageOptions.SvgRasterizationOptions();
Aspose.Imaging.ImageOptions.PngOptions saveOptions = new Aspose.Imaging.ImageOptions.PngOptions();
saveOptions.VectorRasterizationOptions = rasterizationOptions;
svgImage.Save(dir + "test.output.png", saveOptions);
}
다음 예제는 압축 된 이미지를 변환하는 방법을 보여줍니다 (엠즈 ,.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});
}
}
Constructors
SvgImage(스트리트)
Aspose.Imaging.FileFormats.Svg.SvgImage 클래스의 새로운 개체를 설치하여지정된 경로를 위치하고 이미지를 충전합니다.이 건축기는외부 파일에서 SVG 이미지 사례를 생성하여 무선을 가능하게 합니다.소프트웨어 시스템 및 작업 흐름에 통합.
public SvgImage(string path)
Parameters
path
string
이미지를 로드하고 픽셀과 팔레트 데이터를 시작하는 경로.
Exceptions
길은 0이다.
SvgImage(Stream)
Aspose.Imaging.FileFormats.Svg.SvgImage 클래스의 새로운 사례를 만들고 이미지를 업로드합니다.제공되는 흐름에서.이 건축기는 SVG의 직접 충전을 허용합니다.흐름의 이미지, 이미지 처리의 유연성과 효율성을 향상시킵니다소프트웨어 응용 프로그램 내의 자원.
public SvgImage(Stream stream)
Parameters
stream
Stream
흐름에서 이미지를 로드하고 픽셀과 팔레트 데이터를 시작합니다.
Examples
이 예제는 파일 스트림에서 SVG 이미지를 로드하고 PNG로 라스테리화하는 방법을 보여줍니다.
string dir = "c:\\temp\\";
// Load an SVG image from a file stream.
using (System.IO.Stream stream = System.IO.File.OpenRead(dir + "test.svg"))
using (Aspose.Imaging.FileFormats.Svg.SvgImage svgImage = new Aspose.Imaging.FileFormats.Svg.SvgImage(stream))
{
// In order to rasterize SVG we need to specify rasterization options.
Aspose.Imaging.ImageOptions.SvgRasterizationOptions rasterizationOptions = new Aspose.Imaging.ImageOptions.SvgRasterizationOptions();
Aspose.Imaging.ImageOptions.PngOptions saveOptions = new Aspose.Imaging.ImageOptions.PngOptions();
saveOptions.VectorRasterizationOptions = rasterizationOptions;
svgImage.Save(dir + "test.output.png", saveOptions);
}
Exceptions
흐름은 0입니다.
SvgImage(이트, 이트)
새 Aspose.Imaging.FileFormats.Svg.SvgImage 개체를 지정된 폭과높이.이 건축기는 개발자가 미리 설정된 SVG 이미지를 만들 수 있습니다.크기, 이미지의 크기에 대한 정확한 통제를 촉진하는이니셔티브
public SvgImage(int width, int height)
Parameters
width
int
그림의 넓이.
height
int
이미지 높이 입니다.
SvgImage(옵션, int, int)
Aspose.Imaging.FileFormats.Svg.SvgImage 클래스를 특정 SVG로 새로 만듭니다.옵션, 이미지 폭 및 높이 매개 변수.이 건축기는개발자는 사용자 지정 옵션과 차원으로 SVG 이미지를 시작할 수 있습니다.SVG 콘텐츠 및 레이아웃 관리에 대한 유연성을 제공합니다.
public SvgImage(SvgOptions svgOptions, int width, int height)
Parameters
svgOptions
SvgOptions
SVG 옵션
width
int
넓은 이미지
height
int
이미지 높이
Properties
BitsPerPixel
이미지의 픽셀 계산에 비트를 반환합니다.그것은 주목하는 것이 중요합니다이 매개 변수는 벡터 이미지에 적용되지 않습니다, 그들은 측정되지 않습니다이 속성은 이미지의 색상에 대한 중요한 정보를 제공합니다.깊이, 처리 및 조작 작업에 도움이됩니다.
public override int BitsPerPixel { get; }
부동산 가치
Exceptions
벡터 이미지에 대한 장애
FileFormat
이미지의 파일 형식을 복구하여 필수 메타 데이터를 제공합니다.처리 및 호환성 검사.이 재산은 도구적입니다적절한 디코딩 및 암호화 전략을 결정하여다양한 시스템 및 응용 프로그램을 통해 효과적으로 이미지 데이터를 제공합니다.
public override FileFormat FileFormat { get; }
부동산 가치
IsCached
객체의 데이터가 현재 있는지 여부를 나타내는 볼륨 값을 반환합니다.cache, 추가 데이터 읽기 작업에 대한 필요성을 제거합니다.재산은 현재의 캐싱 상태에 대한 통찰력을 제공하고 데이터를 최적화합니다.성능과 효율성을 향상시키기 위해 작업 흐름을 복구하고 처리합니다.
public override bool IsCached { get; }
부동산 가치
XmpData
XMP 데이터를 얻거나 설정합니다.
public XmpPacketWrapper XmpData { get; set; }
부동산 가치
Methods
CacheData()
데이터를 숨기고 더 이상 데이터를 충전하지 않을 것이라고 보장합니다.기본 Aspose.Imaging.DataStreamSupporter.DataStreamContainer. 이최적화 성능을 향상시키는 것은 낭비적인 데이터 복구를 제거함으로써운영, 특히 자주 접근해야 하는 시나리오에서 유익한이미지 데이터
public override void CacheData()
Crop(Rectangle)
지정된 직경을 찢어 버립니다.
public override void Crop(Rectangle rectangle)
Parameters
rectangle
Rectangle
오른쪽 쪽 쪽
GetDefaultOptions(객체[])
이미지를 위해 구성된 기본 옵션을 복구하여 기본 라인을 제공합니다.다양한 작업에 대한 설정, 예를 들어 재설치, 압축, 또는 암호화.이 방법은 일관된 행동과 품질 표준을 보장하는 데 필수적입니다.이미지 처리 작업은 명확한 파라미터화가 필요하지 않습니다.
public override ImageOptionsBase GetDefaultOptions(object[] args)
Parameters
args
object
[ ] [ [ ]
그들의 논쟁들
Returns
기본 옵션
GetImage2Export(ImageOptionsBase, Rectangle, IImageExporter에 대한 정보)
이미지를 수출하는 방법을 알려드립니다.
protected override Image GetImage2Export(ImageOptionsBase optionsBase, Rectangle boundsRectangle, IImageExporter exporter)
Parameters
optionsBase
ImageOptionsBase
이미지 옵션 기반.
boundsRectangle
Rectangle
오른쪽으로 묶여있다.
exporter
IImageExporter
그리고 수출자
Returns
이미지 수출
ReleaseManagedResources()
관리된 자원을 풀어주십시오. 관리되지 않은 자원이 여기에서 풀어주지 않도록하십시오.이 자원은 이미 풀어주었을 수도 있기 때문에.
protected override void ReleaseManagedResources()
Resize(인트, 인트, ResizeType)
이미지를 재구성하여 지정된 차원에 맞게 유지하고 동시에 그것의 모양을 유지합니다.이 방법은 이미지의 크기를 조정하는 편리한 방법을 제공합니다.그것의 비율을 방해하지 않고, 최적의 표시 또는 저장을 보장원하는 차원에 따라
public override void Resize(int newWidth, int newHeight, ResizeType resizeType)
Parameters
newWidth
int
새로운 광도 입니다.
newHeight
int
새로운 높이 입니다.
resizeType
ResizeType
리세스 타입이죠.
Rotate(플로트)
센터 주위에 사진을 회전합니다.
public override void Rotate(float angle)
Parameters
angle
float
긍정적 값은 시계로 회전합니다.
SaveData(Stream)
데이터를 저장합니다.
protected override void SaveData(Stream stream)
Parameters
stream
Stream
데이터를 저장하기위한 스트림.
SetPalette(바이올린, 바이올린)
그림에 특정 팔레트를 적용하여 색상의 사용자 정의를 가능하게 합니다.예술적 또는 기능적 목적을 위한 계획.이 방법은 유연성을 제공합니다.다양한 디자인 또는 응용 요구 사항에 맞게 색상 팔레트를 관리합니다.
public override void SetPalette(IColorPalette palette, bool updateColors)
Parameters
palette
IColorPalette
팔레트를 설정합니다.
updateColors
bool
‘진짜’ 색상으로 설정하면 새 패널에 따라 업데이트됩니다; 그렇지 않으면 색상 지수는 변하지 않습니다.