Class representing image X-Object. More...

Inherits System::Object.

Public Member Functions

bool get_ContainsTransparency ()
 If the image contains transparancy than return true; otherwise, false. More...
 
System::SharedPtr< System::Drawing::Imageget_Grayscaled ()
 Gets grayscaled version of image. More...
 
int32_t get_Width ()
 Gets width of the image. More...
 
int32_t get_Height ()
 Gets height of the image. More...
 
System::String get_Name ()
 Gets image name. More...
 
void set_Name (System::String value)
 Sets image name. More...
 
void Save (System::SharedPtr< System::IO::Stream > stream)
 Saves image data into stream as JPEG image. More...
 
void Save (System::SharedPtr< System::IO::Stream > stream, System::SharedPtr< System::Drawing::Imaging::ImageFormat > format)
 Saves image into stream with requested format. More...
 
void Save (System::SharedPtr< System::IO::Stream > stream, int32_t resolution)
 Saves image data into stream as JPEG image with specified resolution. More...
 
void Save (System::SharedPtr< System::IO::Stream > stream, System::SharedPtr< System::Drawing::Imaging::ImageFormat > format, int32_t resolution)
 Saves image into stream with requested format with specified resolution. More...
 
ColorType GetColorType ()
 Returns color type of image. More...
 
bool IsTheSameObject (System::SharedPtr< XImage > image)
 Returns true if both images references to the same object. More...
 
System::String GetNameInCollection ()
 Returns name of the image in ints collection. More...
 
System::SharedPtr< System::IO::StreamToStream ()
 Returns the original image stream. More...
 
- Public Member Functions inherited from System::Object
ASPOSECPP_SHARED_API Object ()
 Creates object. Initializes all internal data structures. More...
 
virtual ASPOSECPP_SHARED_API ~Object ()
 Destroys object. Frees all internal data structures. More...
 
ASPOSECPP_SHARED_API Object (Object const &x)
 Copy constructor. Doesn't copy anything, really, just initializes new object and enables copy constructing subclasses. More...
 
Objectoperator= (Object const &x)
 Assignment operator. Doesn't copy anything, really, just initializes new object and enables copy constructing subclasses. More...
 
ObjectSharedRefAdded ()
 Increments shared reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
int SharedRefRemovedSafe ()
 Decrements and returns shared reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
int RemovedSharedRefs (int count)
 Decreases shared reference count by specified value. More...
 
Detail::SmartPtrCounter * WeakRefAdded ()
 Increments weak reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
void WeakRefRemoved ()
 Decrements weak reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
Detail::SmartPtrCounter * GetCounter ()
 Gets reference counter data structure associated with the object. More...
 
int SharedCount () const
 Gets current value of shared refernce counter. More...
 
ASPOSECPP_SHARED_API void Lock ()
 Implements C# lock() statement locking. Call directly or use LockContext sentry object. More...
 
ASPOSECPP_SHARED_API void Unlock ()
 Implements C# lock() statement unlocking. Call directly or use LockContext sentry object. More...
 
virtual ASPOSECPP_SHARED_API bool Equals (ptr obj)
 Compares objects using C# Object.Equals semantics. More...
 
virtual ASPOSECPP_SHARED_API int GetHashCode () const
 Analog of C# Object.GetHashCode() method. Enables hashing of custom objects. More...
 
virtual ASPOSECPP_SHARED_API String ToString () ASPOSE_CONST
 Analog of C# Object.ToString() method. Enables converting custom objects to string. More...
 
virtual ASPOSECPP_SHARED_API ptr MemberwiseClone () const
 Analog of C# Object.MemberwiseClone() method. Enables cloning custom types. More...
 
virtual ASPOSECPP_SHARED_API const TypeInfoGetType () const
 Gets actual type of object. Analog of C# System.Object.GetType() call. More...
 
virtual ASPOSECPP_SHARED_API bool Is (const TypeInfo &targetType) const
 Check if object represents an instance of type described by targetType. Analog of C# 'is' operator. More...
 
virtual ASPOSECPP_SHARED_API void SetTemplateWeakPtr (unsigned int argument)
 Set n'th template argument a weak pointer (rather than shared). Allows switching pointers in containers to weak mode. More...
 
template<>
bool Equals (float const &objA, float const &objB)
 
template<>
bool Equals (double const &objA, double const &objB)
 
template<>
bool ReferenceEquals (String const &str, std::nullptr_t)
 
template<>
bool ReferenceEquals (String const &str1, String const &str2)
 

Protected Member Functions

bool get_HasSMask ()
 If the image contains smask than return true; otherwise, false. More...
 
