You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
int main(int argc, char** argv)
{
using namespace mapnik;
// create image and fill with colour
Image32 img(800,800);
img.setBackground(Color(0,0,255));
// save to file stream
std::ofstream file("test.png", std::ios::out| std::ios::trunc|std::ios::binary);
if (file)
{
save_as_png(file,img.data());
}
// save to string stream
std::ostringstream ss(std::ios::out|std::ios::binary);
save_as_png(ss,img.data());
std::cout << "buffer size = " << ss.str().size() << "\n";
It would be good to be able to output the raw data of a map image to a given output stream in the same way that you can output to file. For example:
Image32 buf(m.getWidth(),m.getHeight());
agg_renderer r(m,buf);
r.apply();
save_to_file(pngfile,"png",buf.data());
As well as save_to_file, have an output_to_stream function such as:
output_to_stream (std::cout, "png", buf.data());
The text was updated successfully, but these errors were encountered: