• Post Reply Bookmark Topic Watch Topic
  • New Topic

Writing text on the image using jmagick

 
Venkatesh Ram
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have tried to write text on the image using Jmagick.The code i have done is below.It is copiling but while executing it shows the eroor message as

#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x7c9111de, pid=3160, tid=1360
#
# Java VM: Java HotSpot(TM) Client VM (1.5.0_08-b03 mixed mode, sharing)
# Problematic frame:
# C [ntdll.dll+0x111de]
#
# An error report file with more information is saved as hs_err_pid3160.log
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
#

[error occurred during error reporting, step 270, id 0xc0000005]




and the code is:





import java.io.*;
import java.awt.*;
import magick.*;

class InsertText
{
public static void main(String a[]) throws IOException,MagickException
{
ImageInfo info=new ImageInfo("tigerShereKhanOnLog1.jpg");
MagickImage image=new MagickImage(info);
DrawInfo aInfo = new DrawInfo(info);
aInfo.setFill(PixelPacket.queryColorDatabase("yellow"));
aInfo.setUnderColor(PixelPacket.queryColorDatabase("yellow"));

aInfo.setOpacity(0);
aInfo.setPointsize(36);
aInfo.setFont("Arial");

aInfo.setGeometry("+40+40");
aInfo.setText("JMagick Tutorial");

image.annotateImage(aInfo);
image.setFileName("text.jpg");
image.writeImage(info);
}}



Could anybody solve and tell me how to do that.Thanks in advance
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!