diff options
author | crupest <crupest@outlook.com> | 2023-10-06 20:55:42 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2023-10-06 20:55:42 +0800 |
commit | 538616817a749642836ad3b2faff16706500602e (patch) | |
tree | 4c1f00d653e7b339a4fbd505cd686993589c2c8c /demos/graphics | |
parent | ded4428d7286925db1f5ab9f18f549c85033839d (diff) | |
download | cru-538616817a749642836ad3b2faff16706500602e.tar.gz cru-538616817a749642836ad3b2faff16706500602e.tar.bz2 cru-538616817a749642836ad3b2faff16706500602e.zip |
...
Diffstat (limited to 'demos/graphics')
-rw-r--r-- | demos/graphics/CMakeLists.txt | 3 | ||||
-rw-r--r-- | demos/graphics/DrawCircle.cpp | 31 |
2 files changed, 0 insertions, 34 deletions
diff --git a/demos/graphics/CMakeLists.txt b/demos/graphics/CMakeLists.txt deleted file mode 100644 index b290ba13..00000000 --- a/demos/graphics/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_executable(CruDemoGraphicsDrawCircle DrawCircle.cpp) - -target_link_libraries(CruDemoGraphicsDrawCircle PRIVATE CruDemoBase) diff --git a/demos/graphics/DrawCircle.cpp b/demos/graphics/DrawCircle.cpp deleted file mode 100644 index 1ec06744..00000000 --- a/demos/graphics/DrawCircle.cpp +++ /dev/null @@ -1,31 +0,0 @@ -#include "cru/common/io/CFileStream.h" -#include "cru/platform/Color.h" -#include "cru/platform/bootstrap/Bootstrap.h" -#include "cru/platform/graphics/Factory.h" -#include "cru/platform/graphics/ImageFactory.h" -#include "cru/platform/graphics/Painter.h" - -#include <memory> - -int main() { - std::unique_ptr<cru::platform::graphics::IGraphicsFactory> graphics_factory( - cru::platform::bootstrap::CreateGraphicsFactory()); - - auto image = graphics_factory->GetImageFactory()->CreateBitmap(500, 500); - - { - auto brush = - graphics_factory->CreateSolidColorBrush(cru::platform::colors::skyblue); - auto painter = image->CreatePainter(); - painter->FillEllipse(cru::platform::Rect{200, 200, 100, 100}, brush.get()); - painter->EndDraw(); - } - - cru::io::CFileStream file_stream("./test_image.png", "w"); - - graphics_factory->GetImageFactory()->EncodeToStream( - image.get(), &file_stream, cru::platform::graphics::ImageFormat::Png, - 1.0f); - - return 0; -} |