Class representing XImage collection. More...

Inherits System::Collections::Generic::ICollection< System::SharedPtr< Aspose::Pdf::XImage > >.

Classes

class  ThresholdMaskParameters
 

Public Member Functions

int32_t get_Count () const
 Count of images in collection. More...
 
bool get_IsSynchronized ()
 Returns true if object is synchronized. More...
 
System::SharedPtr< System::Objectget_SyncRoot ()
 Returns synchronization object. More...
 
System::ArrayPtr< System::Stringget_Names ()
 Gets array of image names. More...
 
bool get_IsReadOnly () const
 Gets a value indicating whether the collection is read-only. More...
 
System::String AddWithName (System::SharedPtr< XImage > image)
 Adds new image to Image list. This method adds image as reference to the same PdfObject (which allows to decrease file size) More...
 
System::String Add (System::SharedPtr< System::IO::Stream > image)
 Adds entity to the end of the collection, so entity can be accessed by the last index. More...
 
void Add (System::SharedPtr< System::IO::Stream > image, ImageFilterType filterType)
 Adds entity to the end of the collection, so entity can be accessed by the last index. More...
 
void Add (System::SharedPtr< System::IO::Stream > image, int32_t quality)
 Adds entity to the end of the collection, so entity can be accessed by the last index. More...
 
void Delete (int32_t index)
 Removes index from collection by index. More...
 
void Delete (System::String name)
 Removes index from collection by name. More...
 
void Delete ()
 Deletes images from collection. More...
 
System::SharedPtr< System::Collections::Generic::IEnumerator< System::SharedPtr< XImage > > > GetEnumerator ()
 Returns collection enumerator. More...
 
void CopyTo (System::ArrayPtr< System::SharedPtr< XImage >> array, int32_t index)
 Copies array of images into collection. More...
 
void Replace (int32_t index, System::SharedPtr< System::IO::Stream > stream)
 Replace image in collection with another image. More...
 
void Replace (int32_t index, System::SharedPtr< System::IO::Stream > stream, int32_t quality)
 Replace image in collection with another image. More...
 
System::SharedPtr< XImageidx_get (int32_t index)
 Gets image from collection by its index. More...
 
System::SharedPtr< XImageidx_get (System::String name)
 Gets image from collection by its name. More...
 
System::String GetImageName (System::SharedPtr< XImage > image)
 Returns name in images list which is key of the given image. More...
 
void Add (System::SharedPtr< XImage > const &item)
 Adds new image to Image list. This method adds image as reference to the same PdfObject (which allows to decrease file size) More...
 
void Clear ()
 Clears all items from the collection. More...
 
bool Contains (System::SharedPtr< XImage > const &item) const
 Determines whether the collection contains a specific value. More...
 
bool Remove (System::SharedPtr< XImage > const &item)
 Always throws NotImplementedException More...
 
- Public Member Functions inherited from System::Collections::Generic::ICollection< System::SharedPtr< Aspose::Pdf::XImage > >
virtual void CopyTo (System::ArrayPtr< System::SharedPtr< Aspose::Pdf::XImage > > array, int arrayIndex)=0
 
ICollectionoperator= (ICollection &&)
 
ICollectionoperator= (const ICollection &)
 
 ICollection ()
 Default constructor. More...
 
 ICollection (const ICollection &)
 Copy constructor. More...
 
 ICollection (ICollection &&)
 Move constructor. More...
 
virtual ~ICollection ()
 Destructor. 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

System::SharedPtr< Resourcesget_Parent ()
 
System::SharedPtr< Engine::Data::IPdfDataStream > MakeImageFromStream (System::SharedPtr< System::IO::Stream > stream, int32_t quality, System::SharedPtr< Engine::Data::ITrailerable > trailerable)
 
System::SharedPtr< Engine::Data::IPdfDataStream > MakeImageFromStream (System::SharedPtr< System::IO::Stream > stream, int32_t quality)
 
System::SharedPtr< Engine::Data::IPdfDataStream > MakeMonochromeImage (System::SharedPtr< System::Drawing::Bitmap > image)
 
