Class DicomImage
Το όνομα: Aspose.Imaging.FileFormats.Dicom Συγκέντρωση: Aspose.Imaging.dll (25.4.0)
Αυτή η τάξη εφαρμόζει την ψηφιακή εικόνα και την επικοινωνία στην ιατρική(DICOM) υποστηρίζει τη μορφή εικόνας raster και προσφέρει μια ολοκληρωμένη λύση γιαεπεξεργασία εικόνων DICOM με ακρίβεια και ευελιξία.χειραγώγηση σελίδων εικόνας, συμπεριλαμβανομένων των εργασιών για την απόκτηση, προσθήκη ή αφαίρεση σελίδων, καιέλεγχο των προεπιλεγμένων και ενεργών σελίδων. με την ικανότητα να εργάζονται με αλφα κανάλια,ενσωματώσει τα μεταδεδομένα XMP, αναζωογόνηση, περιστροφή, καλλιέργεια, δυαδικότητα, προσαρμογή, εφαρμογή φίλτρων,και να μετατρέψετε σε άλλες μορφές raster. Αυτό το API επιτρέπει στους προγραμματιστές να χειριστούνDICOM εικόνες αποτελεσματικά, ενώ ανταποκρίνεται στις διάφορες απαιτήσεις εφαρμογήςΠεριεχόμενο ιατρικής απεικόνισης.
[JsonObject(MemberSerialization.OptIn)]
public sealed class DicomImage : RasterCachedMultipageImage, IDisposable, IObjectWithBounds, IRasterImageArgb32PixelLoader, IRasterImageRawDataLoader, IHasXmpData, IHasMetadata, IMultipageImageExt, IMultipageImage
Inheritance
object ← DisposableObject ← DataStreamSupporter ← Image ← RasterImage ← RasterCachedImage ← RasterCachedMultipageImage ← DicomImage
Implements
IDisposable , IObjectWithBounds , IRasterImageArgb32PixelLoader , IRasterImageRawDataLoader , IHasXmpData , IHasMetadata , IMultipageImageExt , IMultipageImage
Κληρονομημένα μέλη
RasterCachedMultipageImage.AdjustBrightness(int) , RasterCachedMultipageImage.AdjustContrast(float) , RasterCachedMultipageImage.AdjustGamma(float, float, float) , RasterCachedMultipageImage.AdjustGamma(float) , RasterCachedMultipageImage.Blend(Point, RasterImage, Rectangle, byte) , RasterCachedMultipageImage.BinarizeFixed(byte) , RasterCachedMultipageImage.BinarizeBradley(double, int) , RasterCachedMultipageImage.BinarizeBradley(double) , RasterCachedMultipageImage.BinarizeOtsu() , RasterCachedMultipageImage.Crop(Rectangle) , RasterCachedMultipageImage.Crop(int, int, int, int) , RasterCachedMultipageImage.Dither(DitheringMethod, int, IColorPalette) , RasterCachedMultipageImage.Grayscale() , RasterCachedMultipageImage.NormalizeHistogram() , RasterCachedMultipageImage.Rotate(float, bool, Color) , RasterCachedMultipageImage.RotateFlip(RotateFlipType) , RasterCachedMultipageImage.RotateFlipAll(RotateFlipType) , RasterCachedMultipageImage.Resize(int, int, ResizeType) , RasterCachedMultipageImage.Resize(int, int, ImageResizeSettings) , RasterCachedMultipageImage.ResizeWidthProportionally(int, ResizeType) , RasterCachedMultipageImage.ResizeHeightProportionally(int, ResizeType) , RasterCachedMultipageImage.ReplaceColor(int, byte, int) , RasterCachedMultipageImage.ReplaceNonTransparentColors(int) , RasterCachedMultipageImage.Filter(Rectangle, FilterOptionsBase) , RasterCachedMultipageImage.NormalizeAngle(bool, Color) , RasterCachedMultipageImage.CacheData() , RasterCachedMultipageImage.GetSerializedStream(ImageOptionsBase, Rectangle, out int) , RasterCachedMultipageImage.Height , RasterCachedMultipageImage.Width , RasterCachedMultipageImage.BitsPerPixel , RasterCachedMultipageImage.IsCached , RasterCachedMultipageImage.PageCount , RasterCachedMultipageImage.Pages , RasterCachedMultipageImage.HasAlpha , RasterCachedMultipageImage.HasTransparentColor , RasterCachedMultipageImage.ImageOpacity , RasterCachedMultipageImage.BackgroundColor , RasterCachedMultipageImage.XmpData , RasterCachedMultipageImage.PageExportingAction , RasterCachedImage.CacheData() , RasterCachedImage.Blend(Point, RasterImage, Rectangle, byte) , RasterCachedImage.Resize(int, int, ResizeType) , RasterCachedImage.Resize(int, int, ImageResizeSettings) , RasterCachedImage.RotateFlip(RotateFlipType) , RasterCachedImage.Rotate(float, bool, Color) , RasterCachedImage.Crop(Rectangle) , RasterCachedImage.Dither(DitheringMethod, int, IColorPalette) , RasterCachedImage.Grayscale() , RasterCachedImage.NormalizeHistogram() , RasterCachedImage.BinarizeFixed(byte) , RasterCachedImage.BinarizeOtsu() , RasterCachedImage.BinarizeBradley(double, int) , RasterCachedImage.BinarizeBradley(double) , RasterCachedImage.AdjustBrightness(int) , RasterCachedImage.AdjustContrast(float) , RasterCachedImage.AdjustGamma(float, float, float) , RasterCachedImage.AdjustGamma(float) , RasterCachedImage.IsCached , RasterImage.RemoveMetadata() , RasterImage.Save(Stream, ImageOptionsBase, Rectangle) , RasterImage.GetModifyDate(bool) , RasterImage.Dither(DitheringMethod, int) , RasterImage.Dither(DitheringMethod, int, IColorPalette) , RasterImage.GetDefaultPixels(Rectangle, IPartialArgb32PixelLoader) , RasterImage.GetDefaultRawData(Rectangle, IPartialRawDataLoader, RawDataSettings) , RasterImage.GetDefaultArgb32Pixels(Rectangle) , RasterImage.GetDefaultRawData(Rectangle, RawDataSettings) , RasterImage.GetArgb32Pixel(int, int) , RasterImage.GetPixel(int, int) , RasterImage.SetArgb32Pixel(int, int, int) , RasterImage.SetPixel(int, int, Color) , RasterImage.ReadScanLine(int) , RasterImage.ReadArgb32ScanLine(int) , RasterImage.WriteScanLine(int, Color[]) , RasterImage.WriteArgb32ScanLine(int, int[]) , RasterImage.LoadPartialArgb32Pixels(Rectangle, IPartialArgb32PixelLoader) , RasterImage.LoadPartialPixels(Rectangle, IPartialPixelLoader) , RasterImage.LoadArgb32Pixels(Rectangle) , RasterImage.LoadArgb64Pixels(Rectangle) , RasterImage.LoadPartialArgb64Pixels(Rectangle, IPartialArgb64PixelLoader) , RasterImage.LoadPixels(Rectangle) , RasterImage.LoadCmykPixels(Rectangle) , RasterImage.LoadCmyk32Pixels(Rectangle) , RasterImage.LoadRawData(Rectangle, RawDataSettings, IPartialRawDataLoader) , RasterImage.LoadRawData(Rectangle, Rectangle, RawDataSettings, IPartialRawDataLoader) , RasterImage.SaveRawData(byte[], int, Rectangle, RawDataSettings) , RasterImage.SaveArgb32Pixels(Rectangle, int[]) , RasterImage.SavePixels(Rectangle, Color[]) , RasterImage.SaveCmykPixels(Rectangle, CmykColor[]) , RasterImage.SaveCmyk32Pixels(Rectangle, int[]) , RasterImage.SetResolution(double, double) , RasterImage.SetPalette(IColorPalette, bool) , RasterImage.Resize(int, int, ImageResizeSettings) , RasterImage.Rotate(float, bool, Color) , RasterImage.Rotate(float) , RasterImage.BinarizeFixed(byte) , RasterImage.BinarizeOtsu() , RasterImage.BinarizeBradley(double) , RasterImage.BinarizeBradley(double, int) , RasterImage.Blend(Point, RasterImage, Rectangle, byte) , RasterImage.Blend(Point, RasterImage, byte) , RasterImage.Grayscale() , RasterImage.NormalizeHistogram() , RasterImage.AdjustBrightness(int) , RasterImage.AdjustContrast(float) , RasterImage.AdjustGamma(float, float, float) , RasterImage.AdjustGamma(float) , RasterImage.GetSkewAngle() , RasterImage.NormalizeAngle() , RasterImage.NormalizeAngle(bool, Color) , RasterImage.Filter(Rectangle, FilterOptionsBase) , RasterImage.ReplaceColor(Color, byte, Color) , RasterImage.ReplaceColor(int, byte, int) , RasterImage.ReplaceNonTransparentColors(Color) , RasterImage.ReplaceNonTransparentColors(int) , RasterImage.ToBitmap() , RasterImage.PremultiplyComponents , RasterImage.UseRawData , RasterImage.UpdateXmpData , RasterImage.XmpData , RasterImage.RawIndexedColorConverter , RasterImage.RawCustomColorConverter , RasterImage.RawFallbackIndex , RasterImage.RawDataSettings , RasterImage.UsePalette , RasterImage.RawDataFormat , RasterImage.RawLineSize , RasterImage.IsRawDataAvailable , RasterImage.HorizontalResolution , RasterImage.VerticalResolution , RasterImage.HasTransparentColor , RasterImage.HasAlpha , RasterImage.TransparentColor , RasterImage.ImageOpacity , 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
Αλλαγή τύπου χρώματος σε συμπίεση DICOM.
using (var inputImage = Image.Load("original.jpg"))
{
var options = new DicomOptions { ColorType = ColorType.Grayscale8Bit };
inputImage.Save("original_8Bit.dcm", options);
}
Χρησιμοποιήστε τη συμπίεση RLE στην εικόνα DICOM.
using (var inputImage = Image.Load("original.jpg"))
{
var options = new DicomOptions
{
ColorType = ColorType.Rgb24Bit,
Compression = new Compression { Type = CompressionType.Rle }
};
inputImage.Save("original_RLE.dcm", options);
}
Χρησιμοποιήστε τη συμπίεση JPEG 2000 σε εικόνα DICOM.
using (var inputImage = Image.Load("original.jpg"))
{
var options = new DicomOptions
{
ColorType = ColorType.Rgb24Bit,
Compression = new Compression
{
Type = CompressionType.Jpeg2000,
Jpeg2000 = new Jpeg2000Options
{
Codec = Jpeg2000Codec.Jp2,
Irreversible = false
}
}
};
inputImage.Save("original_JPEG2000.dcm", options);
}
Χρησιμοποιήστε τη συμπίεση JPEG σε εικόνα DICOM.
using (var inputImage = Image.Load("original.jpg"))
{
var options = new DicomOptions
{
ColorType = ColorType.Rgb24Bit,
Compression = new Compression
{
Type = CompressionType.Jpeg,
Jpeg = new JpegOptions
{
CompressionType = JpegCompressionMode.Baseline,
SampleRoundingMode = SampleRoundingMode.Truncate,
Quality = 50
}
}
};
inputImage.Save("original_JPEG.dcm", options);
}
Αυτό το παράδειγμα δείχνει πώς να φορτώσετε μια εικόνα DICOM από μια ροή αρχείων.
string dir = "c:\\temp\\";
// Load a DICOM image from a file stream.
using (System.IO.Stream stream = System.IO.File.OpenRead(dir + "sample.dicom"))
{
using (Aspose.Imaging.FileFormats.Dicom.DicomImage dicomImage = new Aspose.Imaging.FileFormats.Dicom.DicomImage(stream))
{
// Save each page as an individual PNG image.
foreach (Aspose.Imaging.FileFormats.Dicom.DicomPage dicomPage in dicomImage.DicomPages)
{
// Generate a file name based on the page index.
string fileName = string.Format("sample.{0}.png", dicomPage.Index);
// A DICOM page is a raster image, so all allowed operations with a raster image are applicable to a DICOM page.
dicomPage.Save(dir + fileName, new Aspose.Imaging.ImageOptions.PngOptions());
}
}
}
Δημιουργήστε μια πολλαπλή εικόνα Dicom.
using (DicomImage image = (DicomImage)Image.Create(
new DicomOptions() { Source = new StreamSource(new MemoryStream()) },
100,
100))
{
// Draw something using vector graphics
Graphics graphics = new Graphics(image);
graphics.FillRectangle(new SolidBrush(Color.BlueViolet), image.Bounds);
graphics.FillRectangle(new SolidBrush(Color.Aqua), 10, 20, 50, 20);
graphics.FillEllipse(new SolidBrush(Color.Orange), 30, 50, 70, 30);
// Save the pixels of the drawn image. They are now on the first page of the Dicom image.
int[] pixels = image.LoadArgb32Pixels(image.Bounds);
// Add a few pages after, making them darker
for (int i = 1; i < 5; i++)
{
DicomPage page = image.AddPage();
page.SaveArgb32Pixels(page.Bounds, pixels);
page.AdjustBrightness(i * 30);
}
// Add a few pages in front of the main page, making them brighter
for (int i = 1; i < 5; i++)
{
DicomPage page = image.InsertPage(0);
page.SaveArgb32Pixels(page.Bounds, pixels);
page.AdjustBrightness(-i * 30);
}
// Save the created multi-page image to the output file
image.Save("MultiPage.dcm");
}
Constructors
DicomImage(Ετικέτες, int, int)
Ξεκινήστε μια νέα περίπτωση της κατηγορίας DicomImage χωρίς προσπάθεια με αυτόκατασκευαστής, χρησιμοποιώντας dicomOptions παραμέτρους. ιδανικό για τους προγραμματιστές που αναζητούνγια να βυθίσει στο Aspose.Imaging.FileFormats.Dicom.DicomImage αντικείμενα γρήγορα και αποτελεσματικά στα έργα τους.
public DicomImage(DicomOptions dicomOptions, int width, int height)
Parameters
dicomOptions
DicomOptions
Οι επιλογές του DICOM.
width
int
Το πλάτος .
height
int
Το ύψος.
DicomImage(Σύνδεση, LoadOptions)
Ξεκινήστε μια νέα περίπτωση της κατηγορίας DicomImage ομαλά χρησιμοποιώντας ένα ρεύμα καιφορτίοΕπιλογές παραμέτρων σε αυτό το κατασκευαστή. ιδανικό για τους προγραμματιστές που επιθυμούν να ξεκινήσουνΣυνεργασία με Aspose.Imaging.FileFormats.Dicom.DicomImage αντικείμενα γρήγορα και αποτελεσματικά στα έργα τους.
public DicomImage(Stream stream, LoadOptions loadOptions)
Parameters
stream
Stream
Το ρεύμα.
loadOptions
LoadOptions
Οι επιλογές φορτίου.
Examples
Αυτό το παράδειγμα δείχνει πώς να φορτώσετε μια εικόνα DICOM από μια ροή αρχείων για να παραμείνετε εντός του καθορισμένου ορίου μνήμης.
string dir = "c:\\temp\\";
// Load a DICOM image from a file stream.
using (System.IO.Stream stream = System.IO.File.OpenRead(dir + "multiframe.dicom"))
{
// The max allowed size for all internal buffers is 256KB.
Aspose.Imaging.LoadOptions loadOptions = new Aspose.Imaging.LoadOptions();
loadOptions.BufferSizeHint = 256 * 1024;
using (Aspose.Imaging.FileFormats.Dicom.DicomImage dicomImage = new Aspose.Imaging.FileFormats.Dicom.DicomImage(stream, loadOptions))
{
// Save each page as an individual PNG image.
foreach (Aspose.Imaging.FileFormats.Dicom.DicomPage dicomPage in dicomImage.DicomPages)
{
// Generate a file name based on the page index.
string fileName = string.Format("multiframe.{0}.png", dicomPage.Index);
// A DICOM page is a raster image, so all allowed operations with a raster image are applicable to a DICOM page.
dicomPage.Save(dir + fileName, new Aspose.Imaging.ImageOptions.PngOptions());
}
}
}
DicomImage(Stream)
Δημιουργήστε μια νέα παράσταση της κατηγορίας DicomImage χρησιμοποιώντας ένα παράμετρο ροήςιδανικό για τους προγραμματιστές που αναζητούν έναν ευέλικτο τρόπο για να ξεκινήσουνAspose.Imaging.FileFormats.Dicom.DicomImage αντικείμενα από υπάρχοντες ροές δεδομένων στα έργα τους.
public DicomImage(Stream stream)
Parameters
stream
Stream
Το ρεύμα.
Examples
Αυτό το παράδειγμα δείχνει πώς να φορτώσετε μια εικόνα DICOM από μια ροή αρχείων.
string dir = "c:\\temp\\";
// Load a DICOM image from a file stream.
using (System.IO.Stream stream = System.IO.File.OpenRead(dir + "sample.dicom"))
{
using (Aspose.Imaging.FileFormats.Dicom.DicomImage dicomImage = new Aspose.Imaging.FileFormats.Dicom.DicomImage(stream))
{
// Save each page as an individual PNG image.
foreach (Aspose.Imaging.FileFormats.Dicom.DicomPage dicomPage in dicomImage.DicomPages)
{
// Generate a file name based on the page index.
string fileName = string.Format("sample.{0}.png", dicomPage.Index);
// A DICOM page is a raster image, so all allowed operations with a raster image are applicable to a DICOM page.
dicomPage.Save(dir + fileName, new Aspose.Imaging.ImageOptions.PngOptions());
}
}
}
Properties
ActivePage
Διαχειριστείτε την ενεργή σελίδα της εικόνας με αυτό το διαισθητικό χαρακτηριστικό. ιδανικό για τους προγραμματιστέςεπιδιώκουν να μετακινούνται δυναμικά μεταξύ σελίδων μέσα σε εικόνες πολλών σελίδων, εξασφαλίζοντας αποτελεσματικήΝαυτιλία και επεξεργασία.
public DicomPage ActivePage { get; set; }
Αξία ιδιοκτησίας
Exceptions
Η ενεργή σελίδα δεν μπορεί να ρυθμιστεί καθώς ανήκει σε άλλη εικόνα.
ActivePageIndex
Ανακτήστε τον δείκτη της ενεργού σελίδας χωρίς προσπάθεια με αυτή την διαισθητική ιδιότητα.Ιδανικό για τους προγραμματιστές που αναζητούν γρήγορη πρόσβαση στον τρέχοντα δείκτη σελίδας μέσα σε πολλές σελίδεςεικόνες, εξασφαλίζοντας αποτελεσματική πλοήγηση και επεξεργασία.
public int ActivePageIndex { get; }
Αξία ιδιοκτησίας
DicomPages
Πρόσβαση στις σελίδες της εικόνας με αυτή τη διαισθητική ιδιότητα. ιδανικό για τους προγραμματιστέςεπιδιώκουν να αλληλεπιδρούν με μεμονωμένες σελίδες εντός της εικόνας, διασφαλίζοντας την αδιάβροχηΝαυτιλία και χειραγώγηση.
public DicomPage[] DicomPages { get; }
Αξία ιδιοκτησίας
DicomPage [ ]
FileFormat
Αποκαταστήστε την αξία της μορφής αρχείων χωρίς προσπάθεια με αυτή την διαισθητική ιδιότητα.οι προγραμματιστές που αναζητούν γρήγορη πρόσβαση στη μορφή του αρχείου εικόνας, εξασφαλίζοντας την αποτελεσματικήΔιαχείριση και επεξεργασία βάσει του τύπου αρχείου.
public override FileFormat FileFormat { get; }
Αξία ιδιοκτησίας
FileInfo
Αποκτήστε πολύτιμες πληροφορίες επικεφαλής από το αρχείο DICOM χωρίς προσπάθεια με αυτόΙδανικό για τους προγραμματιστές που αναζητούν γρήγορη πρόσβαση σε βασικές λεπτομέρειεςενσωματωμένο στο αρχείο DICOM, εξασφαλίζοντας αποτελεσματική εξόρυξη και ανάλυση δεδομένων.
public DicomImageInfo FileInfo { get; }
Αξία ιδιοκτησίας
HasAlpha
Ανακαλύψτε αν η εικόνα έχει ένα αλφα κανάλι χωρίς προσπάθεια με αυτό το διαισθητικόΙδανικό για τους προγραμματιστές που επιδιώκουν να προσδιορίσουν αν η εικόνα περιέχει διαφάνειαΠληροφορίες, εξασφαλίζοντας την ακριβή επεξεργασία των δεδομένων αλφα κανάλι σε εργασίες επεξεργασίας εικόνας.
public override bool HasAlpha { get; }
Αξία ιδιοκτησίας
PageCount
Αποκτήστε τον συνολικό αριθμό σελίδων της εικόνας με αυτή τη διαισθητική ιδιότητα.Οι προγραμματιστές που αναζητούν γρήγορη πρόσβαση στον αριθμό των σελίδων μέσα σε μια εικόνα, εξασφαλίζουνΑποτελεσματική πλοήγηση και διαχείριση.
public override int PageCount { get; }
Αξία ιδιοκτησίας
Pages
Πρόσβαση στις σελίδες της εικόνας με αυτή τη διαισθητική ιδιότητα. ιδανικό για τους προγραμματιστέςεπιδιώκουν να αλληλεπιδρούν με μεμονωμένες σελίδες εντός της εικόνας, εξασφαλίζοντας αδιάβροχη πλοήγησηκαι τη χειραγώγηση.
public override Image[] Pages { get; }
Αξία ιδιοκτησίας
Image [ ]
Methods
AddPage(RasterImage)
Επεκτείνετε τη συλλογή εικόνων σας προσθέτοντας μια νέα σελίδα με αυτή τη διαισθητική μέθοδο.Ιδανικό για τους προγραμματιστές που επιδιώκουν να προσθέσουν δυναμικά σελίδες σε εικόνες πολλών σελίδων,εξασφάλιση της αδιάλειπτης επέκτασης και οργάνωσης του περιεχομένου εικόνας.
public void AddPage(RasterImage page)
Parameters
page
RasterImage
Η σελίδα που πρέπει να προσθέσετε.
Exceptions
page’ is null.
AddPage()
Προσθέστε μια νέα σελίδα στο τέλος της λίστας σελίδων της εικόνας με αυτή την απλή μέθοδο.Ιδανικό για τους προγραμματιστές που επιδιώκουν να επεκτείνουν δυναμικά τις εικόνες πολλών σελίδων, διασφαλίζοντας την αδιάβροχηΕνσωμάτωση και οργάνωση περιεχομένου εικόνας.
public DicomPage AddPage()
Returns
Η νέα δημιουργία Aspose.Imaging.FileFormats.Dicom.DicomPage.
Examples
Δημιουργήστε μια πολλαπλή εικόνα Dicom.
using (DicomImage image = (DicomImage)Image.Create(
new DicomOptions() { Source = new StreamSource(new MemoryStream()) },
100,
100))
{
// Draw something using vector graphics
Graphics graphics = new Graphics(image);
graphics.FillRectangle(new SolidBrush(Color.BlueViolet), image.Bounds);
graphics.FillRectangle(new SolidBrush(Color.Aqua), 10, 20, 50, 20);
graphics.FillEllipse(new SolidBrush(Color.Orange), 30, 50, 70, 30);
// Save the pixels of the drawn image. They are now on the first page of the Dicom image.
int[] pixels = image.LoadArgb32Pixels(image.Bounds);
// Add a few pages after, making them darker
for (int i = 1; i < 5; i++)
{
DicomPage page = image.AddPage();
page.SaveArgb32Pixels(page.Bounds, pixels);
page.AdjustBrightness(i * 30);
}
// Add a few pages in front of the main page, making them brighter
for (int i = 1; i < 5; i++)
{
DicomPage page = image.InsertPage(0);
page.SaveArgb32Pixels(page.Bounds, pixels);
page.AdjustBrightness(-i * 30);
}
// Save the created multi-page image to the output file
image.Save("MultiPage.dcm");
}
AdjustBrightness(ΕΝΤ)
Βελτιώνει την φωτεινότητα της εικόνας με την προσαρμογή της brightness’, μια συστηματοποιημένη μέθοδος που επιτρέπει στους προγραμματιστές να τόνισαν τέλεια την φωτεινότητα των εικόνων.Αυτή η φιλική προς τον χρήστη λειτουργία επιτρέπει στους προγραμματιστές να χειρίζονται αδιάφορα την φωτεινότητα της εικόνας, προσφέροντας ευελιξία και τον έλεγχο της οπτικής αισθητικής.
public override void AdjustBrightness(int brightness)
Parameters
brightness
int
Η αξία της φωτεινότητας.
Examples
Το παρακάτω παράδειγμα εκτελεί διόρθωση φωτεινότητας μιας εικόνας DICOM.
string dir = "c:\\temp\\";
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
Aspose.Imaging.FileFormats.Dicom.DicomImage dicomImage = (Aspose.Imaging.FileFormats.Dicom.DicomImage)image;
// Set the brightness value. The accepted values of brightness are in the range [-255, 255].
dicomImage.AdjustBrightness(50);
dicomImage.Save(dir + "sample.AdjustBrightness.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
AdjustContrast(Πλοία)
Βελτίωση Aspose.Imaging.Image αντίθεση με αυτή τη μέθοδο φιλική προς τον χρήστη,προσαρμόζει τη διαφορά μεταξύ του φωτός και των σκοτεινών περιοχών, βελτιώνει την οπτική σαφήνεια καιΟρισμός χωρίς προσπάθεια, παρέχοντας στους προγραμματιστές με διαισθητικό έλεγχοΑντίθεση εικόνας για βέλτιστη rendering.
public override void AdjustContrast(float contrast)
Parameters
contrast
float
Αξία σύγκρουσης (σε εύρος [-100· 100])
Examples
Το παρακάτω παράδειγμα εκτελεί διόρθωση αντίθεσης μιας εικόνας DICOM.
string dir = "c:\\temp\\";
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
Aspose.Imaging.FileFormats.Dicom.DicomImage dicomImage = (Aspose.Imaging.FileFormats.Dicom.DicomImage)image;
// Set the contrast value. The accepted values of contrast are in the range [-100f, 100f].
dicomImage.AdjustContrast(50f);
dicomImage.Save(dir + "sample.AdjustContrast.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
AdjustGamma(Πλοία)
Βελτιώνει την ποιότητα της εικόνας και την προσαρμόζει με τη διόρθωση γκάμα, μια ισχυρή τεχνικήιδανικό για τους προγραμματιστές που επιδιώκουν να βελτιστοποιήσουν την εικόναπαρουσίαση, προσαρμογή της ισορροπίας των χρωμάτων, και εξασφάλιση συνεκτικής rendering σε διάφορασυσκευές και περιβάλλοντα.
public override void AdjustGamma(float gamma)
Parameters
gamma
float
Gamma για κόκκινα, πράσινα και μπλε κανάλια συντελεστή
Examples
Το παρακάτω παράδειγμα εκτελεί διόρθωση γκάμα μιας εικόνας DICOM.
string dir = "c:\\temp\\";
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
Aspose.Imaging.FileFormats.Dicom.DicomImage dicomImage = (Aspose.Imaging.FileFormats.Dicom.DicomImage)image;
// Set gamma coefficient for red, green and blue channels.
dicomImage.AdjustGamma(2.5f);
dicomImage.Save(dir + "sample.AdjustGamma.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
AdjustGamma(Πλοία, Πλοία, Πλοία)
Αποκτήστε ακριβείς ρυθμίσεις χρωμάτων εφαρμόζοντας ανεξάρτητα τη διόρθωση γκάμαστα κόκκινα, πράσινα και μπλε συστατικά μιας εικόνας. αυτή η μέθοδος εξασφαλίζει την ακρίβειαισορροπία χρωμάτων και βέλτιστη οπτική απόδοση, τροφοδοσία για τους προγραμματιστές που αναζητούν granularέλεγχο της απεικόνισης και της ακρίβειας των χρωμάτων.
public override void AdjustGamma(float gammaRed, float gammaGreen, float gammaBlue)
Parameters
gammaRed
float
Γκάμα για τον συντελεστή κόκκινου καναλιού
gammaGreen
float
Γκάμα για τον συντελεστή πράσινου καναλιού
gammaBlue
float
Γκάμα για τον συντελεστή μπλε κανάλι
Examples
Το παρακάτω παράδειγμα εκτελεί γκάμα-διόρθωση μιας εικόνας DICOM που εφαρμόζει διαφορετικούς συντελεστές για τα συστατικά χρωμάτων.
string dir = "c:\\temp\\";
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
Aspose.Imaging.FileFormats.Dicom.DicomImage dicomImage = (Aspose.Imaging.FileFormats.Dicom.DicomImage)image;
// Set individual gamma coefficients for red, green and blue channels.
dicomImage.AdjustGamma(1.5f, 2.5f, 3.5f);
dicomImage.Save(dir + "sample.AdjustGamma.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
BinarizeBradley(ΔΥΟ, ΔΥΟ)
Binarize εικόνες με το προσαρμοστικό αλγόριθμο οριοθέτησης του Bradley, εκτοξεύοντας ολοκληρωμένοτο όριο εικόνας για βελτιωμένη απόδοση. ιδανικό για τους προγραμματιστές που αναζητούναυτοματοποιήστε τις εικόνες με βάση τις τοπικές παραλλαγές φωτεινότητας, εξασφαλίζονταςακριβής ανίχνευση και εξόρυξη αντικειμένων σε διαφορετικές συνθήκες φωτισμού.
public override void BinarizeBradley(double brightnessDifference, int windowSize)
Parameters
brightnessDifference
double
Η διαφορά φωτεινότητας μεταξύ του pixel και του μέσου ενός s x s παράθυρο των pixelΚέντρο γύρω από αυτό το pixel.
windowSize
int
Το μέγεθος του παραθύρου s x s των pixels που επικεντρώνονται γύρω από αυτό το pixel
Examples
Το παρακάτω παράδειγμα δυαδικοποιεί μια εικόνα DICOM με το προσαρμοστικό αλγόριθμο οριοθέτησης του Bradley με το καθορισμένο μέγεθος παραθύρου.
string dir = "c:\\temp\\";
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
Aspose.Imaging.FileFormats.Dicom.DicomImage dicomImage = (Aspose.Imaging.FileFormats.Dicom.DicomImage)image;
// Binarize the image with a brightness difference of 5. The brightness is a difference between a pixel and the average of an 10 x 10 window of pixels centered around this pixel.
dicomImage.BinarizeBradley(5, 10);
dicomImage.Save(dir + "sample.BinarizeBradley5_10x10.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
BinarizeFixed(Μπίτι)
Εύκολα μετατρέψτε την εικόνα σε δυαδικό μορφότυπο χρησιμοποιώντας ένα προκαθορισμένο όριοιδανικό για τους προγραμματιστές που θέλουν να απλοποιήσουν την εικόναεπεξεργασία εργασιών με τη διαίρεση της εικόνας σε εμπρός και πίσω συστατικάμε βάση τα καθορισμένα επίπεδα έντασης.
public override void BinarizeFixed(byte threshold)
Parameters
threshold
byte
Εάν η αντίστοιχη γκρίζα αξία ενός pixel είναι μεγαλύτερη από το όριο, η τιμή του255 θα ανατεθεί σε αυτό, 0 διαφορετικά.
Examples
Το παρακάτω παράδειγμα δυαδικοποιεί μια εικόνα DICOM με το προκαθορισμένο όριο. οι δυαδικές εικόνες περιέχουν μόνο 2 χρώματα - μαύρο και λευκό.
string dir = "c:\\temp\\";
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
Aspose.Imaging.FileFormats.Dicom.DicomImage dicomImage = (Aspose.Imaging.FileFormats.Dicom.DicomImage)image;
// Binarize the image with a threshold value of 127.
// If a corresponding gray value of a pixel is greater than 127, a value of 255 will be assigned to it, 0 otherwise.
dicomImage.BinarizeFixed(127);
dicomImage.Save(dir + "sample.BinarizeFixed.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
BinarizeOtsu()
Εφαρμόστε το όριο Otsu για να δυαδικοποιήσετε την εικόνα, καθορίζοντας αυτόματα το βέλτιστοτο όριο της αξίας βάσει του ιστογράμματος της εικόνας. ιδανικό για τους προγραμματιστές που αναζητούνΜια αξιόπιστη μέθοδος για την κατανομή των εικόνων σε προκαταρκτικές και οπτικές περιοχές μεελάχιστη χειροκίνητη παρέμβαση.
public override void BinarizeOtsu()
Examples
Το παρακάτω παράδειγμα δυαδικοποιεί μια εικόνα DICOM με το όριο Otsu. οι δυαδικές εικόνες περιέχουν μόνο 2 χρώματα - μαύρο και λευκό.
string dir = "c:\\temp\\";
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
Aspose.Imaging.FileFormats.Dicom.DicomImage dicomImage = (Aspose.Imaging.FileFormats.Dicom.DicomImage)image;
// Binarize the image with Otsu thresholding.
dicomImage.BinarizeOtsu();
dicomImage.Save(dir + "sample.BinarizeOtsu.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
CacheData()
Αυτή η μέθοδος αποθηκεύει αποτελεσματικά τα δεδομένα, βελτιστοποιεί την απόδοση και εξασφαλίζει γρήγορη πρόσβασηιδανικό για τους προγραμματιστές που επιδιώκουν να βελτιώσουν την ταχύτητα και την αποτελεσματικότητα τωνΕφαρμογές με έξυπνη διαχείριση των πόρων δεδομένων.
public override void CacheData()
Examples
Το παρακάτω παράδειγμα δείχνει πώς να αποθηκεύσετε όλες τις σελίδες μιας εικόνας DICOM.
string dir = "c:\\temp\\";
// Load an image from a DICOM file.
using (Aspose.Imaging.FileFormats.Dicom.DicomImage image = (Aspose.Imaging.FileFormats.Dicom.DicomImage)Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
// This call caches all the pages so that no additional data loading will be performed from the underlying data stream.
image.CacheData();
// Or you can cache the pages individually.
foreach (Aspose.Imaging.FileFormats.Dicom.DicomPage page in image.DicomPages)
{
page.CacheData();
}
}
Crop(Rectangle)
Καλλιεργήστε την εικόνα για να αφαιρέσετε τις ανεπιθύμητες περιοχές και να επικεντρωθείτε στο απαραίτητο περιεχόμενο με αυτόΙδανικό για τους προγραμματιστές που επιδιώκουν να προσαρμόσουν την οπτική σύνθεσηεικόνες, διασφαλίζοντας ότι μεταδίδουν αποτελεσματικά το επιθυμητό μήνυμα.
public override void Crop(Rectangle rectangle)
Parameters
rectangle
Rectangle
Η Ορθόδοξη.
Examples
Το παρακάτω παράδειγμα καλλιεργεί μια εικόνα DICOM. Η περιοχή καλλιέργειας καθορίζεται μέσω Aspose.Imaging.Rectangle.
string dir = "c:\\temp\\";
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
Aspose.Imaging.FileFormats.Dicom.DicomImage dicomImage = (Aspose.Imaging.FileFormats.Dicom.DicomImage)image;
// Crop the image. The cropping area is the rectangular central area of the image.
Aspose.Imaging.Rectangle area = new Aspose.Imaging.Rectangle(dicomImage.Width / 4, dicomImage.Height / 4, dicomImage.Width / 2, dicomImage.Height / 2);
dicomImage.Crop(area);
// Save the cropped image to PNG
dicomImage.Save(dir + "sample.Crop.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
Crop(Ιντ, Ιντ, Ιντ)
Προσαρμόστε την περιοχή κοπής της εικόνας εφαρμόζοντας αλλαγές με αυτή την ευέλικτη μέθοδο.Ιδανικό για τους προγραμματιστές που χρειάζονται ακριβή έλεγχο της διαδικασίας συγκομιδής, εξασφαλίζονταςΟι σημαντικές λεπτομέρειες διατηρούνται ενώ εξαλείφονται τα περιττά στοιχεία.
public override void Crop(int leftShift, int rightShift, int topShift, int bottomShift)
Parameters
leftShift
int
Η αριστερή αλλαγή.
rightShift
int
Η σωστή αλλαγή.
topShift
int
Η κορυφαία αλλαγή.
bottomShift
int
Η κατώτερη αλλαγή.
Examples
Το παρακάτω παράδειγμα καλλιεργεί μια εικόνα DICOM. Η περιοχή καλλιέργειας καθορίζεται μέσω των αριστερών, ανώτερων, δεξιών, κάτω περιθωρίων.
string dir = @"c:\temp\";
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
Aspose.Imaging.FileFormats.Dicom.DicomImage dicomImage = (Aspose.Imaging.FileFormats.Dicom.DicomImage)image;
// Crop again. Set a margin of 10% of the image size.
int horizontalMargin = dicomImage.Width / 10;
int verticalMargin = dicomImage.Height / 10;
dicomImage.Crop(horizontalMargin, horizontalMargin, verticalMargin, verticalMargin);
// Save the cropped image to PNG.
dicomImage.Save(dir + "sample.Crop.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
Dither(ΔΙΤΥΡΙΑΣΜΟΔΟΣ, INT, IColorPalette)
Βελτιώστε την τρέχουσα εικόνα με την εφαρμογή των αποτελεσμάτων dithering με αυτό απλόΙδανικό για τους προγραμματιστές που επιδιώκουν να προσθέσουν κείμενο και βάθος στις εικόνες,βελτίωση της οπτικής ποιότητας και της συνολικής ελκυστικότητάς τους.
public override void Dither(DitheringMethod ditheringMethod, int bitsCount, IColorPalette customPalette)
Parameters
ditheringMethod
DitheringMethod
Η μεθοδολογία της διαιτησίας.
bitsCount
int
Οι τελευταίες μπάτσες μετράνε για διτρισμό.
customPalette
IColorPalette
Η συνηθισμένη παλέτα για διτρισμό.
Examples
Το παρακάτω παράδειγμα φορτώνει μια εικόνα DICOM και εκτελεί το όριο και το κολύμπι dithering χρησιμοποιώντας διαφορετικό βάθος παλέτας.
string dir = "c:\\temp\\";
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
Aspose.Imaging.FileFormats.Dicom.DicomImage dicomImage = (Aspose.Imaging.FileFormats.Dicom.DicomImage)image;
// Perform threshold dithering using 4-bit color palette which contains 16 colors.
// The more bits specified the higher quality and the bigger size of the output image.
// Note that only 1-bit, 4-bit and 8-bit palettes are supported at the moment.
dicomImage.Dither(Aspose.Imaging.DitheringMethod.ThresholdDithering, 4, null);
dicomImage.Save(dir + "sample.ThresholdDithering4.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
Aspose.Imaging.FileFormats.Dicom.DicomImage dicomImage = (Aspose.Imaging.FileFormats.Dicom.DicomImage)image;
// Perform floyd dithering using 1-bit color palette which contains only 2 colors - black and white.
// The more bits specified the higher quality and the bigger size of the output image.
// Note that only 1-bit, 4-bit and 8-bit palettes are supported at the moment.
dicomImage.Dither(Aspose.Imaging.DitheringMethod.FloydSteinbergDithering, 1, null);
dicomImage.Save(dir + "sample.FloydSteinbergDithering1.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
Filter(Πλαίσιο, FilterOptionsBase)
Αναβαθμίστε με επιτυχία συγκεκριμένες περιοχές της εικόνας σας με την εφαρμογή φίλτρων σε καθορισμένεςΑυτή η μέθοδος παρέχει στους προγραμματιστές ακριβή έλεγχοχειραγώγηση εικόνας, επιτρέποντας στοχευμένες προσαρμογές για να επιτευχθεί το επιθυμητόοπτικά αποτελέσματα με ευκολία.
public override void Filter(Rectangle rectangle, FilterOptionsBase options)
Parameters
rectangle
Rectangle
Η Ορθόδοξη.
options
FilterOptionsBase
Οι επιλογές .
Examples
Το παρακάτω παράδειγμα εφαρμόζει διάφορους τύπους φίλτρων σε μια εικόνα DICOM.
string dir = "c:\\temp\\";
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
Aspose.Imaging.FileFormats.Dicom.DicomImage dicomImage = (Aspose.Imaging.FileFormats.Dicom.DicomImage)image;
// Apply a median filter with a rectangle size of 5 to the entire image.
dicomImage.Filter(dicomImage.Bounds, new Aspose.Imaging.ImageFilters.FilterOptions.MedianFilterOptions(5));
dicomImage.Save(dir + "sample.MedianFilter.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
Aspose.Imaging.FileFormats.Dicom.DicomImage dicomImage = (Aspose.Imaging.FileFormats.Dicom.DicomImage)image;
// Apply a bilateral smoothing filter with a kernel size of 5 to the entire image.
dicomImage.Filter(dicomImage.Bounds, new Aspose.Imaging.ImageFilters.FilterOptions.BilateralSmoothingFilterOptions(5));
dicomImage.Save(dir + "sample.BilateralSmoothingFilter.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
Aspose.Imaging.FileFormats.Dicom.DicomImage dicomImage = (Aspose.Imaging.FileFormats.Dicom.DicomImage)image;
// Apply a Gaussian blur filter with a radius of 5 and a sigma value of 4.0 to the entire image.
dicomImage.Filter(dicomImage.Bounds, new Aspose.Imaging.ImageFilters.FilterOptions.GaussianBlurFilterOptions(5, 4.0));
dicomImage.Save(dir + "sample.GaussianBlurFilter.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
Aspose.Imaging.FileFormats.Dicom.DicomImage dicomImage = (Aspose.Imaging.FileFormats.Dicom.DicomImage)image;
// Apply a Gauss-Wiener filter with a radius of 5 and a smooth value of 4.0 to the entire image.
dicomImage.Filter(dicomImage.Bounds, new Aspose.Imaging.ImageFilters.FilterOptions.GaussWienerFilterOptions(5, 4.0));
dicomImage.Save(dir + "sample.GaussWienerFilter.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
Aspose.Imaging.FileFormats.Dicom.DicomImage dicomImage = (Aspose.Imaging.FileFormats.Dicom.DicomImage)image;
// Apply a motion wiener filter with a length of 5, a smooth value of 4.0 and an angle of 90.0 degrees to the entire image.
dicomImage.Filter(dicomImage.Bounds, new Aspose.Imaging.ImageFilters.FilterOptions.MotionWienerFilterOptions(10, 1.0, 90.0));
dicomImage.Save(dir + "sample.MotionWienerFilter.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
Aspose.Imaging.FileFormats.Dicom.DicomImage dicomImage = (Aspose.Imaging.FileFormats.Dicom.DicomImage)image;
// Apply a sharpen filter with a kernel size of 5 and a sigma value of 4.0 to the entire image.
dicomImage.Filter(dicomImage.Bounds, new Aspose.Imaging.ImageFilters.FilterOptions.SharpenFilterOptions(5, 4.0));
dicomImage.Save(dir + "sample.SharpenFilter.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
Grayscale()
Εύκολα μετατρέποντας τις εικόνες σε γκρίζα αντιπροσωπεία, απλοποιώντας την οπτικήαναλυτικά και επεξεργαστικά καθήκοντα. ιδανικό για τους προγραμματιστές που επιδιώκουν να βελτιώσουν την σαφήνεια της εικόνας,Μείωση της πολυπλοκότητας και διευκόλυνση των αποτελεσματικών αλγόριθμων βάσει γκρισκάλουγια διάφορες εφαρμογές.
public override void Grayscale()
Examples
Το παρακάτω παράδειγμα μετατρέπει μια πολύχρωμη εικόνα DICOM στη γκρίζα αντιπροσωπεία της. οι εικόνες γκρίζας αποτελούνται αποκλειστικά από σκιές γκρι και φέρουν μόνο πληροφορίες έντασης.
string dir = "c:\\temp\\";
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
Aspose.Imaging.FileFormats.Dicom.DicomImage dicomImage = (Aspose.Imaging.FileFormats.Dicom.DicomImage)image;
dicomImage.Grayscale();
dicomImage.Save(dir + "sample.Grayscale.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
InsertPage(ΕΝΤ)
Εισάγετε μια νέα σελίδα στη λίστα σελίδων της εικόνας σε ένα καθορισμένο δείκτη με αυτό το διαισθητικόΙδανικό για τους προγραμματιστές που αναζητούν ακριβή έλεγχο για τη διάταξη των σελίδωνπολλαπλές σελίδες εικόνων, εξασφαλίζοντας αδιάλειπτη οργάνωση και προσαρμογή του περιεχομένου εικόνας.
public DicomPage InsertPage(int pageIndex)
Parameters
pageIndex
int
Δείκτης της σελίδας.
Returns
Η νέα δημιουργία Aspose.Imaging.FileFormats.Dicom.DicomPage.
Examples
Δημιουργήστε μια πολλαπλή εικόνα Dicom.
using (DicomImage image = (DicomImage)Image.Create(
new DicomOptions() { Source = new StreamSource(new MemoryStream()) },
100,
100))
{
// Draw something using vector graphics
Graphics graphics = new Graphics(image);
graphics.FillRectangle(new SolidBrush(Color.BlueViolet), image.Bounds);
graphics.FillRectangle(new SolidBrush(Color.Aqua), 10, 20, 50, 20);
graphics.FillEllipse(new SolidBrush(Color.Orange), 30, 50, 70, 30);
// Save the pixels of the drawn image. They are now on the first page of the Dicom image.
int[] pixels = image.LoadArgb32Pixels(image.Bounds);
// Add a few pages after, making them darker
for (int i = 1; i < 5; i++)
{
DicomPage page = image.AddPage();
page.SaveArgb32Pixels(page.Bounds, pixels);
page.AdjustBrightness(i * 30);
}
// Add a few pages in front of the main page, making them brighter
for (int i = 1; i < 5; i++)
{
DicomPage page = image.InsertPage(0);
page.SaveArgb32Pixels(page.Bounds, pixels);
page.AdjustBrightness(-i * 30);
}
// Save the created multi-page image to the output file
image.Save("MultiPage.dcm");
}
Exceptions
pageIndex’ is out of range.
ReleaseManagedResources()
Απελευθέρωση των διαχειριζόμενων πόρων. βεβαιωθείτε ότι δεν κυκλοφορούν μη διαχειριζόμενοι πόροι εδώ, καθώς μπορεί να έχουνΈχει ήδη απελευθερωθεί.
protected override void ReleaseManagedResources()
RemovePage(ΕΝΤ)
Αφαιρέστε τη σελίδα στον καθορισμένο δείκτη από τη λίστα σελίδων με αυτή τη βολική μέθοδο.Ιδανικό για τους προγραμματιστές που αναζητούν ακριβή έλεγχο της διαχείρισης πολλών σελίδων εικόνων,εξασφάλιση αδιάλειπτης οργάνωσης και προσαρμογής του περιεχομένου εικόνας.
public void RemovePage(int pageIndex)
Parameters
pageIndex
int
Δείκτης της σελίδας.
Exceptions
pageIndex’ is out of range.
Resize(ΠΕΡΙΣΣΟΤΕΡΑ, ΕΠΙΧΕΙΡΗΣΗ)
Προσαρμόστε το μέγεθος της εικόνας με αυτή την απλή μέθοδο. ιδανικό για τους προγραμματιστέςαναζητώντας να αναζωογονεί δυναμικά τις εικόνες, διασφαλίζοντας ότι ταιριάζουν αδιάλειπτα σε διάφορεςΠεριεχόμενα και διατάξεις μέσα στις εφαρμογές τους.
public override void Resize(int newWidth, int newHeight, ResizeType resizeType)
Parameters
newWidth
int
Το νέο πλάτος.
newHeight
int
Το νέο ύψος.
resizeType
ResizeType
Ο τύπος αναζωογόνησης.
Examples
Αυτό το παράδειγμα φορτώνει μια εικόνα DICOM και την αναζωογονεί χρησιμοποιώντας διάφορες μεθόδους αναζωογόνησης.
string dir = "c:\\temp\\";
using (Aspose.Imaging.FileFormats.Dicom.DicomImage image = (Aspose.Imaging.FileFormats.Dicom.DicomImage)Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
// Scale up by 2 times using Nearest Neighbour resampling.
image.Resize(image.Width* 2, image.Height* 2, Aspose.Imaging.ResizeType.NearestNeighbourResample);
// Save to PNG with default options.
image.Save(dir + "upsample.nearestneighbour.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
using (Aspose.Imaging.FileFormats.Dicom.DicomImage image = (Aspose.Imaging.FileFormats.Dicom.DicomImage)Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
// Scale down by 2 times using Nearest Neighbour resampling.
image.Resize(image.Width / 2, image.Height / 2, Aspose.Imaging.ResizeType.NearestNeighbourResample);
// Save to PNG with default options.
image.Save(dir + "downsample.nearestneighbour.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
using (Aspose.Imaging.FileFormats.Dicom.DicomImage image = (Aspose.Imaging.FileFormats.Dicom.DicomImage)Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
// Scale up by 2 times using Bilinear resampling.
image.Resize(image.Width* 2, image.Height* 2, Aspose.Imaging.ResizeType.BilinearResample);
// Save to PNG with default options.
image.Save(dir + "upsample.bilinear.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
using (Aspose.Imaging.FileFormats.Dicom.DicomImage image = (Aspose.Imaging.FileFormats.Dicom.DicomImage)Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
// Scale down by 2 times using Bilinear resampling.
image.Resize(image.Width / 2, image.Height / 2, Aspose.Imaging.ResizeType.BilinearResample);
// Save to PNG with default options.
image.Save(dir + "downsample.bilinear.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
Resize(int, int, ImageResizeΕπεξεργασία)
Προσαρμόστε το μέγεθος της εικόνας σας με αυτή την απλή μέθοδο αναζωογόνησης.Σύντομη ή επέκταση της εικόνας σας, αυτή η λειτουργία εξασφαλίζει ότι οι ανάγκες αναζωογόνησης σας ικανοποιούνταιαποτελεσματικά και με ακρίβεια, καθιστώντας το τέλειο για τους προγραμματιστές που αναζητούν γρήγορα και εύκολαΠροσαρμογές μεγέθους εικόνας.
public override void Resize(int newWidth, int newHeight, ImageResizeSettings settings)
Parameters
newWidth
int
Το νέο πλάτος.
newHeight
int
Το νέο ύψος.
settings
ImageResizeSettings
Η αναδιάρθρωση των ρυθμίσεων.
Examples
Αυτό το παράδειγμα φορτώνει μια εικόνα DICOM και την αναζωογονεί χρησιμοποιώντας διάφορες ρυθμίσεις αναζωογόνησης.
string dir = "c:\\temp\\";
Aspose.Imaging.ImageResizeSettings resizeSettings = new Aspose.Imaging.ImageResizeSettings();
// The adaptive algorithm based on weighted and blended rational function and lanczos3 interpolation.
resizeSettings.Mode = Aspose.Imaging.ResizeType.AdaptiveResample;
// The small rectangular filter
resizeSettings.FilterType = Aspose.Imaging.ImageFilterType.SmallRectangular;
// The number of colors in the palette.
resizeSettings.EntriesCount = 256;
// The color quantization is not used
resizeSettings.ColorQuantizationMethod = ColorQuantizationMethod.None;
// The euclidian method
resizeSettings.ColorCompareMethod = ColorCompareMethod.Euclidian;
using (Aspose.Imaging.Image image = (Aspose.Imaging.Image)Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
Aspose.Imaging.FileFormats.Dicom.DicomImage dicomImage = (Aspose.Imaging.FileFormats.Dicom.DicomImage)image;
// Scale down by 2 times using adaptive resampling.
dicomImage.Resize(image.Width / 2, image.Height / 2, resizeSettings);
// Save to PNG
dicomImage.Save(dir + "downsample.adaptive.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
ResizeHeightProportionally(ΠΕΡΙΣΣΟΤΕΡΑ, ΑΝΑΚΟΙΝΩΣΗ)
Προσαρμόστε το ύψος της εικόνας, διατηρώντας παράλληλα τη σχέση της με αυτόΙδανικό για τους προγραμματιστές που επιδιώκουν να αναθεωρήσουν δυναμικά τις εικόνεςδιατηρώντας τις αναλογίες τους, εξασφαλίζοντας τη βέλτιστη προβολή και τη χρησιμότηταστις εφαρμογές τους.
public override void ResizeHeightProportionally(int newHeight, ResizeType resizeType)
Parameters
newHeight
int
Το νέο ύψος.
resizeType
ResizeType
Τύπος της αναζωογόνησης.
Examples
Αυτό το παράδειγμα φορτώνει μια εικόνα DICOM και την αναζωογονεί αναλογικά χρησιμοποιώντας διάφορες μεθόδους αναζωογονίας. μόνο το ύψος καθορίζεται, το πλάτος υπολογίζεται αυτόματα.
string dir = "c:\\temp\\";
using (Aspose.Imaging.FileFormats.Dicom.DicomImage image = (Aspose.Imaging.FileFormats.Dicom.DicomImage)Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
// Scale up by 2 times using Nearest Neighbour resampling.
image.ResizeHeightProportionally(image.Height* 2, Aspose.Imaging.ResizeType.NearestNeighbourResample);
// Save to PNG with the default options.
image.Save(dir + "upsample.nearestneighbour.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
using (Aspose.Imaging.FileFormats.Dicom.DicomImage image = (Aspose.Imaging.FileFormats.Dicom.DicomImage)Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
// Scale down by 2 times using Nearest Neighbour resampling.
image.ResizeHeightProportionally(image.Height / 2, Aspose.Imaging.ResizeType.NearestNeighbourResample);
// Save to PNG with the default options.
image.Save(dir + "downsample.nearestneighbour.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
using (Aspose.Imaging.FileFormats.Dicom.DicomImage image = (Aspose.Imaging.FileFormats.Dicom.DicomImage)Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
// Scale up by 2 times using Bilinear resampling.
image.ResizeHeightProportionally(image.Height* 2, Aspose.Imaging.ResizeType.BilinearResample);
// Save to PNG with the default options.
image.Save(dir + "upsample.bilinear.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
using (Aspose.Imaging.FileFormats.Dicom.DicomImage image = (Aspose.Imaging.FileFormats.Dicom.DicomImage)Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
// Scale down by 2 times using Bilinear resampling.
image.ResizeHeightProportionally(image.Height / 2, Aspose.Imaging.ResizeType.BilinearResample);
// Save to PNG with the default options.
image.Save(dir + "downsample.bilinear.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
ResizeProportional(ΠΕΡΙΣΣΟΤΕΡΑ, ΕΠΙΧΕΙΡΗΣΗ)
Ιδανικά για τους προγραμματιστές που επιδιώκουν να προσαρμόσουν τις διαστάσεις της εικόνας αναλογικά, διασφαλίζοντας τη συνέπεια και διατηρώντας τις αναλογίες του αρχικού περιεχομένου.Η αναλογική αναδιάσταση θα αναδιάρθει κάθε πλαίσιο σύμφωνα με τη αναλογία του newWidth’/width και
newHeight’/height.
public void ResizeProportional(int newWidth, int newHeight, ResizeType resizeType)
Parameters
newWidth
int
Το νέο πλάτος.
newHeight
int
Το νέο ύψος.
resizeType
ResizeType
Ο τύπος αναζωογόνησης.
ResizeWidthProportionally(ΠΕΡΙΣΣΟΤΕΡΑ, ΑΝΑΚΟΙΝΩΣΗ)
Προσαρμόστε το πλάτος της εικόνας, διατηρώντας ταυτόχρονα τη αναλογία της εμφάνισης με αυτό το βολικόΙδανικό για τους προγραμματιστές που επιδιώκουν να αναζωογονήσουν τις εικόνες αναλογικά, εξασφαλίζονταςσυνεκτικά και οπτικά ελκυστικά αποτελέσματα σε διάφορα περιβάλλοντα οθόνης.
public override void ResizeWidthProportionally(int newWidth, ResizeType resizeType)
Parameters
newWidth
int
Το νέο πλάτος.
resizeType
ResizeType
Τύπος της αναζωογόνησης.
Examples
Αυτό το παράδειγμα φορτώνει μια εικόνα DICOM και την αναζωογονεί αναλογικά χρησιμοποιώντας διάφορες μεθόδους αναζωογονίας. μόνο το πλάτος καθορίζεται, το ύψος υπολογίζεται αυτόματα.
string dir = "c:\\temp\\";
using (Aspose.Imaging.FileFormats.Dicom.DicomImage image = (Aspose.Imaging.FileFormats.Dicom.DicomImage)Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
// Scale up by 2 times using Nearest Neighbour resampling.
image.ResizeWidthProportionally(image.Width* 2, Aspose.Imaging.ResizeType.NearestNeighbourResample);
// Save to PNG with the default options.
image.Save(dir + "upsample.nearestneighbour.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
using (Aspose.Imaging.FileFormats.Dicom.DicomImage image = (Aspose.Imaging.FileFormats.Dicom.DicomImage)Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
// Scale down by 2 times using Nearest Neighbour resampling.
image.ResizeWidthProportionally(image.Width / 2, Aspose.Imaging.ResizeType.NearestNeighbourResample);
// Save to PNG with the default options.
image.Save(dir + "downsample.nearestneighbour.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
using (Aspose.Imaging.FileFormats.Dicom.DicomImage image = (Aspose.Imaging.FileFormats.Dicom.DicomImage)Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
// Scale up by 2 times using Bilinear resampling.
image.ResizeWidthProportionally(image.Width* 2, Aspose.Imaging.ResizeType.BilinearResample);
// Save to PNG with the default options.
image.Save(dir + "upsample.bilinear.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
using (Aspose.Imaging.FileFormats.Dicom.DicomImage image = (Aspose.Imaging.FileFormats.Dicom.DicomImage)Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
// Scale down by 2 times using Bilinear resampling.
image.ResizeWidthProportionally(image.Width / 2, Aspose.Imaging.ResizeType.BilinearResample);
// Save to PNG with the default options.
image.Save(dir + "downsample.bilinear.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
Rotate(Φλωτ, μπολ, χρώμα)
Ρυθμίστε την εικόνα γύρω από το κέντρο της με αυτή τη βολική μέθοδο. ιδανική για τους προγραμματιστέςεπιδιώκουν να προσαρμόσουν δυναμικά την προσανατολισμό της εικόνας, εξασφαλίζοντας τη βέλτιστη παρουσίαση καιΠροσαρμογή στις εφαρμογές τους.
public override void Rotate(float angle, bool resizeProportionally, Color backgroundColor)
Parameters
angle
float
Η γωνία περιστροφής σε βαθμούς. θετικές τιμές θα περιστρέφονται με το ρολόι.
resizeProportionally
bool
αν ρυθμιστείτε στο “πραγματικό” θα έχετε το μέγεθος της εικόνας σας αλλάξει ανάλογα με τα περιστρεφόμενα ορθογώνια (κενά σημεία) προβολές σε άλλες περιπτώσεις που αφήνουν τις διαστάσεις αγγίξει και μόνο εσωτερικό περιεχόμενο εικόνας περιστρέφονται.
backgroundColor
Color
Το χρώμα του φόντου.
Examples
Αυτό το παράδειγμα δείχνει πώς να περιστρέψετε όλες τις σελίδες μιας εικόνας DICOM και να τις αποθηκεύσετε όλες σε μια εικόνα TIFF πολλαπλών πλαίσιο.
string dir = "c:\\temp\\";
// Load a DICOM image from a file stream.
using (System.IO.Stream stream = System.IO.File.OpenRead(dir + "multiframe.dicom"))
{
using (Aspose.Imaging.FileFormats.Dicom.DicomImage dicomImage = new Aspose.Imaging.FileFormats.Dicom.DicomImage(stream))
{
// Rotate the image around the center by 60 degrees clockwise.
// Use gray as the background color.
dicomImage.Rotate(60, true, Aspose.Imaging.Color.Gray);
Aspose.Imaging.ImageOptions.TiffOptions createOptions = new Aspose.Imaging.ImageOptions.TiffOptions(Imaging.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);
createOptions.Compression = Aspose.Imaging.FileFormats.Tiff.Enums.TiffCompressions.Deflate;
// Note that if the image is colorful, it will be automatically converted to the grayscale format according to the options below
createOptions.Photometric = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPhotometrics.MinIsBlack;
createOptions.BitsPerSample = new ushort[] { 8 };
// Create an array of TIFF frames.
// The number of the frames is equal to the number of the DJVU pages.
Aspose.Imaging.FileFormats.Tiff.TiffFrame[] tiffFrames = new Aspose.Imaging.FileFormats.Tiff.TiffFrame[dicomImage.DicomPages.Length];
// Save each page as an individual TIFF frame.
foreach (Aspose.Imaging.FileFormats.Dicom.DicomPage dicomPage in dicomImage.DicomPages)
{
// Create a TIFF frame based on the DICOM page.
tiffFrames[dicomPage.Index] = new Aspose.Imaging.FileFormats.Tiff.TiffFrame(dicomPage, createOptions);
}
// Compose a TIFF image from the frames.
using (Aspose.Imaging.FileFormats.Tiff.TiffImage tiffImage = new Aspose.Imaging.FileFormats.Tiff.TiffImage(tiffFrames))
{
// Save to a file.
tiffImage.Save(dir + "multiframe.tif");
}
}
}
RotateFlip(RotateFlipType)
Μπορείτε εύκολα να χειριστείτε το ενεργό πλαίσιο με το περιστρέφοντας, φλιπίζοντας ή εκτελώντας και τις δύο ενέργειεςταυτόχρονα με αυτή την απλή μέθοδο. ιδανικό για τους προγραμματιστές που χρειάζονταιδυναμικά προσαρμόζει την κατεύθυνση των συγκεκριμένων πλαίσιο εντός των ακολουθιών εικόνας τους,Εξασφάλιση βέλτιστης παρουσίασης και ευθυγράμμισης.
public override void RotateFlip(RotateFlipType rotateFlipType)
Parameters
rotateFlipType
RotateFlipType
Ο τύπος του ροταμένου φλιπ.
Examples
Αυτό το παράδειγμα φορτώνει μια εικόνα DICOM, την περιστρέφει κατά 90 μοίρες και προαιρετικά χτυπά την εικόνα οριζόντια και (ή) κάθετα.
string dir = "c:\\temp\\";
Aspose.Imaging.RotateFlipType[] rotateFlipTypes = new Aspose.Imaging.RotateFlipType[]
{
Aspose.Imaging.RotateFlipType.Rotate90FlipNone,
Aspose.Imaging.RotateFlipType.Rotate90FlipX,
Aspose.Imaging.RotateFlipType.Rotate90FlipXY,
Aspose.Imaging.RotateFlipType.Rotate90FlipY,
};
foreach (Aspose.Imaging.RotateFlipType rotateFlipType in rotateFlipTypes)
{
// Rotate, flip and save to the output file.
using (Aspose.Imaging.FileFormats.Dicom.DicomImage image = (Aspose.Imaging.FileFormats.Dicom.DicomImage)Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
image.RotateFlip(rotateFlipType);
image.Save(dir + "sample." + rotateFlipType + ".png", new Aspose.Imaging.ImageOptions.PngOptions());
}
}
Save(Σύνδεση, ImageOptionsBase, Rectangle)
Αποθηκεύστε εύκολα τα δεδομένα εικόνας σας σε μια καθορισμένη ροή στην επιθυμητή μορφή αρχείουχρησιμοποιώντας αυτή τη βολική μέθοδο. είτε εργάζεστε με JPEG, PNG ή άλλη μορφή,Αυτή η λειτουργία εξασφαλίζει ότι τα δεδομένα εικόνας σας αποθηκεύονται αποτελεσματικά και με ακρίβεια,Κάντε το ιδανικό για τους προγραμματιστές που θέλουν να απλοποιήσουν τις διαδικασίες αποθήκευσης αρχείων τους.
public override void Save(Stream stream, ImageOptionsBase optionsBase, Rectangle boundsRectangle)
Parameters
stream
Stream
Η ροή για να αποθηκεύσετε τα δεδομένα της εικόνας σε.
optionsBase
ImageOptionsBase
Οι επιλογές αποθήκευσης.
boundsRectangle
Rectangle
Η εικόνα προορισμού περιορίζει την ορθογώνια. Ρυθμίστε την κενή ορθογώνια για τη χρήση των ορίων πηγής.
Examples
Το παρακάτω παράδειγμα φορτώνει μια εικόνα DICOM από ένα αρχείο και στη συνέχεια αποθηκεύει την εικόνα σε μια ροή αρχείου PNG.
string dir = "c:\\temp\\";
using (Aspose.Imaging.FileFormats.Dicom.DicomImage image = (Aspose.Imaging.FileFormats.Dicom.DicomImage)Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
Aspose.Imaging.ImageOptions.PngOptions saveOptions = new Aspose.Imaging.ImageOptions.PngOptions();
Aspose.Imaging.Rectangle bounds = new Aspose.Imaging.Rectangle(0, 0, image.Width / 2, image.Height / 2);
using (System.IO.Stream outputStream = System.IO.File.Open(dir + "output.png", System.IO.FileMode.Create))
{
// Save the upper-left quarter of the image to a file stream.
image.Save(outputStream, saveOptions, bounds);
}
}
SaveAll(Σύνδεσμος, ImageOptionsBase)
Αποθηκεύστε τα δεδομένα του αντικειμένου αποθηκεύοντάς τα στο καθορισμένο αρχείο (indexer + file name)τοποθεσία μαζί με την καθορισμένη μορφή αρχείου και τις επιλογές. ιδανικό για τους προγραμματιστές που αναζητούνασφαλή αποθήκευση δεδομένων σε διάφορες μορφές, διατηρώντας παράλληλα την ευελιξία και τον έλεγχοΠροδιαγραφές εξοικονόμησης.
public void SaveAll(string filePath, ImageOptionsBase options)
Parameters
filePath
string
Ο δρόμος του αρχείου.
options
ImageOptionsBase
Οι επιλογές .
SaveData(Stream)
Αποθηκεύει τα δεδομένα.
protected override void SaveData(Stream stream)
Parameters
stream
Stream
Η ροή για να αποθηκεύσετε τα δεδομένα.
SetResolution(ΔΥΟ, ΔΥΟ)
Προσαρμόστε την ανάλυση αυτού του Aspose.Imaging.RasterImage με ακρίβεια χρησιμοποιώντας αυτόΙδανικό για τους προγραμματιστές που θέλουν να προσαρμόσουν την ανάλυση εικόνας σεσυγκεκριμένες απαιτήσεις, εξασφαλίζοντας τη βέλτιστη ποιότητα της οθόνης και τη διαχείριση του μεγέθους του αρχείου.
public override void SetResolution(double dpiX, double dpiY)
Parameters
dpiX
double
Η οριζόντια ανάλυση, σε σημεία ανά ίντσα, του Aspose.Imaging.RasterImage.
dpiY
double
Η κάθετη ανάλυση, σε σημεία ανά ίντσα, του Aspose.Imaging.RasterImage.
UpdateDimensions(ΕΝΤ, ΕΝΤ)
Αναβαθμίζει τις διαστάσεις της εικόνας.
protected override void UpdateDimensions(int newWidth, int newHeight)
Parameters
newWidth
int
Το νέο πλάτος της εικόνας.
newHeight
int
Το νέο ύψος της εικόνας.