Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Monday, February 20, 2017 10:19:36 AM(UTC)
Nick Villalobos

Groups: Registered
Posts: 119

Was thanked: 4 time(s) in 4 post(s)

Below you will find sample code for creating non-automated annotations using LEADTOOLS 19 in Java. This simply creates a blank RasterImage in which annotations are then created and rendered to the image.

Code:

static void createAnn(){
		RasterCodecs codecs = new RasterCodecs();
		
        RasterImage image = RasterImage.create(750, 900, 24, 150, RasterColor.fromHtml("White"));
		System.out.println("RasterImage created successful");
		
		double inch = 720;
		AnnContainer container = new AnnContainer();
		container.setSize(LeadSizeD.create(8.5 * inch, 11 * inch));
		
		AnnRectangleObject rectangleObject = new AnnRectangleObject();
		rectangleObject.setRect(LeadRectD.create(3 * inch, 3 * inch, 1 * inch, 1 * inch));	
		container.getChildren().add(rectangleObject);
		System.out.println("Rect created successful");		

		AnnNoteObject noteObject = new AnnNoteObject();
		noteObject.setRect(LeadRectD.create(0, 0, 800, 800));
		noteObject.setText("LEADTOOLS");
		container.getChildren().add(noteObject);
		System.out.println("Note created successful");	
				
		// Burn the annotations on this image
		AnnJavaRenderingEngine renderingEngine = new AnnJavaRenderingEngine();
		renderingEngine.renderOnImage(container, image);
		
		codecs.save(image, "C:\\Java_Render.tif", RasterImageFormat.TIF, 0);
		System.out.println("Render successful");

				
		
	}
Nick Villalobos
Developer Support Engineer
LEAD Technologies, Inc.

LEAD Logo
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.032 seconds.