// Last updated 2008/11/04 11:11 // https://imagemagick.dev.org.tw/discourse-server/viewtopic.php?f=10&t=10993 // convert -size 640x480 xc:none -fill white -draw 'roundRectangle 15,15 624,464 15,15' logo: -compose SrcIn -composite mask_result.png #include <windows.h> #include <wand/magick_wand.h> void test_wand(void) { MagickWand *m_wand = NULL; MagickWand *l_wand = NULL; PixelWand *p_wand = NULL; DrawingWand *d_wand = NULL; MagickWandGenesis(); m_wand = NewMagickWand(); l_wand = NewMagickWand(); p_wand = NewPixelWand(); d_wand = NewDrawingWand(); // Create the initial 640x480 transparent canvas PixelSetColor(p_wand,"none"); MagickNewImage(m_wand,640,480,p_wand); PixelSetColor(p_wand,"white"); DrawSetFillColor(d_wand,p_wand); DrawRoundRectangle( d_wand, 15,15, 624,464, 15,15 ); MagickDrawImage(m_wand, d_wand); MagickReadImage(l_wand,"logo:"); // Note that MagickSetImageCompose is usually only used for the MagickMontageImage // function and isn't used or needed by MagickCompositeImage MagickCompositeImage(m_wand,l_wand,SrcInCompositeOp,0,0); /* Write the new image */ MagickWriteImage(m_wand,"mask_result.png"); /* Clean up */ if(m_wand)m_wand = DestroyMagickWand(m_wand); if(l_wand)l_wand = DestroyMagickWand(l_wand); if(d_wand)d_wand = DestroyDrawingWand(d_wand); if(p_wand)p_wand = DestroyPixelWand(p_wand); MagickWandTerminus(); }