Positioning
VectorRasterizationOptions.Positioning property
Får eller ställer in positioneringen.
public PositioningTypes Positioning { get; set; }
Fastighetsvärde
Positioneringen.
Exempel
Följande exempel visar hur man ställer in en minnesgräns när en CMX-bild laddas. Minnesgränsen är den högsta tillåtna storleken (i megabyte) för alla interna buffertar.
[C#]
string dir = "c:\\aspose.imaging\\issues\\net\\3419\\";
// Ange en minnesgräns på 10 megabyte för en målladdad bild.
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "example.cmx", new Aspose.Imaging.LoadOptions() { BufferSizeHint = 10 }))
{
image.Save(dir + "output.png",
new Aspose.Imaging.ImageOptions.PngOptions()
{
VectorRasterizationOptions =
new Aspose.Imaging.ImageOptions.CmxRasterizationOptions
{
TextRenderingHint = Aspose.Imaging.TextRenderingHint.SingleBitPerPixel,
SmoothingMode = Aspose.Imaging.SmoothingMode.AntiAlias,
Positioning = Aspose.Imaging.ImageOptions.PositioningTypes.DefinedByDocument
}
});
}
Följande exempel visar hur man exporterar alla sidor av CDR-dokument till PDF.
[C#]
string dir = "c:\\aspose.imaging\\issues\\net\\3635\\testdata\\3570";
string inputCdrFileName = System.IO.Path.Combine(dir, "tiger.cdr");
string outputPdfFileName = System.IO.Path.Combine(dir, "tiger.cdr.pdf");
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(inputCdrFileName))
{
Aspose.Imaging.ImageOptions.PdfOptions pdfOptions = new Aspose.Imaging.ImageOptions.PdfOptions();
Aspose.Imaging.ImageOptions.CdrRasterizationOptions rasterizationOptions = new Aspose.Imaging.ImageOptions.CdrRasterizationOptions
{
TextRenderingHint = Aspose.Imaging.TextRenderingHint.SingleBitPerPixel,
SmoothingMode = Aspose.Imaging.SmoothingMode.None,
Positioning = Aspose.Imaging.ImageOptions.PositioningTypes.DefinedByDocument
};
pdfOptions.VectorRasterizationOptions = rasterizationOptions;
image.Save(outputPdfFileName, pdfOptions);
}
Se även
- enum PositioningTypes
- class VectorRasterizationOptions
- namnutrymme Aspose.Imaging.ImageOptions
- hopsättning Aspose.Imaging