NodeRendererBase.h
1 // Copyright 2001-2022 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/object.h>
12 #include <system/io/std_stream_wrappers.h>
13 #include <iostream>
14 #include <drawing/rectangle_f.h>
15 
16 #include <Aspose.Words.Cpp/aspose_words_api_defs.h>
17 
18 namespace Aspose
19 {
20 
21 namespace Words
22 {
23 
24 namespace Saving
25 {
26 class ImageSaveOptions;
27 }
28 }
29 }
30 namespace System
31 {
32 namespace Drawing
33 {
34 class Graphics;
35 class Rectangle;
36 class Size;
37 class SizeF;
38 }
39 namespace IO
40 {
41 class Stream;
42 }
43 class String;
44 }
45 
46 namespace Aspose {
47 
48 namespace Words {
49 
50 namespace Rendering {
51 
96 class ASPOSE_WORDS_SHARED_CLASS NodeRendererBase : public System::Object
97 {
98  typedef NodeRendererBase ThisType;
99  typedef System::Object BaseType;
100 
101  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
102  ASPOSE_WORDS_SHARED_RTTI_INFO_DECL();
103 
104 public:
105 
153  ASPOSE_WORDS_SHARED_API System::Drawing::SizeF get_SizeInPoints();
154 
202  ASPOSE_WORDS_SHARED_API System::Drawing::RectangleF get_BoundsInPoints() const;
203 
252 
305  ASPOSE_WORDS_SHARED_API System::Drawing::Size GetSizeInPixels(float scale, float dpi);
306 
360  ASPOSE_WORDS_SHARED_API System::Drawing::Size GetSizeInPixels(float scale, float horizontalDpi, float verticalDpi);
361 
413  ASPOSE_WORDS_SHARED_API System::Drawing::Rectangle GetBoundsInPixels(float scale, float dpi);
414 
467  ASPOSE_WORDS_SHARED_API System::Drawing::Rectangle GetBoundsInPixels(float scale, float horizontalDpi, float verticalDpi);
468 
521  ASPOSE_WORDS_SHARED_API System::Drawing::Rectangle GetOpaqueBoundsInPixels(float scale, float dpi);
522 
576  ASPOSE_WORDS_SHARED_API System::Drawing::Rectangle GetOpaqueBoundsInPixels(float scale, float horizontalDpi, float verticalDpi);
577 
587  ASPOSE_WORDS_SHARED_API System::Drawing::SizeF RenderToScale(const System::SharedPtr<System::Drawing::Graphics>& graphics, float x, float y, float scale);
588 
599  ASPOSE_WORDS_SHARED_API float RenderToSize(const System::SharedPtr<System::Drawing::Graphics>& graphics, float x, float y, float width, float height);
600 
623  ASPOSE_WORDS_SHARED_API void Save(const System::String& fileName, System::SharedPtr<Aspose::Words::Saving::ImageSaveOptions> saveOptions);
624 
652 
653  ASPOSE_WORDS_SHARED_API NodeRendererBase();
654 
655  template <typename CharType, typename Traits>
656  void Save(std::basic_ostream<CharType, Traits>& stream, System::SharedPtr<Aspose::Words::Saving::ImageSaveOptions> saveOptions)
657  {
658  auto streamWrapper = System::IO::WrapSTDIOStream(stream);
659  Save(streamWrapper, saveOptions);
660  }
661 
662 protected:
663 
664 private:
665 
670 
671 };
672 
673 }
674 }
675 }