System::SharedPtr< Engine::Data::IPdfObject > AddGifMaskedImage (System::SharedPtr< System::IO::Stream > stream, int32_t quality)
 
System::SharedPtr< Engine::Data::IPdfObject > AddOrReplace (int32_t index, System::SharedPtr< System::IO::Stream > stream, int32_t quality, bool isBlackWhite, ImageFilterType filterType, uint8_t bitMask, bool isMasked)
 
System::SharedPtr< Engine::Data::IPdfObject > add (System::SharedPtr< System::IO::Stream > stream, bool isBlackWhite)
 
System::SharedPtr< Engine::Data::IPdfObject > add (System::SharedPtr< System::IO::Stream > stream, bool isBlackWhite, System::String &name)
 
System::SharedPtr< Engine::Data::IPdfObject > add (System::SharedPtr< System::IO::Stream > stream, int32_t quality, bool isBlackWhite)
 
System::SharedPtr< Engine::Data::IPdfObject > add (System::SharedPtr< System::IO::Stream > stream, int32_t quality, bool isBlackWhite, System::String &name)
 
System::SharedPtr< Engine::Data::IPdfObject > add (System::SharedPtr< System::IO::Stream > stream, int32_t quality, bool isBlackWhite, ImageFilterType filterType, bool isMasked, System::SharedPtr< System::IO::Stream > predefinedStream=nullptr)
 
System::SharedPtr< Engine::Data::IPdfObject > DeleteByIndex (int32_t index)
 
System::SharedPtr< Engine::Data::IPdfObject > DeleteBySize (int32_t index)
 Returns ObjectID of deleted image. More...
 
 XImageCollection (System::SharedPtr< Resources > parent, System::SharedPtr< Engine::Data::IPdfDictionary > xobject)
 
void Replace (int32_t index, System::SharedPtr< System::IO::Stream > stream, int32_t quality, bool isBlackAndWhite)
 
void Add (System::String name, System::SharedPtr< Engine::Data::IPdfObject > image)
 
System::String Add (System::SharedPtr< Engine::Data::IPdfObject > image)
 
bool HasImage (System::String imgName)
 
System::SharedPtr< Engine::Data::IPdfObject > DeleteBySizeAndIndex (System::SharedPtr< XImage > image)
 
System::SharedPtr< Engine::Data::IPdfObject > DeleteBySize (System::SharedPtr< XImage > image)
 

Static Protected Member Functions

static System::SharedPtr< System::Drawing::Imaging::ImageCodecInfoGetEncoder (System::SharedPtr< System::Drawing::Imaging::ImageFormat > format)
 
static System::SharedPtr< Engine::Data::IPdfDataStream > _MakeImageFromStream (System::SharedPtr< System::IO::Stream > stream, int32_t quality, System::SharedPtr< Engine::Data::ITrailerable > parent)
 
static System::SharedPtr< Engine::Data::IPdfDataStream > MakeMonochromeImage (System::SharedPtr< System::Drawing::Bitmap > image, System::SharedPtr< Engine::Data::ITrailerable > trailerable)
 
static bool AddCCITTFaxDecodeImageMask (System::SharedPtr< System::IO::Stream > stream, System::SharedPtr< Engine::Data::ITrailerable > p, System::SharedPtr< XImageCollection::ThresholdMaskParameters > thresholdMaskParameters, System::SharedPtr< Engine::Data::IPdfDataStream > img)
 
static System::SharedPtr< System::IO::StreamIsMetafile (System::SharedPtr< System::IO::Stream > stream)
 Determines whether emf format is used. More...
 

Additional Inherited Members

- Public Types inherited from System::Collections::Generic::ICollection< System::SharedPtr< Aspose::Pdf::XImage > >
typedef System::SharedPtr< Aspose::Pdf::XImageValueType
 Value type name. More...
 
typedef ICollection< System::SharedPtr< Aspose::Pdf::XImage > > ThisType
 Collection type name. More...
 
- Public Types inherited from System::Collections::Generic::IEnumerable< System::SharedPtr< Aspose::Pdf::XImage > >
typedef IEnumerator< System::SharedPtr< Aspose::Pdf::XImage > > IEnumeratorType
 Enumerator type. More...
 