System::SharedPtr< XImageCollectionget_Parent ()
 
System::SharedPtr< System::Drawing::Imageget_BlackAndWhite ()
 Gets black and white version of image. More...
 
ImageFilterType get_FilterType ()
 
System::SharedPtr< Engine::Data::IPdfObject > get_EngineObject ()
 
 XImage (System::SharedPtr< Engine::Data::IPdfDataStream > image, System::SharedPtr< XImageCollection > parent)
 
void Delete ()
 Deletes image from the parent collection. More...
 
void Replace (System::SharedPtr< System::IO::Stream > image)
 Replaces image onto stream specified in image . More...
 
 XImage (System::SharedPtr< Engine::Data::IPdfDataStream > image)
 
System::SharedPtr< System::Drawing::ImageGetImage ()
 
void SaveWithBlending (System::SharedPtr< System::IO::Stream > stream, int32_t resolution)
 

Static Protected Member Functions

static System::SharedPtr< System::Drawing::Imaging::ImageFormatget_DefaultImageFormat ()
 Gets default image format. More...
 
static bool IsImage (System::SharedPtr< Engine::Data::IPdfPrimitive > primitive)
 Returns true if the primitive is an image. More...
 
static System::SharedPtr< System::Drawing::BitmapMakeGrayscale (System::SharedPtr< System::IO::Stream > original, System::SharedPtr< Document > document)
 
static bool IsBitmapFilled (System::SharedPtr< System::Drawing::Bitmap > bitmap, uint8_t whiteColorReplace)
 
static bool IsBitmapFilledRgb (System::SharedPtr< System::Drawing::Bitmap > bitmap, uint8_t whiteColorReplace)
 
static int32_t GetRgbDelta (System::Drawing::Color color)
 Grayscale would have a delta of 0. More...
 

Protected Attributes

System::SharedPtr< Engine::Data::IPdfDataStream > EngineImg
 

Additional Inherited Members

- Public Types inherited from System::Object
typedef SmartPtr< Objectptr
 Alias for smart pointer type. More...
 
typedef System::Details::SharedMembersType shared_members_type
 structure to keep list of shared pointers contained in object. More...
 
- Static Public Member Functions inherited from System::Object
static bool ReferenceEquals (ptr const &objA, ptr const &objB)
 Compares objects by reference. More...
 
template<typename T >
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, T const &objB)
 Compares objects by reference. More...
 
template<typename T >
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, std::nullptr_t)
 Reference-compares value type object with nullptr. More...
 
template<typename T1 , typename T2 >
static std::enable_if< IsSmartPtr< T1 >::value &&IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 Compares reference type objects in C# style. More...
 
template<typename T1 , typename T2 >
static std::enable_if<!IsSmartPtr< T1 >::value &&!IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 Compares value type objects in C# style. More...
 
static const TypeInfoType ()
 Impleemnts C# typeof(System.Object) construct. More...
 

Detailed Description

Class representing image X-Object.

Constructor & Destructor Documentation

◆ XImage() [1/2]

Aspose::Pdf::XImage::XImage ( System::SharedPtr< Engine::Data::IPdfDataStream >  image,
System::SharedPtr< XImageCollection parent 
)
protected

◆ XImage() [2/2]

Aspose::Pdf::XImage::XImage ( System::SharedPtr< Engine::Data::IPdfDataStream >  image)
protected

Member Function Documentation

◆ Delete()

void Aspose::Pdf::XImage::Delete ( )
protected

Deletes image from the parent collection.

◆ get_BlackAndWhite()

System::SharedPtr<System::Drawing::Image> Aspose::Pdf::XImage::get_BlackAndWhite ( )
protected

Gets black and white version of image.

◆ get_ContainsTransparency()

bool Aspose::Pdf::XImage::get_ContainsTransparency ( )

If the image contains transparancy than return true; otherwise, false.

◆ get_DefaultImageFormat()

static System::SharedPtr<System::Drawing::Imaging::ImageFormat> Aspose::Pdf::XImage::get_DefaultImageFormat ( )
staticprotected

Gets default image format.

◆ get_EngineObject()

System::SharedPtr<Engine::Data::IPdfObject> Aspose::Pdf::XImage::get_EngineObject ( )
protected

◆ get_FilterType()

ImageFilterType Aspose::Pdf::XImage::get_FilterType ( )
protected

◆ get_Grayscaled()

System::SharedPtr<System::Drawing::Image> Aspose::Pdf::XImage::get_Grayscaled ( )

Gets grayscaled version of image.

◆ get_HasSMask()

