Code: Select all
convert -size 64x64 xc:blue -tile tile_weave.gif -draw 'circle 32,32 8,32' out.png
The "-size 64x64 xc:blue" and "-draw 'circle 32,32 8,32'" bits are easy, it's the "-tile tile_weave.gif" I'm having problems with.
Code: Select all
convert -size 64x64 xc:blue -tile tile_weave.gif -draw 'circle 32,32 8,32' out.png
Code: Select all
montage -texture tile_weave.gif rose: out.png
Code: Select all
#include <windows.h>
#include <stdio.h>
#include <string.h>
#include <wand/magick_wand.h>
#include <wand/magick-wand-private.h>
void test_wand(LPTSTR lpCmdLine)
{
MagickWand *m_wand = NULL;
PixelWand *p_wand;
DrawingWand *d_wand;
ImageInfo *read_info;
DrawInfo *draw_info;
ExceptionInfo exception;
GetExceptionInfo(&exception);
// unsigned long i_num;
// char msg[512];
MagickWandGenesis();
m_wand = NewMagickWand();
p_wand = NewPixelWand();
d_wand = NewDrawingWand();
// Create a new image
PixelSetColor(p_wand,"blue");
MagickNewImage(m_wand,640,640,p_wand);
// Draw the circle
DrawCircle(d_wand,320,320,320,600);
// Now "peek" at the wand
draw_info = PeekDrawingWand(d_wand);
read_info=CloneImageInfo(NULL);
// Put the name of the tile into the read_info
(void) CopyMagickString(read_info->filename,"zssa_p015_tile.png",MaxTextExtent);
// and then read the tile in to the fill_pattern
draw_info->fill_pattern = ReadImage(read_info,&exception);
read_info=DestroyImageInfo(read_info);
// Now draw the whole thing
DrawImage(m_wand->images,draw_info);
MagickWriteImage(m_wand,"zssa_tile_c.png");
/* Destroy everything */
DestroyExceptionInfo(&exception);
m_wand = DestroyMagickWand(m_wand);
p_wand = DestroyPixelWand(p_wand);
d_wand = DestroyDrawingWand(d_wand);
MagickWandTerminus();
}
Code: Select all
# without declarations or error checks
i_wand=NewMagickWand() # base image
t_wand=NewMagickWand() # image to tile with
d_wand=NewDrawingWand()
p_wand=NewPixelWand()
PixelSetColor(p_wand, "blue")
MagickNewImage(i_wand, 64, 64, p_wand) # base image, 64x64 blue
MagickReadImage(t_wand, "tile_weave.gif") # tile image
#
# *THIS* is the bit I couldn't figure out
#
DrawPushPattern(d_wand, "pick-a-name-any-name", 0, 0, 16, 16) # tile_weave is 16x16
DrawComposite(d_wand, SrcOverCompositeOp, 0, 0, 0, 0, t_wand)
DrawPopPattern(d_wand)
DrawSetFillPatternURL(d_wand, "#pick-a-name-any-name") # as above but with a '#'
# now draw circle
DrawCircle(d_wand, 32, 32, 8, 32)
MagickDrawImage(i_wand, d_wand)
# and write image
MagickWriteImages(i_wand, "64x64_blue_tile_wand_circle.png", 1)