mirror of
https://onedev.site.tesses.net/tesses-framework/tessesframework-gfx
synced 2026-02-08 16:35:45 +00:00
Initial commit
This commit is contained in:
23
examples/fillrect.cpp
Normal file
23
examples/fillrect.cpp
Normal file
@@ -0,0 +1,23 @@
|
||||
#include "TessesFrameworkGFX/TessesFrameworkGFX.hpp"
|
||||
|
||||
#include <cstdlib>
|
||||
|
||||
using namespace Tesses::Framework;
|
||||
using namespace Tesses::Framework::Graphics;
|
||||
using namespace Tesses::Framework::Graphics::ImageFormats;
|
||||
using namespace Tesses::Framework::Streams;
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
|
||||
TF_InitWithConsole();
|
||||
Image img;
|
||||
img.SetSize(128,128,Color::Parse(argv[2]));
|
||||
auto strm = std::make_shared<FileStream>(argv[1],"wb");
|
||||
|
||||
img.FillRectangle(Rectangle(32,32,64,64),Color::Parse(argv[3]));
|
||||
img.DrawLine(Point(8,8),Point(100,58),Colors::Yellow,10);
|
||||
img.DrawLine(Point(100,58),Point(8,100),Colors::Yellow,10);
|
||||
|
||||
Formats::Png.Save(strm,&img);
|
||||
}
|
||||
Reference in New Issue
Block a user