I've tried to add text to image:
ImageInfo newImageiInfo=new ImageInfo();
newImageiInfo.setSize("500x500");
newImageiInfo.setUnits(ResolutionType.PixelsPerInchResolution);
newImageiInfo.setColorspace(ColorspaceType.RGBColorspace);
newImageiInfo.setDepth(8);
MagickImage destImage = new MagickImage();
destImage.allocateImage(newImageiInfo);
destImage.setYResolution(480);
destImage.setXResolution(640);
destImage.setBorderColor(PixelPacket.queryColorDatabase("red"));
DrawInfo aInfo = new DrawInfo(newImageiInfo);
aInfo.setFill(PixelPacket.queryColorDatabase("yellow"));
aInfo.setUnderColor(PixelPacket.queryColorDatabase("red"));
aInfo.setOpacity(100);
aInfo.setPointsize(36);
aInfo.setFont("Arial");
aInfo.setGeometry("+50+50");
aInfo.setText("Test");
destImage.annotateImage(aInfo);
destImage.setFileName("file.png");
destImage.writeImage(newImageiInfo);
But I have only black quadrat only... Where is my mistake? I saw many examples, but it doesn't work for me. But I can scale and composite images as well - therefore ImageMagick and JMagick is works. Help me, please!
Reason of my problem is: a fonts was not configured. I tried
and receive:
Then some googling and Solution for me
I hope it's usefull for somebody....