Image

Image class

A base class for System::Drawing::Bitmap and System::Drawing::Metafile classes providing basic functionality. Objects of this class should only be allocated using System::MakeObject() function. Never create instance of this type on stack or using operator new, as it will result in runtime errors and/or assertion faults. Always wrap this class into System::SmartPtr pointer and use this pointer to pass it to functions as argument.

class Image : public virtual System::IDisposable

Methods

MethodDescription
virtual SharedPtr<Image> Clone()Creates a copy of the current object.
void Dispose() overrideReleases all resources aquired by the current object.
virtual bool Equals(ptr)Compares objects using C# Object.Equals semantics.
static std::enable_if<IsSmartPtr<T1>::value&&IsSmartPtr<T2>::value, bool>::type Equals(T1 const&, T2 const&)Compares reference type objects in C# style.
static std::enable_if<!IsSmartPtr<T1>::value&&!IsSmartPtr<T2>::value, bool>::type Equals(T1 const&, T2 const&)Compares value type objects in C# style.
static bool Equals(float const&, float const&)Emulates C#-style floating point comparison where two NaNs are considered equal even though according to IEC 60559:1989 NaN is not equal to any value, including NaN.
static bool Equals(double const&, double const&)Emulates C#-style floating point comparison where two NaNs are considered equal even though according to IEC 60559:1989 NaN is not equal to any value, including NaN.
virtual bool FastCast(const Details::FastRttiBase&, void **) constFor internal purposes only.
static SharedPtr<Image> FromFile(const String&, bool)Creates an Image object from the specified file.
static SharedPtr<Bitmap> FromHbitmap(IntPtr)Constructs a Bitmap object from the specified GDI bitmap.
static SharedPtr<Image> FromStream(const SharedPtr<System::IO::Stream>&, bool, bool)Creates an Image object from the specified stream.
virtual int32_t get_Flags() constReturns a bit-wise combination of ImageFlags enum values that represents the attributes of the image.
ArrayPtr<Guid> get_FrameDimensionsList() constReturns an array of GUIDs that represent the dimensions of frames within the image represented by the current object.
virtual int get_Height() constReturns the height of the image in pixels.
float get_HorizontalResolution() constReturns the horizontal resolution of the image represented by the current object in pixels per inch.
virtual Imaging::ColorPalettePtr get_Palette() constReturns the color palette used by the image represented by the current object.
virtual Imaging::PixelFormat get_PixelFormat() constReturns the pixel format of the image represented by the current object.
virtual ArrayPtr<int> get_PropertyIdList() constGets IDs of the property items stored in this image.
virtual ArrayPtr<SharedPtr<Imaging::PropertyItem>> get_PropertyItems() constGets all the property items(pieces of metadata) stored in this image.
virtual Imaging::ImageFormatPtr get_RawFormat() constReturns the file format of the image represented by the current object.
Size get_Size() constReturns a Size object that represents the width and height of the image in pixels.
virtual System::SharedPtr<System::Object> get_Tag() constGets an object that provides additional data about the image.
float get_VerticalResolution() constReturns the vertical resolution of the image represented by the current object in pixels per inch.
virtual int get_Width() constReturns the width of the image in pixels.
RectangleF GetBounds(GraphicsUnit&)Returns the image bounds in the specified measurement units.
Detail::SmartPtrCounter * GetCounter()Gets reference counter data structure associated with the object.
int GetFrameCount(const Imaging::FrameDimensionPtr&)Returns the number of frames of the specified frame dimension.
virtual int32_t GetHashCode() constAnalog of C# Object.GetHashCode() method. Enables hashing of custom objects.
static int GetPixelFormatSize(Imaging::PixelFormat)Returns the number of bits used to represent the color depth in the specified pixel format.
virtual const SkBitmap * GetSkBitmap() constReturns an underlying SkBitmap object.
SharedPtr<Image> GetThumbnailImage(int, int, Image::GetThumbnailImageAbort, IntPtr)Gets a thumbnail for this System::Drawing::Image object.
virtual const TypeInfo& GetType() constGets actual type of object. Analog of C# System.Object.GetType() call.
virtual bool Is(const TypeInfo&) constCheck if object represents an instance of type described by targetType. Analog of C# ‘is’ operator.
static bool IsAlphaPixelFormat(Imaging::PixelFormat)Determines if the specified pixel format contains alpha information.
virtual bool IsMultiImage() constReturns whether the original format is a multi-image.
void Lock()Implements C# lock() statement locking. Call directly or use LockContext sentry object.
virtual ptr MemberwiseClone() constAnalog of C# Object.MemberwiseClone() method. Enables cloning custom types.
Object()Creates object. Initializes all internal data structures.
Object(Object const&)Copy constructor. Doesn’t copy anything, really, just initializes new object and enables copy constructing subclasses.
Object& operator=(Object const&)Assignment operator. Doesn’t copy anything, really, just initializes new object and enables copy constructing subclasses.
static bool ReferenceEquals(ptr const&, ptr const&)Compares objects by reference.
static std::enable_if<!IsSmartPtr<T>::value, bool>::type ReferenceEquals(T const&, T const&)Compares objects by reference.
static std::enable_if<!IsSmartPtr<T>::value, bool>::type ReferenceEquals(T const&, std::nullptr_t)Reference-compares value type object with nullptr.
bool ReferenceEquals(String const&, std::nullptr_t)Specialization of Object::ReferenceEquals for case of string and nullptr.
bool ReferenceEquals(String const&, String const&)Specialization of Object::ReferenceEquals for case of strings.
int RemovedSharedRefs(int)Decreases shared reference count by specified value.
virtual void RotateFlip(RotateFlipType)Rotate image to multiple of 90 degrees and flip.
void Save(const String&)Saves the image represented by the current object to the specified file in PNG format.
void Save(const String&, const Imaging::ImageFormatPtr&)Saves the image represented by the current object to the specified file in the specified format.
void Save(const SharedPtr<System::IO::Stream>&, const Imaging::ImageFormatPtr&)Saves the image represented by the current object to the specified stream in the specified format.
void Save(const String&, const Imaging::ImageCodecInfoPtr&, const Imaging::EncoderParametersPtr&)Saves the image represented by the current object to the specified file using the specified encoder and encoder parameters.
void Save(const SharedPtr<System::IO::Stream>&, const Imaging::ImageCodecInfoPtr&, const Imaging::EncoderParametersPtr&)Saves the image represented by the current object to the specified stream using the specified encoder and encoder parameters.
void SaveAdd(const Imaging::EncoderParametersPtr&)Adds a frame to the file or stream specified in a previous call to the Save() method.
void SaveAdd(const SharedPtr<Image>&, const Imaging::EncoderParametersPtr&)Adds a frame to the file or stream specified in a previous call to the Save() method.
int SelectActiveFrame(const Imaging::FrameDimensionPtr&, int)Selects the specified frame.
virtual void set_Palette(Imaging::ColorPalettePtr)Sets the color palette used by the image represented by the current object.
virtual void set_Tag(const System::SharedPtr<System::Object>)Sets an object that provides additional data about the image.
virtual void SetTemplateWeakPtr(uint32_t)Set n’th template argument a weak pointer (rather than shared). Allows switching pointers in containers to weak mode.
int SharedCount() constGets current value of shared reference counter.
Object * SharedRefAdded()Increments shared reference count. Shouldn’t be called directly; instead, use smart pointers or ThisProtector.
int SharedRefRemovedSafe()Decrements and returns shared reference count. Shouldn’t be called directly; instead, use smart pointers or ThisProtector.
virtual String ToString() constAnalog of C# Object.ToString() method. Enables converting custom objects to string.
static const TypeInfo& Type()Implements C# typeof(System.Object) construct.
void Unlock()Implements C# lock() statement unlocking. Call directly or use LockContext sentry object.
Detail::SmartPtrCounter * WeakRefAdded()Increments weak reference count. Shouldn’t be called directly; instead, use smart pointers or ThisProtector.
void WeakRefRemoved()Decrements weak reference count. Shouldn’t be called directly; instead, use smart pointers or ThisProtector.
virtual ~Object()Destroys object. Frees all internal data structures.

Typedefs

TypedefDescription
GetThumbnailImageAbortA callback to cancel GetThumbnailImage execution.

See Also