- 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 XImage collection.

Constructor & Destructor Documentation

◆ XImageCollection()

Aspose::Pdf::XImageCollection::XImageCollection ( System::SharedPtr< Resources parent,
System::SharedPtr< Engine::Data::IPdfDictionary >  xobject 
)
protected

Member Function Documentation

◆ _MakeImageFromStream()

static System::SharedPtr<Engine::Data::IPdfDataStream> Aspose::Pdf::XImageCollection::_MakeImageFromStream ( System::SharedPtr< System::IO::Stream stream,
int32_t  quality,
System::SharedPtr< Engine::Data::ITrailerable >  parent 
)
staticprotected

◆ Add() [1/6]

System::String Aspose::Pdf::XImageCollection::Add ( System::SharedPtr< System::IO::Stream image)

Adds entity to the end of the collection, so entity can be accessed by the last index.

Parameters
imageStream containing image data (in JPEG format).
Returns
Name of the added image.

◆ Add() [2/6]

void Aspose::Pdf::XImageCollection::Add ( System::SharedPtr< System::IO::Stream image,
ImageFilterType  filterType 
)

Adds entity to the end of the collection, so entity can be accessed by the last index.

Parameters
imageStream containing image data.
filterTypeThe image filter type.

◆ Add() [3/6]

void Aspose::Pdf::XImageCollection::Add ( System::SharedPtr< System::IO::Stream image,
int32_t  quality 
)

Adds entity to the end of the collection, so entity can be accessed by the last index.

Parameters
imageStream containing image data (in JPEG format).
qualityJPEG quality.

◆ Add() [4/6]

void Aspose::Pdf::XImageCollection::Add ( System::SharedPtr< XImage > const &  item)
virtual

Adds new image to Image list. This method adds image as reference to the same PdfObject (which allows to decrease file size)

Parameters
itemXImage to be added.

Implements System::Collections::Generic::ICollection< System::SharedPtr< Aspose::Pdf::XImage > >.

◆ add() [1/5]

System::SharedPtr<Engine::Data::IPdfObject> Aspose::Pdf::XImageCollection::add ( System::SharedPtr< System::IO::Stream stream,
bool  isBlackWhite 
)
protected

◆ add() [2/5]

System::SharedPtr<Engine::Data::IPdfObject> Aspose::Pdf::XImageCollection::add ( System::SharedPtr< System::IO::Stream stream,
bool  isBlackWhite,
System::String name 
)
protected

◆ add() [3/5]

System::SharedPtr<Engine::Data::IPdfObject> Aspose::Pdf::XImageCollection::add ( System::SharedPtr< System::IO::Stream stream,
int32_t  quality,
bool  isBlackWhite 
)
protected

◆ add() [4/5]

System::SharedPtr<Engine::Data::IPdfObject> Aspose::Pdf::XImageCollection::add ( System::SharedPtr< System::IO::Stream stream,
int32_t  quality,
bool  isBlackWhite,
System::String name 
)
protected

◆ add() [5/5]

System::SharedPtr<Engine::Data::IPdfObject> Aspose::Pdf::XImageCollection::add ( System::SharedPtr< System::IO::Stream stream,
int32_t  quality,
bool  isBlackWhite,
ImageFilterType  filterType,
bool  isMasked,
System::SharedPtr< System::IO::Stream predefinedStream = nullptr 
)
protected

◆ Add() [5/6]

void Aspose::Pdf::XImageCollection::Add ( System::String  name,
System::SharedPtr< Engine::Data::IPdfObject >  image 
)
protected

◆ Add() [6/6]

System::String Aspose::Pdf::XImageCollection::Add ( System::SharedPtr< Engine::Data::IPdfObject >  image)
protected

◆ AddCCITTFaxDecodeImageMask()

static bool Aspose::Pdf::XImageCollection::AddCCITTFaxDecodeImageMask ( System::SharedPtr< System::IO::Stream stream,
System::SharedPtr< Engine::Data::ITrailerable >  p,
System::SharedPtr< XImageCollection::ThresholdMaskParameters thresholdMaskParameters,
System::SharedPtr< Engine::Data::IPdfDataStream >  img 
)
staticprotected

