ImageSize.h
1 // Copyright 2001-2020 Aspose Pty Ltd. All Rights Reserved.
3 //
4 // This file is part of Aspose.Words. The source code in this file
5 // is only intended as a supplement to the documentation, and is provided
6 // "as is", without warranty of any kind, either expressed or implied.
9 #pragma once
10 
11 #include <system/shared_ptr.h>
12 #include <system/object.h>
13 #include <cstdint>
14 
15 #include "Aspose.Words.Cpp/aspose_words_api_defs.h"
16 
17 namespace Aspose { namespace Words { namespace Drawing { namespace Core { class ImageDataCore; } } } }
18 namespace Aspose { namespace Words { namespace RW { namespace Odt { namespace Writer { class OdtGraphicPropertiesWriter; } } } } }
19 namespace Aspose { namespace Words { namespace RW { namespace Rtf { namespace Reader { class RtfPictureHandler; } } } } }
20 namespace Aspose { namespace Images { class ImageSizeCore; } }
21 
22 namespace Aspose {
23 
24 namespace Words {
25 
26 namespace Drawing {
27 
34 class ImageSize : public System::Object
35 {
36  typedef ImageSize ThisType;
37  typedef System::Object BaseType;
38 
39  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
40  ASPOSE_WORDS_SHARED_RTTI_INFO_DECL();
41 
42  FRIEND_FUNCTION_System_MakeObject;
43  friend class Aspose::Words::Drawing::Core::ImageDataCore;
44  friend class Aspose::Words::RW::Odt::Writer::OdtGraphicPropertiesWriter;
45  friend class Aspose::Words::RW::Rtf::Reader::RtfPictureHandler;
46 
47 public:
48 
52  ASPOSE_WORDS_SHARED_API int32_t get_WidthPixels() const;
53 
57  ASPOSE_WORDS_SHARED_API int32_t get_HeightPixels() const;
58 
62  ASPOSE_WORDS_SHARED_API double get_HorizontalResolution() const;
63 
67  ASPOSE_WORDS_SHARED_API double get_VerticalResolution() const;
68 
72  ASPOSE_WORDS_SHARED_API double get_WidthPoints();
73 
77  ASPOSE_WORDS_SHARED_API double get_HeightPoints();
78 
84  ASPOSE_WORDS_SHARED_API ImageSize(int32_t widthPixels, int32_t heightPixels);
85 
93  ASPOSE_WORDS_SHARED_API ImageSize(int32_t widthPixels, int32_t heightPixels, double horizontalResolution, double verticalResolution);
94 
95 protected:
96 
97  bool get_IsValid();
98  int32_t get_WidthTwips();
99  int32_t get_HeightTwips();
100 
102 
103 private:
104 
105  int32_t mWidthPixels;
106  int32_t mHeightPixels;
107  double mHorizontalResolution;
108  double mVerticalResolution;
109 
110 };
111 
112 }
113 }
114 }
@ Odt
ODF Text Document.
int32_t get_HeightPixels() const
Gets the height of the image in pixels.
Contains information about image size and resolution.
Definition: ImageSize.h:35
ImageSize(int32_t widthPixels, int32_t heightPixels, double horizontalResolution, double verticalResolution)
Initializes width, height and resolution to the given values.
double get_VerticalResolution() const
Gets the vertical resolution in DPI.
@ Rtf
RTF format.
@ Words
ImageSize(int32_t widthPixels, int32_t heightPixels)
Initializes width and height to the given values in pixels. Initializes resolution to 96 dpi.
double get_HeightPoints()
Gets the height of the image in points. 1 point is 1/72 inch.
double get_WidthPoints()
Gets the width of the image in points. 1 point is 1/72 inch.
int32_t get_WidthPixels() const
Gets the width of the image in pixels.
double get_HorizontalResolution() const
Gets the horizontal resolution in DPI.