Initial commit

This commit is contained in:
2025-11-01 23:54:33 -05:00
commit f397068f8d
44 changed files with 13027 additions and 0 deletions

46
examples/capture.cpp Normal file
View File

@@ -0,0 +1,46 @@
#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)
{
Tesses::Framework::TF_Init();
auto devs = Device::GetDevices();
for(auto dev : devs)
{
for(auto res : dev.Resolutions)
{
Device dev2(dev.Device, res,10);
dev2.Open();
usleep(5000000);
auto frame = dev2.ReadFrame();
if(frame != nullptr)
{
Image clock;
Image clock2;
auto strm = std::make_shared<FileStream>("capture.png","wb");
auto date = Tesses::Framework::Date::DateTime::Now();
auto dateStr = date.ToString("%Y/%m/%d %I:%M %p");
clock.SetSize(GetCharWidth(dateStr.size()),CharHeight+2, Color(0,0,0,0));
//frame->FillRectangle(Rectangle(0,0,w,CharHeight+2),Colors::Blue);
clock.DrawString(dateStr,Point(0,1),Colors::Black);
clock.Resize(&clock2,Size(clock.Width()*2,clock.Height()*2));
frame->DrawImage(&clock2,Point(0,0), ImageCopyEffect::InvertIfNotTransparent);
Formats::Png.Save(strm,frame.get());
}
dev2.Close();
break;
}
}
return 0;
}