ImageSize.h
1 //////////////////////////////////////////////////////////////////////////
2 // Copyright 2001-2019 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.
7 //////////////////////////////////////////////////////////////////////////
8 #pragma once
9 
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 
28 
29 /// <summary>
30 /// Contains information about image size and resolution.
31 /// </summary>
32 /// <remarks>
33 /// <seealso cref="Aspose::Words::Drawing::ImageData::get_ImageSize" />
34 /// </remarks>
35 class ImageSize : public System::Object
36 {
37  typedef ImageSize ThisType;
38  typedef System::Object BaseType;
39 
40  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
41  ASPOSE_WORDS_SHARED_RTTI_INFO_DECL();
42 
44  friend class Aspose::Words::Drawing::Core::ImageDataCore;
45  friend class Aspose::Words::RW::Odt::Writer::OdtGraphicPropertiesWriter;
46  friend class Aspose::Words::RW::Rtf::Reader::RtfPictureHandler;
47 
48 public:
49 
50  /// <summary>
51  /// Gets the width of the image in pixels.
52  /// </summary>
53  ASPOSE_WORDS_SHARED_API int32_t get_WidthPixels() const;
54  /// <summary>
55  /// Gets the height of the image in pixels.
56  /// </summary>
58  /// <summary>
59  /// Gets the horizontal resolution in DPI.
60  /// </summary>
62  /// <summary>
63  /// Gets the vertical resolution in DPI.
64  /// </summary>
66  /// <summary>
67  /// Gets the width of the image in points. 1 point is 1/72 inch.
68  /// </summary>
70  /// <summary>
71  /// Gets the height of the image in points. 1 point is 1/72 inch.
72  /// </summary>
74 
75  /// <summary>
76  /// Initializes width and height to the given values in pixels. Initializes resolution to 96 dpi.
77  /// </summary>
78  /// <param name="widthPixels">Width in pixels.</param>
79  /// <param name="heightPixels">Height in pixels.</param>
81  /// <summary>
82  /// Initializes width, height and resolution to the given values.
83  /// </summary>
84  /// <param name="widthPixels">Width in pixels.</param>
85  /// <param name="heightPixels">Height in pixels.</param>
86  /// <param name="horizontalResolution">Horizontal resolution in DPI.</param>
87  /// <param name="verticalResolution">Vertical resolution in DPI.</param>
89 
90 protected:
91 
92  bool get_IsValid();
93  int32_t get_WidthTwips();
94  int32_t get_HeightTwips();
95 
96  ImageSize(System::SharedPtr<Aspose::Images::ImageSizeCore> core);
97 
98 private:
99 
100  int32_t mWidthPixels;
101  int32_t mHeightPixels;
102  double mHorizontalResolution;
103  double mVerticalResolution;
104 
105 };
106 
107 }
108 }
109 }
Definition: IFontData.h:19
ImageSize(int32_t widthPixels, int32_t heightPixels, double horizontalResolution, double verticalResolution)
Initializes width, height and resolution to the given values.
Insert line breaks after every 76th character.
Definition: Border.h:65
#define FRIEND_FUNCTION_System_MakeObject
Macro to befriend MakeObject function.
Definition: smart_ptr.h:1357