First of all I'am French, so sorry for my english!
I'am trying to run this program :
- Code: Select all
#include <stdio.h>
#include <stdlib.h>
#include <wand/MagickWand.h>
int main (int argc, char **argv){
MagickWand *mw;
DrawingWand *dw;
PixelWand *cw;
MagickWandGenesis ();
mw = NewMagickWand ();
dw = NewDrawingWand ();
cw = NewPixelWand ();
PixelSetColor (cw, "white");
MagickNewImage (mw, 640, 480, cw);
DrawSetStrokeOpacity (dw, 1);
PixelSetColor (cw, "red");
DrawSetStrokeColor (dw, cw);
DrawLine (dw, 100, 100, 200, 200);
DrawSetFillOpacity (dw, 0.0);
DrawCircle (dw, 200, 200, 250, 250);
MagickDrawImage (mw, dw);
MagickWriteImage (mw, "image.png");
cw = DestroyPixelWand (cw);
mw = DestroyMagickWand (mw);
dw = DestroyDrawingWand (dw);
MagickWandTerminus();
return EXIT_SUCCESS;
}
I use the makefile below :
- Code: Select all
CPPFLAGS=-I/usr/local/include/ImageMagick
LDFLAGS=-L/usr/local/lib -lMagickWand
all: wand-test
wand-test: wand-test.c
gcc -o wand-test $< $(CPPFLAGS) $(LDFLAGS)
clean:
rm wand-test
And I enter this in my console :
- Code: Select all
bok@ubuntu:~/Documents/LC4/testM$ make
gcc -o wand-test wand-test.c -I/usr/local/include/ImageMagick -L/usr/local/lib -lMagickWand
bok@ubuntu:~/Documents/LC4/testM$ ./wand-test
bok@ubuntu:~/Documents/LC4/testM$ ls
makefile makefile~ wand-test wand-test.c wand-test.c~
The problem is than nothing appears and no file is created !
Am I doing this wrong ?
Thanks in advance.