◆ AddGifMaskedImage()

System::SharedPtr<Engine::Data::IPdfObject> Aspose::Pdf::XImageCollection::AddGifMaskedImage ( System::SharedPtr< System::IO::Stream stream,
int32_t  quality 
)
protected

◆ AddOrReplace()

System::SharedPtr<Engine::Data::IPdfObject> Aspose::Pdf::XImageCollection::AddOrReplace ( int32_t  index,
System::SharedPtr< System::IO::Stream stream,
int32_t  quality,
bool  isBlackWhite,
ImageFilterType  filterType,
uint8_t  bitMask,
bool  isMasked 
)
protected

◆ AddWithName()

System::String Aspose::Pdf::XImageCollection::AddWithName ( System::SharedPtr< XImage image)

Adds new image to Image list. This method adds image as reference to the same PdfObject (which allows to decrease file size)

Parameters
imageXImage to be added.
Returns
Name of the added image.

◆ Clear()

void Aspose::Pdf::XImageCollection::Clear ( )
virtual

◆ Contains()

bool Aspose::Pdf::XImageCollection::Contains ( System::SharedPtr< XImage > const &  item) const
virtual

Determines whether the collection contains a specific value.

Parameters
itemThe object to locate in the collection
Returns
true if item is found in the collection; otherwise, false.

Implements System::Collections::Generic::ICollection< System::SharedPtr< Aspose::Pdf::XImage > >.

◆ CopyTo()

void Aspose::Pdf::XImageCollection::CopyTo ( System::ArrayPtr< System::SharedPtr< XImage >>  array,
int32_t  index 
)

Copies array of images into collection.

Parameters
arrayArray to be copied.
indexIndex where images will be copied into collection.

◆ Delete() [1/3]

void Aspose::Pdf::XImageCollection::Delete ( int32_t  index)

Removes index from collection by index.

Parameters
indexImage index.

◆ Delete() [2/3]

void Aspose::Pdf::XImageCollection::Delete ( System::String  name)

Removes index from collection by name.

Parameters
nameName of image which must to be deleted.

◆ Delete() [3/3]

void Aspose::Pdf::XImageCollection::Delete ( )

Deletes images from collection.

◆ DeleteByIndex()

System::SharedPtr<Engine::Data::IPdfObject> Aspose::Pdf::XImageCollection::DeleteByIndex ( int32_t  index)
protected

◆ DeleteBySize() [1/2]

System::SharedPtr<Engine::Data::IPdfObject> Aspose::Pdf::XImageCollection::DeleteBySize ( int32_t  index)
protected

Returns ObjectID of deleted image.

Parameters
index
Returns

◆ DeleteBySize() [2/2]

System::SharedPtr<Engine::Data::IPdfObject> Aspose::Pdf::XImageCollection::DeleteBySize ( System::SharedPtr< XImage image)
protected

◆ DeleteBySizeAndIndex()

System::SharedPtr<Engine::Data::IPdfObject> Aspose::Pdf::XImageCollection::DeleteBySizeAndIndex ( System::SharedPtr< XImage image)
protected

◆ get_Count()

int32_t Aspose::Pdf::XImageCollection::get_Count ( ) const
virtual

◆ get_IsReadOnly()

bool Aspose::Pdf::XImageCollection::get_IsReadOnly ( ) const
virtual

Gets a value indicating whether the collection is read-only.

Reimplemented from System::Collections::Generic::ICollection< System::SharedPtr< Aspose::Pdf::XImage > >.

◆ get_IsSynchronized()

bool Aspose::Pdf::XImageCollection::get_IsSynchronized ( )

Returns true if object is synchronized.

◆ get_Names()

System::ArrayPtr<System::String> Aspose::Pdf::XImageCollection::get_Names ( )

Gets array of image names.

◆ get_Parent()

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

◆ get_SyncRoot()

System::SharedPtr<System::Object> Aspose::Pdf::XImageCollection::get_SyncRoot ( )

Returns synchronization object.

◆ GetEncoder()

