Class DisposableObject

Class DisposableObject

Pôvodný názov: Aspose.Imaging Zhromaždenie: Aspose.Imaging.dll (25.4.0)

Predstavuje rozložiteľný objekt.

public class DisposableObject : IDisposable

Inheritance

object DisposableObject

Derived

Brush , CdrObject , CmxContainer , CmxPage , DataStreamSupporter , EmbeddedImage , ImageOptionsBase , MaskingResult , StreamContainer , StringFormat

Implements

IDisposable

Z dedičných členov

object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()

Constructors

DisposableObject()

public DisposableObject()

Properties

Disposed

Dostane hodnotu, ktorá ukazuje, či je táto inštancia odstránená.

public bool Disposed { get; }

Hodnota nehnuteľnosti

bool

Methods

Dispose()

V súčasnosti disponuje aktuálnou inštitúciou.

public void Dispose()

Examples

Nasledujúci príklad ukazuje, ako zložiť mutlipage TIFF z jednotlivých rasterových obrázkov.

Aspose.Imaging.ImageOptions.TiffOptions createTiffOptions = new Aspose.Imaging.ImageOptions.TiffOptions(Aspose.Imaging.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);
                                                                                                     createTiffOptions.Source = new Aspose.Imaging.Sources.FileCreateSource("c:\\temp\\multipage.tif", false);
                                                                                                     createTiffOptions.Photometric = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPhotometrics.Rgb;
                                                                                                     createTiffOptions.BitsPerSample = new ushort[] { 8, 8, 8 };

                                                                                                     using (Aspose.Imaging.FileFormats.Tiff.TiffImage tiffImage = (Aspose.Imaging.FileFormats.Tiff.TiffImage)Image.Create(createTiffOptions, 100, 100))
                                                                                                     {
                                                                                                         // This is Font and Brush for drawing text on individual frames.
                                                                                                         Aspose.Imaging.Font font = new Aspose.Imaging.Font("Arial", 64);
                                                                                                         Aspose.Imaging.Brushes.SolidBrush brush = new Aspose.Imaging.Brushes.SolidBrush(Aspose.Imaging.Color.White);

                                                                                                         // Create 5 frames
                                                                                                         for (int i = 1; i <= 5; i++)
                                                                                                         {
                                                                                                             Aspose.Imaging.ImageOptions.PngOptions createPngOptions = new Aspose.Imaging.ImageOptions.PngOptions();
                                                                                                             createPngOptions.Source = new Aspose.Imaging.Sources.StreamSource(new System.IO.MemoryStream());

                                                                                                             // Create a PNG image and draw the number of page on it.
                                                                                                             Aspose.Imaging.FileFormats.Png.PngImage pngImage = (Aspose.Imaging.FileFormats.Png.PngImage)Image.Create(createPngOptions, 100, 100);
                                                                                                             Aspose.Imaging.Graphics gr = new Aspose.Imaging.Graphics(pngImage);
                                                                                                             gr.DrawString(i.ToString(), font, brush, 10, 10);

                                                                                                             // Create a frame based on the PNG image.
                                                                                                             Aspose.Imaging.FileFormats.Tiff.TiffFrame frame = new Aspose.Imaging.FileFormats.Tiff.TiffFrame(pngImage);

                                                                                                             // Add the frame to the TIFF image.
                                                                                                             tiffImage.AddFrame(frame);
                                                                                                         }

                                                                                                         // The image was created with a single default frame. Let's remove it.
                                                                                                         Aspose.Imaging.FileFormats.Tiff.TiffFrame activeFrame = tiffImage.ActiveFrame;
                                                                                                         tiffImage.ActiveFrame = tiffImage.Frames[1];
                                                                                                         tiffImage.RemoveFrame(0);

                                                                                                         // Don't forget to dispose the frame if you won't add it to some other TiffImage
                                                                                                         activeFrame.Dispose();

                                                                                                         tiffImage.Save();
                                                                                                     }

~DisposableObject()

protected ~DisposableObject()

ReleaseManagedResources()

Uvoľní spravované zdroje. uistite sa, že tu nie sú spravované zdroje uvoľnené, pretože možno už boli uvoľnené.

protected virtual void ReleaseManagedResources()

ReleaseUnmanagedResources()

Uvoľňuje neupravené zdroje. uistite sa, že neupravené zdroje nie sú uvoľnené tu, pretože môžu byť už uvoľnené.

protected virtual void ReleaseUnmanagedResources()

VerifyNotDisposed()

Uistite sa, že aktuálny prípad nie je odstránený.

protected void VerifyNotDisposed()
 Slovenčina