Image.h
1 #pragma once
2 // Copyright (c) 2001-2024 Aspose Pty Ltd. All Rights Reserved.
3 
4 // C# preprocessor directive: #if ASPOSE_PDF_DRAWING
5 
6 // C# INACTIVE CODE:
7 // extern alias AsposeImaging;
8 // using AsposeImaging::Aspose.Imaging.FileFormats.Dicom;
9 // using AsposeImaging::Aspose.Imaging.ImageOptions;
10 // using GraphicsImage = AsposeImaging.Aspose.Imaging.Image;
11 
12 // C# preprocessor directive: #else
13 
14 
15 // C# preprocessor directive: #endif
16 
17 
18 #include "Aspose.PDF.Cpp/Generator/BaseParagraph.h"
19 #include "Aspose.PDF.Cpp/aspose_pdf_api_defs.h"
20 
21 namespace Aspose
22 {
23 namespace Pdf
24 {
25 class Cell;
26 enum class HorizontalAlignment;
27 enum class ImageFileType;
28 namespace LogicalStructure
29 {
30 class MCRElement;
31 } // namespace LogicalStructure
32 class MarginInfo;
33 class Operator;
34 class Page;
35 class PageGenerator;
36 class Paragraphs;
37 class Rectangle;
38 namespace Text
39 {
40 class TextFragment;
41 } // namespace Text
42 } // namespace Pdf
43 } // namespace Aspose
44 namespace System
45 {
46 namespace Collections
47 {
48 namespace Generic
49 {
50 template <typename> class List;
51 } // namespace Generic
52 } // namespace Collections
53 namespace Drawing
54 {
55 class Bitmap;
56 class Image;
57 namespace Imaging
58 {
59 enum class PixelFormat;
60 } // namespace Imaging
61 } // namespace Drawing
62 namespace IO
63 {
64 class Stream;
65 } // namespace IO
66 namespace Xml
67 {
68 class XmlReader;
69 class XmlTextWriter;
70 } // namespace Xml
71 } // namespace System
72 
73 namespace Aspose {
74 
75 namespace Pdf {
76 
80 class ASPOSE_PDF_SHARED_CLASS Image final : public Aspose::Pdf::BaseParagraph
81 {
82  typedef Image ThisType;
84 
85  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
86  ASPOSE_PDF_SHARED_RTTI_INFO_DECL();
87 
89  friend class Aspose::Pdf::PageGenerator;
90  friend class Aspose::Pdf::Cell;
91 
92 public:
93 
97  ASPOSE_PDF_SHARED_API System::String get_File() const;
101  ASPOSE_PDF_SHARED_API void set_File(System::String value);
105  ASPOSE_PDF_SHARED_API System::SharedPtr<Rectangle> get_BitmapSize();
109  ASPOSE_PDF_SHARED_API double get_FixWidth() const;
113  ASPOSE_PDF_SHARED_API void set_FixWidth(double value);
117  ASPOSE_PDF_SHARED_API double get_FixHeight() const;
121  ASPOSE_PDF_SHARED_API void set_FixHeight(double value);
125  ASPOSE_PDF_SHARED_API ImageFileType get_FileType() const;
129  ASPOSE_PDF_SHARED_API void set_FileType(ImageFileType value);
133  ASPOSE_PDF_SHARED_API double get_ImageScale() const;
137  ASPOSE_PDF_SHARED_API void set_ImageScale(double value);
141  ASPOSE_PDF_SHARED_API const System::SharedPtr<System::IO::Stream>& get_ImageStream() const;
145  ASPOSE_PDF_SHARED_API void set_ImageStream(System::SharedPtr<System::IO::Stream> value);
149  ASPOSE_PDF_SHARED_API bool get_IsApplyResolution() const;
153  ASPOSE_PDF_SHARED_API void set_IsApplyResolution(bool value);
158  ASPOSE_PDF_SHARED_API bool get_IsBlackWhite() const;
163  ASPOSE_PDF_SHARED_API void set_IsBlackWhite(bool value);
167  ASPOSE_PDF_SHARED_API const System::SharedPtr<Text::TextFragment>& get_Title() const;
171  ASPOSE_PDF_SHARED_API void set_Title(System::SharedPtr<Text::TextFragment> value);
172 
173  ASPOSE_PDF_SHARED_API Image();
174 
180  static ASPOSE_PDF_SHARED_API System::String GetMimeType(System::SharedPtr<System::Drawing::Image> i);
185  ASPOSE_PDF_SHARED_API System::SharedPtr<System::Object> Clone() override;
186 
187 protected:
188 
189  bool isTagged;
190  int32_t MCID;
191 
192  const System::SharedPtr<System::Drawing::Bitmap>& get_Bitmap() const;
193  System::SharedPtr<Rectangle> get_BBox() const;
197  System::String get_SerializationTag() const;
201  void set_SerializationTag(System::String value);
202 
203  void SetTaggedInfo(int32_t MCID);
207  static System::String GetFileName(System::String imageFile);
211  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);
212  ASPOSE_PDF_SHARED_API void Serialize(System::SharedPtr<System::Xml::XmlTextWriter> writer) override;
213  ASPOSE_PDF_SHARED_API void Deserialize(System::SharedPtr<System::Xml::XmlReader> reader) override;
214 
215 private:
216 
219 
220  void set_Bitmap(System::SharedPtr<System::Drawing::Bitmap> value);
221 
222  System::String pr_File;
223  double pr_FixWidth;
224  double pr_FixHeight;
225  ImageFileType pr_FileType;
226  double pr_ImageScale;
228  bool pr_IsApplyResolution;
229  bool pr_IsBlackWhite;
231  System::String pr_SerializationTag;
232 
234  System::SharedPtr<Rectangle> GetRectangle(double curX, double curY, double width, double bottomY, Aspose::Pdf::HorizontalAlignment alignment, double realWidth, double leftXContainer);
235  static bool IsSupportedPixelFormat(System::Drawing::Imaging::PixelFormat pixelFormat);
236 
237 };
238 
239 } // namespace Pdf
240 } // namespace Aspose
241 
242 
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:190
ASPOSE_PDF_SHARED_API System::SharedPtr< System::Object > Clone() override
Clone the cell.
Definition: Artifact.h:71
PixelFormat
Specifies the color data format of a pixel.
Definition: pixel_format.h:17
HorizontalAlignment
Describes horizontal alignment.
Definition: HorizontalAlignment.h:16
The type that supports reliable, two-way, connection-based byte streams without duplication of data a...
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: SideBySidePdfComparer.h:24
Represents a text type.
means saving in XML format
Represents marked-content reference object in logical structure.
Definition: MCRElement.h:75
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:78
The coordinates are in the page coordinate context.
Represents image.
Definition: Image.h:80
void Deserialize(System::SharedPtr< System::Xml::XmlReader > reader)
bool isTagged
Definition: Image.h:189
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.