static System::SharedPtr<System::Drawing::Imaging::ImageCodecInfo> Aspose::Pdf::XImageCollection::GetEncoder ( System::SharedPtr< System::Drawing::Imaging::ImageFormat format)
staticprotected

◆ GetEnumerator()

System::SharedPtr<System::Collections::Generic::IEnumerator<System::SharedPtr<XImage> > > Aspose::Pdf::XImageCollection::GetEnumerator ( )
virtual

Returns collection enumerator.

Returns
Enumerator of collection

Implements System::Collections::Generic::IEnumerable< System::SharedPtr< Aspose::Pdf::XImage > >.

◆ GetImageName()

System::String Aspose::Pdf::XImageCollection::GetImageName ( System::SharedPtr< XImage image)

Returns name in images list which is key of the given image.

Parameters
imageImage to search.
Returns
Name (key) of the found image; null if images was not found.

◆ HasImage()

bool Aspose::Pdf::XImageCollection::HasImage ( System::String  imgName)
protected

◆ idx_get() [1/2]

System::SharedPtr<XImage> Aspose::Pdf::XImageCollection::idx_get ( int32_t  index)

Gets image from collection by its index.

Parameters
indexImage index
Returns
Retreived image.

◆ idx_get() [2/2]

System::SharedPtr<XImage> Aspose::Pdf::XImageCollection::idx_get ( System::String  name)

Gets image from collection by its name.

Parameters
nameImage name.
Returns
Retreived image.

◆ IsMetafile()

static System::SharedPtr<System::IO::Stream> Aspose::Pdf::XImageCollection::IsMetafile ( System::SharedPtr< System::IO::Stream stream)
staticprotected

Determines whether emf format is used.

Parameters
streamInput stream with image.
Returns
Is emf format is detected than jpeg stream returned; otherwise, input stream.

◆ MakeImageFromStream() [1/2]

System::SharedPtr<Engine::Data::IPdfDataStream> Aspose::Pdf::XImageCollection::MakeImageFromStream ( System::SharedPtr< System::IO::Stream stream,
int32_t  quality,
System::SharedPtr< Engine::Data::ITrailerable >  trailerable 
)
protected

◆ MakeImageFromStream() [2/2]

System::SharedPtr<Engine::Data::IPdfDataStream> Aspose::Pdf::XImageCollection::MakeImageFromStream ( System::SharedPtr< System::IO::Stream stream,
int32_t  quality 
)
protected

◆ MakeMonochromeImage() [1/2]

System::SharedPtr<Engine::Data::IPdfDataStream> Aspose::Pdf::XImageCollection::MakeMonochromeImage ( System::SharedPtr< System::Drawing::Bitmap image)
protected

◆ MakeMonochromeImage() [2/2]

static System::SharedPtr<Engine::Data::IPdfDataStream> Aspose::Pdf::XImageCollection::MakeMonochromeImage ( System::SharedPtr< System::Drawing::Bitmap image,
System::SharedPtr< Engine::Data::ITrailerable >  trailerable 
)
staticprotected

◆ Remove()

bool Aspose::Pdf::XImageCollection::Remove ( System::SharedPtr< XImage > const &  item)
virtual

Always throws NotImplementedException

Parameters
item

Implements System::Collections::Generic::ICollection< System::SharedPtr< Aspose::Pdf::XImage > >.

◆ Replace() [1/3]

void Aspose::Pdf::XImageCollection::Replace ( int32_t  index,
System::SharedPtr< System::IO::Stream stream 
)

Replace image in collection with another image.

Parameters
indexIndex of collection item which will be replaced.
streamStream containing image data (in JPEG format).

◆ Replace() [2/3]

void Aspose::Pdf::XImageCollection::Replace ( int32_t  index,
System::SharedPtr< System::IO::Stream stream,
int32_t  quality 
)

Replace image in collection with another image.

Parameters
indexIndex of collection item which will be replaced.
streamStream containing image data (in JPEG format).
qualityJPEG quality.

◆ Replace() [3/3]

void Aspose::Pdf::XImageCollection::Replace ( int32_t  index,
System::SharedPtr< System::IO::Stream stream,
int32_t  quality,
bool  isBlackAndWhite 
)
protected