diff --git a/core/base/Canvas.cpp b/core/base/Canvas.cpp index 13141bcc..8380002a 100644 --- a/core/base/Canvas.cpp +++ b/core/base/Canvas.cpp @@ -445,6 +445,12 @@ namespace easy2d cache_expired_ = true; } + void Canvas::Clear() + { + render_target_->Clear(); + cache_expired_ = true; + } + spImage Canvas::ExportToImage() const { auto image = new Image(GetBitmap()); diff --git a/core/base/Canvas.h b/core/base/Canvas.h index 9ab67f99..9af38b9a 100644 --- a/core/base/Canvas.h +++ b/core/base/Canvas.h @@ -153,6 +153,9 @@ namespace easy2d // 路径填充 void FillPath(); + // 清空画布 + void Clear(); + // 设置填充颜色 void SetFillColor( const Color& color