recently I have been trying to experiment with vector graphics in C++. I want to make a Win32 app that reads an svg file and shows it on the screen. The program currently is simple. A window opens using the Win32 API and a .svg file is selected. This svg file's data is then converted to a struct data of my own. The conversion is good. The code of struct is as follows:
#pragma once
#include <vector>
#include "Rect.h"
class VectorTexture
{
public:
enum ShapeType
{
// Circle: x, y, r
Circle,
// Line: x1, y1, x2, y2, width
Line,
// Rectangle: x, y, width, height
Rectangle,
// Square: x, y, a
Square,
// Polygon: x[n], y[n]
Polygon
};
struct Shape
{
public:
ShapeType type;
float data[];
};
Rect rect;
std::vector<Shape> shapes;
};
Now, the next step is show the svg image. How can I rasterize the vector data that I have, to give me HBITMAP
that I can show on the screen? If you know any resources, please put up a link.
Thanks in advance.