bool Aspose::Pdf::XImage::get_HasSMask ( )
protected

If the image contains smask than return true; otherwise, false.

◆ get_Height()

int32_t Aspose::Pdf::XImage::get_Height ( )

Gets height of the image.

◆ get_Name()

System::String Aspose::Pdf::XImage::get_Name ( )

Gets image name.

◆ get_Parent()

System::SharedPtr<XImageCollection> Aspose::Pdf::XImage::get_Parent ( )
protected

◆ get_Width()

int32_t Aspose::Pdf::XImage::get_Width ( )

Gets width of the image.

◆ GetColorType()

ColorType Aspose::Pdf::XImage::GetColorType ( )

Returns color type of image.

Returns
The color type value.

◆ GetImage()

System::SharedPtr<System::Drawing::Image> Aspose::Pdf::XImage::GetImage ( )
protected

◆ GetNameInCollection()

System::String Aspose::Pdf::XImage::GetNameInCollection ( )

Returns name of the image in ints collection.

Returns
Image key (name).

◆ GetRgbDelta()

static int32_t Aspose::Pdf::XImage::GetRgbDelta ( System::Drawing::Color  color)
staticprotected

Grayscale would have a delta of 0.

Parameters
colorThe color for which to calculate the delta.
Returns
The difference in the RGB values.

◆ IsBitmapFilled()

static bool Aspose::Pdf::XImage::IsBitmapFilled ( System::SharedPtr< System::Drawing::Bitmap bitmap,
uint8_t  whiteColorReplace 
)
staticprotected

◆ IsBitmapFilledRgb()

static bool Aspose::Pdf::XImage::IsBitmapFilledRgb ( System::SharedPtr< System::Drawing::Bitmap bitmap,
uint8_t  whiteColorReplace 
)
staticprotected

◆ IsImage()

static bool Aspose::Pdf::XImage::IsImage ( System::SharedPtr< Engine::Data::IPdfPrimitive >  primitive)
staticprotected

Returns true if the primitive is an image.

◆ IsTheSameObject()

bool Aspose::Pdf::XImage::IsTheSameObject ( System::SharedPtr< XImage image)

Returns true if both images references to the same object.

Parameters
imageImage to be compared with "this" image.
Returns
Boolean value which is true if images references to the same object.

◆ MakeGrayscale()

static System::SharedPtr<System::Drawing::Bitmap> Aspose::Pdf::XImage::MakeGrayscale ( System::SharedPtr< System::IO::Stream original,
System::SharedPtr< Document document 
)
staticprotected

◆ Replace()

void Aspose::Pdf::XImage::Replace ( System::SharedPtr< System::IO::Stream image)
protected

Replaces image onto stream specified in image .

Parameters
imageStream with image data.

◆ Save() [1/4]

void Aspose::Pdf::XImage::Save ( System::SharedPtr< System::IO::Stream stream)

Saves image data into stream as JPEG image.

Parameters
streamStream where image data will be saved.

◆ Save() [2/4]

void Aspose::Pdf::XImage::Save ( System::SharedPtr< System::IO::Stream stream,
System::SharedPtr< System::Drawing::Imaging::ImageFormat format 
)

Saves image into stream with requested format.

Parameters
streamStream where image will be saved
formatFormat which will be used for image enconding. ImageFormat

◆ Save() [3/4]

void Aspose::Pdf::XImage::Save ( System::SharedPtr< System::IO::Stream stream,
int32_t  resolution 
)

Saves image data into stream as JPEG image with specified resolution.

Parameters
streamStream where image data will be saved.
resolutionImage resolution

◆ Save() [4/4]

void Aspose::Pdf::XImage::Save ( System::SharedPtr< System::IO::Stream stream,
System::SharedPtr< System::Drawing::Imaging::ImageFormat format,
int32_t  resolution 
)

Saves image into stream with requested format with specified resolution.

Parameters
streamStream where image will be saved
formatFormat which will be used for image enconding. ImageFormat
resolutionImage resolution

◆ SaveWithBlending()

void Aspose::Pdf::XImage::SaveWithBlending ( System::SharedPtr< System::IO::Stream stream,
int32_t  resolution 
)
protected

◆ set_Name()

void Aspose::Pdf::XImage::set_Name ( System::String  value)

Sets image name.

◆ ToStream()

System::SharedPtr<System::IO::Stream> Aspose::Pdf::XImage::ToStream ( )

Returns the original image stream.

Returns
The original image stream.

Member Data Documentation

◆ EngineImg

System::SharedPtr<Engine::Data::IPdfDataStream> Aspose::Pdf::XImage::EngineImg
protected