Home pageFind It!Contact PJAPJA documentation

PJA

 PJA Toolkit forum

This forum is dedicated to PJA Toolkit.
You may read freely the messages it contents. If you want to write a message or answer to a subject, subscribe to it first.

Subjects Recent messages Login Subscribe

Messages of subject How to make use of PJAToolKit to reduce memory consumption?

yamato

Member since : May 26, 2005
Messages : 1
 May 26, 2005 at 11:22 AM
Hi Manu,

I would like to use PJAToolKit in a way to reduce the memory consumption of some image manipulation operations(e.g. load, rotate, create, etc). And my application is not running at headless mode. So I believe I need to explicitly use the PJAToolKit classes. But I have some doubts as how I can make use of PJATookKit at code level.

Below are some sample codes u show us as how to explicitly use the PJAToolKit classes:

// Read an image using explicitly PJAToolkit class
// to avoid setting X11 Display or changing System properties
java.awt.Image image = new com.eteks.awt.PJAToolkit().getImage("photo.jpg");

// Apply a filter on the image. You could also draw into it with the Graphics object
// returned by getGraphics (but without Java2D features)
java.awt.image.ImageProducer filteredImage = new java.awt.image.FilteredImageSource (
image.getSource (), new com.sun.jimi.core.filters.AreaAverageScaleFilter (150, 150));

// Encode the image with JIMI JPEG encoder
com.sun.jimi.core.Jimi.putImage ("image/jpeg", filteredImage,
new java.io.FileOutputStream ("photo150x150.jpg"));

From the codes i can see that reading image use PJAToolKit classes explicitly. My question is, is this step the crucial part where we can make use of PJAToolKit and achieve the purpose of reducing memory consumption? If not, can you pls highlight how and what I can do to make use of PJAToolKit to reduce memory consumption in my application. Thank you very much.

Regards,
Susan
---
Yamato


Home pageFind It!ContactTop

© Copyrights 1997-2023 eTeks - All rights reserved

PJAPJA documentation