Read file with EGAMI
Table of Contents
Include EGAMI
#include <egami/egami.hpp>
Declare image interface
// create an empty Image (no type and no inside data)
egami::Image image;
Read a Bitmap or an PNG
Read a bitmap
image = egami::load("DATA:read.bmp");
Read a PNG
Read a SVG
Read a svg
Read a svg and natively rescale it:
All example file
#include <test-debug/debug.hpp>
#include <etk/math/Vector2D.hpp>
#include <egami/egami.hpp>
#include "read.hpp"
static void readBMP() {
// create an empty Image (no type and no inside data)
egami::Image image;
image = egami::load("DATA:read.bmp");
TEST_INFO("image exist (BMP): " << image.exist());
}
static void readSVG() {
TEST_INFO("image exist (SVG): " << image.exist());
TEST_INFO("image exist (SVG-rescale): " << image.exist());
// TODO : image = egami::load("DATA:read.svg", 0.5);
TEST_INFO("image exist (SVG-scale): " << image.exist());
}
static void readPNG() {
TEST_INFO("image exist (PNG): " << image.exist());
}
void appl::read() {
readBMP();
readSVG();
readPNG();
}