Open
Description
The first line is lost after rotation 90:
bool content(tvg::Canvas* canvas, uint32_t w, uint32_t h) override
{
if (!canvas) return false;
//Open file manually
ifstream file(EXAMPLE_DIR"/image/test.png", ios::binary);
if (!file.is_open()) return false;
auto begin = file.tellg();
file.seekg(0, std::ios::end);
auto size = file.tellg() - begin;
auto data = (char*)malloc(size);
file.seekg(0, std::ios::beg);
file.read(data, size);
file.close();
auto picture = tvg::Picture::gen();
if (!tvgexam::verify(picture->load(data, size, "png", "", true))) return false;
free(data);
picture->translate(600, 0);
picture->rotate(90);
canvas->push(picture);
return true;
}
Metadata
Metadata
Assignees
Type
Projects
Status
No status