CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
metafile.h
1
2#ifndef _aspose_system_drawing_metafile_h_
3#define _aspose_system_drawing_metafile_h_
4
5#include "fwd.h"
6
7#include "drawing/image.h"
8#include "drawing/imaging/emf_type.h"
9#include "drawing/imaging/metafile_header.h"
10#include "drawing/imaging/metafile_frame_unit.h"
11#include "drawing/imaging/emf_plus_record_type.h"
12#include "drawing/rectangle.h"
13#include "system/io/stream.h"
14
15#include <memory>
16
17#if defined(ASPOSECPPLIB_BEING_BUILT) || defined(ASPOSECPP_SKIA_EXTERNAL_USAGE)
18#include <core/SkBitmap.h>
19#include <core/SkCanvas.h>
20#endif
21
23ASPOSECPP_3RD_PARTY_CLASS(SkBitmap);
25ASPOSECPP_3RD_PARTY_CLASS(SkCanvas);
27ASPOSECPP_3RD_PARTY_CLASS(SkData);
29ASPOSECPP_3RD_PARTY_STRUCT(SkImageInfo);
30
31#if defined(ASPOSECPPLIB_BEING_BUILT) || !defined(ASPOSECPP_SKIA_EXTERNAL_USAGE)
32// Static checks of SkEncodedImageFormat enum.
33ASPOSECPP_3RD_PARTY_ENUM_CLASS(SkEncodedImageFormat);
34#endif
35
36namespace System { namespace Drawing { class Bitmap; } }
37
38namespace System { namespace Drawing { namespace Imaging {
43class ASPOSECPP_SHARED_CLASS Metafile : public Image
44{
45 RTTI_INFO(System::Drawing::Imaging::Metafile, ::System::BaseTypesInfo<System::Drawing::Image>)
46
47public:
50 ASPOSECPP_SHARED_API Metafile(const System::String& filename);
53 ASPOSECPP_SHARED_API Metafile(const SharedPtr<System::IO::Stream>& stream);
56 ASPOSECPP_SHARED_API Metafile(const SharedPtr<System::IO::Stream>& stream, IntPtr hdc, EmfType type);
59 ASPOSECPP_SHARED_API Metafile(const SharedPtr<System::IO::Stream>& stream, IntPtr hdc);
62 ASPOSECPP_SHARED_API Metafile(const SharedPtr<System::IO::Stream>& stream, IntPtr hdc, Rectangle rect, MetafileFrameUnit frameUnit, EmfType type);
65 ASPOSECPP_SHARED_API Metafile(const SharedPtr<System::IO::Stream>& stream, IntPtr hdc, RectangleF rect, MetafileFrameUnit frameUnit, EmfType type);
68 ASPOSECPP_SHARED_API Metafile(IntPtr, EmfType);
70 virtual ASPOSECPP_SHARED_API ~Metafile();
71
76 ASPOSECPP_SHARED_API IntPtr GetHenhmetafile();
79 ASPOSECPP_SHARED_API void PlayRecord(EmfPlusRecordType, int32_t, int32_t, System::ByteArrayPtr);
80
82 virtual ASPOSECPP_SHARED_API int get_Width() const override;
84 virtual ASPOSECPP_SHARED_API int get_Height() const override;
85
87 virtual ASPOSECPP_SHARED_API Imaging::ImageFormatPtr get_RawFormat() const override;
89 virtual ASPOSECPP_SHARED_API Imaging::PixelFormat get_PixelFormat() const override;
91 virtual ASPOSECPP_SHARED_API SharedPtr<Image> Clone() override;
92
93protected:
94 friend class Image;
96
99 virtual ASPOSECPP_SHARED_API std::unique_ptr<SkCanvas> GetDrawingCanvas() const override;
102 virtual ASPOSECPP_SHARED_API sk_sp<SkData> GetRawBytes(SkEncodedImageFormat encoder_type, int quality) override;
103
105 virtual ASPOSECPP_SHARED_API const SkBitmap* GetSkBitmap() const override;
107 virtual ASPOSECPP_SHARED_API const SkEncodedImageFormat GetSkEncodedFormat() const override;
108
117 virtual void Draw(SkCanvas* sk_canvas, const SkRect& dest_rect, const SkRect&src_rect, SkMatrix* matrix, SkFilterQuality quality, SkBlendMode blend_mode) const override;
125 virtual void Draw(SkCanvas* sk_canvas, const SkRect& dest_rect, SkMatrix* matrix, SkFilterQuality quality, SkBlendMode blend_mode) const override;
134 virtual void Draw(SkCanvas* sk_canvas, ArrayPtr<PointF> dest_points, const SkRect& src_rect, SkMatrix* matrix, SkFilterQuality quality, SkBlendMode blend_mode) const override;
143 virtual void Draw(SkCanvas* sk_canvas, const System::Details::ArrayView<PointF>& dest_points, const SkRect& src_rect, SkMatrix* matrix, SkFilterQuality quality, SkBlendMode blend_mode) const override;
145 virtual ASPOSECPP_SHARED_API Imaging::PixelFormat GetOriginalFormat() const override;
146
147#ifdef ASPOSE_DUMMY_META_FILE
151 ASPOSECPP_SHARED_API Metafile(const SharedPtr<System::IO::Stream>& stream, const Drawing::Imaging::ImageFormatPtr& image_format);
152 MEMBER_FUNCTION_MAKE_OBJECT(Metafile, CODEPORTING_ARGS(const SharedPtr<System::IO::Stream>& stream, const Drawing::Imaging::ImageFormatPtr& image_format), CODEPORTING_ARGS(stream, image_format));
162 mutable std::unique_ptr<SkBitmap> m_dummy_sk_bitmap;
164#endif
165};
166
167}}}
168
169#endif
Represents a GDI+ bitmap image. Objects of this class should only be allocated using System::MakeObje...
Definition: bitmap.h:64
A base class for System::Drawing::Bitmap and System::Drawing::Metafile classes providing basic functi...
Definition: image.h:72
Represents a graphic metafile. Objects of this class should only be allocated using System::MakeObjec...
Definition: metafile.h:44
Drawing::Imaging::ImageFormatPtr m_image_format
Image format.
Definition: metafile.h:154
Rectangle m_bounds
A bounding rectangle of the image.
Definition: metafile.h:156
virtual SharedPtr< Image > Clone() override
Returns a copy of the current object.
virtual void Draw(SkCanvas *sk_canvas, const SkRect &dest_rect, SkMatrix *matrix, SkFilterQuality quality, SkBlendMode blend_mode) const override
Draws the the image to the specified region on the specified canvas. The source image is scaled and t...
Metafile(const SharedPtr< System::IO::Stream > &stream, IntPtr hdc, Rectangle rect, MetafileFrameUnit frameUnit, EmfType type)
NOT IMPLEMENTED.
virtual std::unique_ptr< SkCanvas > GetDrawingCanvas() const override
NOT IMPLEMENTED.
ArrayPtr< uint8_t > m_metafile_data
Definition: metafile.h:163
Metafile(const SharedPtr< System::IO::Stream > &stream, IntPtr hdc)
NOT IMPLEMENTED.
IntPtr GetHenhmetafile()
NOT IMPLEMENTED.
virtual sk_sp< SkData > GetRawBytes(SkEncodedImageFormat encoder_type, int quality) override
NOT IMPLEMENTED.
std::unique_ptr< SkBitmap > m_dummy_sk_bitmap
An SkBitmap object representing the image.
Definition: metafile.h:162
virtual Imaging::ImageFormatPtr get_RawFormat() const override
Returns a value the indicates the image format.
SharedPtr< MetafileHeader > GetMetafileHeader()
Returns a header associated with the current object.
void PlayRecord(EmfPlusRecordType, int32_t, int32_t, System::ByteArrayPtr)
NOT IMPLEMENTED.
int m_height
The hegiht of the image.
Definition: metafile.h:160
Metafile(IntPtr, EmfType)
NOT IMPLEMENTED.
Metafile(const SharedPtr< System::IO::Stream > &stream, IntPtr hdc, RectangleF rect, MetafileFrameUnit frameUnit, EmfType type)
NOT IMPLEMENTED.
virtual int get_Width() const override
Returns the width of the image in pixels.
virtual void Draw(SkCanvas *sk_canvas, const SkRect &dest_rect, const SkRect &src_rect, SkMatrix *matrix, SkFilterQuality quality, SkBlendMode blend_mode) const override
Draws the specified region of the image to the specified region on the specified canvas....
virtual ~Metafile()
Destructor.
virtual void Draw(SkCanvas *sk_canvas, ArrayPtr< PointF > dest_points, const SkRect &src_rect, SkMatrix *matrix, SkFilterQuality quality, SkBlendMode blend_mode) const override
Draws the specified region of the image to the specified region on the specified canvas....
virtual void Draw(SkCanvas *sk_canvas, const System::Details::ArrayView< PointF > &dest_points, const SkRect &src_rect, SkMatrix *matrix, SkFilterQuality quality, SkBlendMode blend_mode) const override
Draws the specified region of the image to the specified region on the specified canvas....
virtual int get_Height() const override
Returns the heights of the image in pixels.
virtual Imaging::PixelFormat get_PixelFormat() const override
Returns a value the indicates the pixel format.
virtual Imaging::PixelFormat GetOriginalFormat() const override
Returns the original image format.
Metafile(const SharedPtr< System::IO::Stream > &stream, IntPtr hdc, EmfType type)
NOT IMPLEMENTED.
Metafile(const SharedPtr< System::IO::Stream > &stream)
NOT IMPLEMENTED.
Metafile(const System::String &filename)
NOT IMPLEMENTED.
int m_width
The width of the image.
Definition: metafile.h:158
Metafile(const SharedPtr< System::IO::Stream > &stream, const Drawing::Imaging::ImageFormatPtr &image_format)
Constructs a new instance of Metafile class.
virtual const SkEncodedImageFormat GetSkEncodedFormat() const override
Returns an underlying SkEncodedFormat object.
virtual const SkBitmap * GetSkBitmap() const override
Returns an underlying SkBitmap object.
Represents a rectangular area of an image defined as single-precision floating point X and Y coordina...
Definition: rectangle_f.h:15
Represents a rectangular area of an image defined as integer X and Y coordinates of its upper left co...
Definition: rectangle.h:19
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: smart_ptr.h:180
String class used across the library. Is a substitute for C# System.String when translating code....
Definition: string.h:122
@ Bitmap
Defines color adjustment information for Bitmap objects.
PixelFormat
Specifies the color data format of a pixel.
Definition: pixel_format.h:17
EmfType
Specifies the types of the records that are placed in an EMF file.
Definition: emf_type.h:9
MetafileFrameUnit
Specifies the unit of measurement for the rectangle used to size and position a metafile.
Definition: metafile_frame_unit.h:9
EmfPlusRecordType
Represents the methods that can be used with a metafile to read and write graphic commands.
Definition: emf_plus_record_type.h:8
Definition: db_command.h:9