projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Force wide char environment version initialization in wxGetEnvMap().
[wxWidgets.git]
/
include
/
wx
/
graphics.h
diff --git
a/include/wx/graphics.h
b/include/wx/graphics.h
index dc17baf0753548c39f39d0927166d516dce9e0d6..0e534a6e61ebaf603c0c084cb30fc9efb3f3a238 100644
(file)
--- a/
include/wx/graphics.h
+++ b/
include/wx/graphics.h
@@
-107,6
+107,7
@@
class WXDLLIMPEXP_FWD_CORE wxGraphicsBitmap;
//
class WXDLLIMPEXP_FWD_CORE wxGraphicsObjectRefData;
//
class WXDLLIMPEXP_FWD_CORE wxGraphicsObjectRefData;
+class WXDLLIMPEXP_FWD_CORE wxGraphicsBitmapData;
class WXDLLIMPEXP_FWD_CORE wxGraphicsMatrixData;
class WXDLLIMPEXP_FWD_CORE wxGraphicsPathData;
class WXDLLIMPEXP_FWD_CORE wxGraphicsMatrixData;
class WXDLLIMPEXP_FWD_CORE wxGraphicsPathData;
@@
-174,6
+175,13
@@
public:
#if wxUSE_IMAGE
wxImage ConvertToImage() const;
#endif // wxUSE_IMAGE
#if wxUSE_IMAGE
wxImage ConvertToImage() const;
#endif // wxUSE_IMAGE
+
+ void* GetNativeBitmap() const;
+
+ const wxGraphicsBitmapData* GetBitmapData() const
+ { return (const wxGraphicsBitmapData*) GetRefData(); }
+ wxGraphicsBitmapData* GetBitmapData()
+ { return (wxGraphicsBitmapData*) GetRefData(); }
private:
DECLARE_DYNAMIC_CLASS(wxGraphicsBitmap)
private:
DECLARE_DYNAMIC_CLASS(wxGraphicsBitmap)
@@
-510,6
+518,16
@@
public:
virtual wxGraphicsMatrix CreateMatrix( wxDouble a=1.0, wxDouble b=0.0, wxDouble c=0.0, wxDouble d=1.0,
wxDouble tx=0.0, wxDouble ty=0.0) const;
virtual wxGraphicsMatrix CreateMatrix( wxDouble a=1.0, wxDouble b=0.0, wxDouble c=0.0, wxDouble d=1.0,
wxDouble tx=0.0, wxDouble ty=0.0) const;
+ wxGraphicsMatrix CreateMatrix( const wxAffineMatrix2DBase& mat ) const
+ {
+ wxMatrix2D mat2D;
+ wxPoint2DDouble tr;
+ mat.Get(&mat2D, &tr);
+
+ return CreateMatrix(mat2D.m_11, mat2D.m_12, mat2D.m_21, mat2D.m_22,
+ tr.m_x, tr.m_y);
+ }
+
// push the current state of the context, ie the transformation matrix on a stack
virtual void PushState() = 0;
// push the current state of the context, ie the transformation matrix on a stack
virtual void PushState() = 0;
@@
-842,6
+860,7
@@
public:
virtual wxGraphicsBitmap CreateBitmap( const wxBitmap &bitmap ) = 0;
#if wxUSE_IMAGE
virtual wxGraphicsBitmap CreateBitmapFromImage(const wxImage& image) = 0;
virtual wxGraphicsBitmap CreateBitmap( const wxBitmap &bitmap ) = 0;
#if wxUSE_IMAGE
virtual wxGraphicsBitmap CreateBitmapFromImage(const wxImage& image) = 0;
+ virtual wxImage CreateImageFromBitmap(const wxGraphicsBitmap& bmp) = 0;
#endif // wxUSE_IMAGE
// create a graphics bitmap from a native bitmap
#endif // wxUSE_IMAGE
// create a graphics bitmap from a native bitmap
@@
-855,6
+874,16
@@
private:
DECLARE_ABSTRACT_CLASS(wxGraphicsRenderer)
};
DECLARE_ABSTRACT_CLASS(wxGraphicsRenderer)
};
-#endif
+
+#if wxUSE_IMAGE
+inline
+wxImage wxGraphicsBitmap::ConvertToImage() const
+{
+ wxGraphicsRenderer* renderer = GetRenderer();
+ return renderer ? renderer->CreateImageFromBitmap(*this) : wxNullImage;
+}
+#endif // wxUSE_IMAGE
+
+#endif // wxUSE_GRAPHICS_CONTEXT
#endif // _WX_GRAPHICS_H_
#endif // _WX_GRAPHICS_H_