I'm porting my scripts from command line to MagickWand API and I'd like to know how to create simple transparent image:
Code: Select all
convert -size 100x100 xc:none empty.png
Code: Select all
convert -size 100x100 xc:none empty.png
Code: Select all
/*
Make a plain transparent image
*/
#include <windows.h>
#include <wand/magick_wand.h>
void test_wand(void)
{
MagickWand *magick_wand = NULL;
PixelWand *p_wand = NULL;
MagickWandGenesis();
magick_wand = NewMagickWand();
MagickSetImageMatte(magick_wand,MagickTrue);
p_wand = NewPixelWand();
PixelSetColor(p_wand,"none");
MagickNewImage(magick_wand,100,100,p_wand);
MagickWriteImage(magick_wand,"empty.png");
/* Clean up */
if(magick_wand)magick_wand = DestroyMagickWand(magick_wand);
if(p_wand)p_wand = DestroyPixelWand(p_wand);
MagickWandTerminus();
}