Image.h
1 #pragma once
2 // Copyright (c) 2001-2024 Aspose Pty Ltd. All Rights Reserved.
3 
4 #include "Aspose.PDF.Cpp/Generator/BaseParagraph.h"
5 #include "Aspose.PDF.Cpp/aspose_pdf_api_defs.h"
6 
7 namespace Aspose
8 {
9 namespace Pdf
10 {
11 class Cell;
12 enum class HorizontalAlignment;
13 enum class ImageFileType;
14 namespace LogicalStructure
15 {
16 class MCRElement;
17 } // namespace LogicalStructure
18 class MarginInfo;
19 class Operator;
20 class Page;
21 class PageGenerator;
22 class Paragraphs;
23 class Rectangle;
24 namespace Text
25 {
26 class TextFragment;
27 } // namespace Text
28 } // namespace Pdf
29 } // namespace Aspose
30 namespace System
31 {
32 namespace Collections
33 {
34 namespace Generic
35 {
36 template <typename> class List;
37 } // namespace Generic
38 } // namespace Collections
39 namespace Drawing
40 {
41 class Bitmap;
42 class Image;
43 namespace Imaging
44 {
45 enum class PixelFormat;
46 } // namespace Imaging
47 } // namespace Drawing
48 namespace IO
49 {
50 class Stream;
51 } // namespace IO
52 namespace Xml
53 {
54 class XmlReader;
55 class XmlTextWriter;
56 } // namespace Xml
57 } // namespace System
58 
59 namespace Aspose {
60 
61 namespace Pdf {
62 
66 class ASPOSE_PDF_SHARED_CLASS Image final : public Aspose::Pdf::BaseParagraph
67 {
68  typedef Image ThisType;
70 
71  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
72  ASPOSE_PDF_SHARED_RTTI_INFO_DECL();
73 
75  friend class Aspose::Pdf::PageGenerator;
76  friend class Aspose::Pdf::Cell;
77 
78 public:
79 
83  ASPOSE_PDF_SHARED_API System::String get_File() const;
87  ASPOSE_PDF_SHARED_API void set_File(System::String value);
91  ASPOSE_PDF_SHARED_API System::SharedPtr<Rectangle> get_BitmapSize();
95  ASPOSE_PDF_SHARED_API double get_FixWidth() const;
99  ASPOSE_PDF_SHARED_API void set_FixWidth(double value);
103  ASPOSE_PDF_SHARED_API double get_FixHeight() const;
107  ASPOSE_PDF_SHARED_API void set_FixHeight(double value);
111  ASPOSE_PDF_SHARED_API ImageFileType get_FileType() const;
115  ASPOSE_PDF_SHARED_API void set_FileType(ImageFileType value);
119  ASPOSE_PDF_SHARED_API double get_ImageScale() const;
123  ASPOSE_PDF_SHARED_API void set_ImageScale(double value);
127  ASPOSE_PDF_SHARED_API const System::SharedPtr<System::IO::Stream>& get_ImageStream() const;
131  ASPOSE_PDF_SHARED_API void set_ImageStream(System::SharedPtr<System::IO::Stream> value);
135  ASPOSE_PDF_SHARED_API bool get_IsApplyResolution() const;
139  ASPOSE_PDF_SHARED_API void set_IsApplyResolution(bool value);
144  ASPOSE_PDF_SHARED_API bool get_IsBlackWhite() const;
149  ASPOSE_PDF_SHARED_API void set_IsBlackWhite(bool value);
153  ASPOSE_PDF_SHARED_API const System::SharedPtr<Text::TextFragment>& get_Title() const;
157  ASPOSE_PDF_SHARED_API void set_Title(System::SharedPtr<Text::TextFragment> value);
158 
159  ASPOSE_PDF_SHARED_API Image();
160 
166  static ASPOSE_PDF_SHARED_API System::String GetMimeType(System::SharedPtr<System::Drawing::Image> i);
171  ASPOSE_PDF_SHARED_API System::SharedPtr<System::Object> Clone() override;
172 
173 protected:
174 
175  bool isTagged;
176  int32_t MCID;
177 
178  const System::SharedPtr<System::Drawing::Bitmap>& get_Bitmap() const;
179  System::SharedPtr<Rectangle> get_BBox() const;
183  System::String get_SerializationTag() const;
187  void set_SerializationTag(System::String value);
188 
189  void SetTaggedInfo(int32_t MCID);
193  static System::String GetFileName(System::String imageFile);
197  bool Process(double& curX, double& rightX, double& curY, bool isScaleParagraph, System::SharedPtr<MarginInfo> marginInfo, double realWidth, double height, System::SharedPtr<Page> page, System::SharedPtr<System::Collections::Generic::List<System::SharedPtr<Operator>>> operators, bool isCalculatedMode, bool isNextParagraphInline, bool isFooter, System::SharedPtr<Paragraphs>& paragraphs, double footNoteHeight, double bottomY, int32_t processedParagraphsCount, double leftXContainer);
198  ASPOSE_PDF_SHARED_API void Serialize(System::SharedPtr<System::Xml::XmlTextWriter> writer) override;
199  ASPOSE_PDF_SHARED_API void Deserialize(System::SharedPtr<System::Xml::XmlReader> reader) override;
200 
201 private:
202 
205 
206  void set_Bitmap(System::SharedPtr<System::Drawing::Bitmap> value);
207 
208  System::String pr_File;
209  double pr_FixWidth;
210  double pr_FixHeight;
211  ImageFileType pr_FileType;
212  double pr_ImageScale;
214  bool pr_IsApplyResolution;
215  bool pr_IsBlackWhite;
217  System::String pr_SerializationTag;
218 
220  System::SharedPtr<Rectangle> GetRectangle(double curX, double curY, double width, double bottomY, Aspose::Pdf::HorizontalAlignment alignment, double realWidth, double leftXContainer);
221  static bool IsSupportedPixelFormat(System::Drawing::Imaging::PixelFormat pixelFormat);
222 
223 };
224 
225 } // namespace Pdf
226 } // namespace Aspose
227 
228 
String class used across the library. Is a substitute for C# System.String when translating code...
Definition: string.h:121
class ASPOSECPP_SHARED_CLASS List
Definition: ienumerable.h:17
int32_t MCID
Definition: Image.h:176
ASPOSE_PDF_SHARED_API System::SharedPtr< System::Object > Clone() override
Clone the cell.
Definition: Artifact.h:67
PixelFormat
Specifies the color data format of a pixel.
Definition: pixel_format.h:17
HorizontalAlignment
Describes horizontal alignment.
Definition: HorizontalAlignment.h:16
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: fwd.h:22
means saving in XML format
Represents marked-content reference object in logical structure.
Definition: MCRElement.h:63
Definition: AFRelationship.h:4
Defines color adjustment information for Bitmap objects.
Defies a method that enables object cloning - creating a copy of an object. Objects of this class sho...
Definition: icloneable.h:15
ImageFileType
Enumerates the image file types.
Definition: ImageFileType.h:11
PixelFormat
Specifies the color data format of a pixel.
Definition: pixel_format.h:7
Represents a cell of the table&#39;s row.
Definition: Cell.h:65
List forward declaration.
Definition: Artifact.h:74
The coordinates are in the page coordinate context.
Represents image.
Definition: Image.h:66
void Deserialize(System::SharedPtr< System::Xml::XmlReader > reader)
bool isTagged
Definition: Image.h:175
Represents a abstract base object can be added to the page(doc.Paragraphs.Add()). ...
Definition: BaseParagraph.h:66
void Serialize(System::SharedPtr< System::Xml::XmlTextWriter > writer)
Whole PDF file will be submitted.