Rendering images

Hi to everyone
I have encountered a problem. That is, my initial intention was to create a program to render all the image in the images folder. The image will appear one by one in the graphical user interface (GUI), for the user to view while waiting. Code are provided below.
However I have tried lot of methods yet unsuccessful. The images will appear only after the back-end have finished running the program, and show the final output.
If anyone will need me to elaborate more, I will be more pleased to do so.
Any help will be appreciated. Thank You.
Codes
private BufferedImage[] images;
int y = 0;
int x = 0;     
          for( int j=0; j<images.length; j++)
               imageWidth = images[j].getWidth();
               imageHeight = images[j].getHeight();
               //x and y axis
              /*To be able to display all the small images accordingly, need translate (x,y).
                *Use for loop.*/
                  AffineTransform aTran = new AffineTransform();
                  aTran.translate(0.5f, 0.5f);
                  g2.transform(aTran);
                  //AffineTransform aTran = AffineTransform.getTranslateInstance(x,y);
               if ((j % 7) == 0)
                  // reset x for next row (indeed, even for first row) to be at the
                  // first column of this row
                  x = 0;
                  // increment y to go to the next row
                  y += 80;
               x += 128; // same as x = x + 128
               if(j == 0)
                    alphaVal = alpha;
               else
                    alphaVal = 1.0f - alpha;
               ac = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, alphaVal);
               g2.setComposite(ac);
               g2.drawImage(images[j], x, y, this);
               //g2.drawRenderedImage(images[j], aTran);
          }

If I understand you, you have a problem with when the images are drawn, rather than the actual rendering, and that's probably to do with the way your painting routine (shown in the post) is called, rather than what it does.
If it were me I'd give each image a JPanel of it's own, subclassed to overload the paintComponent method with one to draw the image. Then I'd use MediaTracker to track the completion of loading for each image and call repaint on the corespoding panel.
A FlowLayout would probably serve to organise the pictures in the main window.

Similar Messages

  • Error - Rendered Image is NULL

    Hello !
    I am trying to work on animated objects. I have imported XMII Dynamic Graphics from sdn website and imported the same in my project.
    Now when I am tyring to use HorizLEDMeter or any of its object I am getting the error as  "Rendered Image is null".
    Can anyone please tell me what can be the solution for this ??
    Thanks.

    Please use the latest service pack. I was facing the same problem and after application of service pack, the problem was resolved
    Regards,
    Musarrat

  • How to change the bar chart rendering image format in SSRS

    Hello all,
    I am working with SQL Server 2008 R2 and I have a SSRS bar chart report, when the report got rendered over online or if the take Export (PDF and PPT), the image is in png format always, which is taking too much of time to execute the report in case of large
    data.
    Can, It be possible that the rendered image is in jpeg format instead of png.
    If Yes, please share the appropriate steps to follow:
    Thanks in advance
    Pankaj Kumar Yadav-

    Hi Pankaj067,
    According to your description, you want to change the bar chart rendering image format as JPEG format when previewing the report or exporting to a PDF file .
    In Reporting Services, the chart rendering image format is PNG by default. It’s a by-design behavior. And it doesn’t open any API for us to change the image type when exporting a chart to a format. So in your scenario, your requirement can’t be achieved
    in Reporting Services currently. I would recommend you submit a feature request to Microsoft at this site:
    https://connect.microsoft.com/SQLServer. So that we can try to modify and expand the product features based on your needs.
    If you have any question, please feel free to ask.
    Best regards,
    Qiuyun Yu
    Qiuyun Yu
    TechNet Community Support

  • Help needed in rendering images...ThAnkS

    I have 2 classes for rendering images. When i run the application, the images kept flashing, may i know how could i actually have 1 image appearing instead of many images flashing? In other words, i would like in a way similar to mosaic rendering process...Thanks alot
    import javax.swing.ImageIcon;
    import javax.swing.JApplet;
    import javax.swing.JComponent;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.Graphics;
    import java.awt.Toolkit;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.io.BufferedInputStream;
    * TumbleItem.java requires these files:
    * SwingWorker.java
    * all the images in the images/tumble directory
    * (or, if specified in the applet tag, another directory [dir]
    * with images named T1.gif ... Tx.gif, where x is the total
    * number of images [nimgs])
    * the appropriate code to specify that the applet be executed,
    * such as the HTML code in TumbleItem.html or TumbleItem.atag,
    * or the JNLP code in TumbleItem.jnlp
    public class TumbleItem extends JApplet
    implements ActionListener {
    int loopslot = -1; //the current frame number
    String dir; //the directory relative to the codebase
    //from which the images are loaded
    javax.swing.Timer timer;
    //the timer animating the images
    int pause; //the length of the pause between revs
    int offset; //how much to offset between loops
    int off; //the current offset
    int speed; //animation speed
    int nimgs; //number of images to animate
    int width; //width of the applet's content pane
    Animator animator; //the applet's content pane
    ImageIcon imgs[]; //the images
    int maxWidth; //width of widest image
    boolean finishedLoading = false;
    JLabel statusLabel;
    static Color[] labelColor = { Color.black, Color.black,
    Color.black, Color.black,
    Color.black, Color.black,
    Color.white, Color.white,
    Color.white, Color.white };
    //Called by init.
    protected void loadAppletParameters() {
    //Get the applet parameters.
    String at = getParameter("img");
    dir = (at != null) ? at : "images/tumble";
    at = getParameter("pause");
    pause = (at != null) ? Integer.valueOf(at).intValue() : 1900;
    at = getParameter("offset");
    offset = (at != null) ? Integer.valueOf(at).intValue() : 0;
    at = getParameter("speed");
    speed = (at != null) ? (1000 / Integer.valueOf(at).intValue()) : 100;
    at = getParameter("nimgs");
    nimgs = (at != null) ? Integer.valueOf(at).intValue() : 16;
    at = getParameter("maxwidth");
    maxWidth = (at != null) ? Integer.valueOf(at).intValue() : 0;
    * Create the GUI. For thread safety, this method should
    * be invoked from the event-dispatching thread.
    private void createGUI() {
    //Animate from right to left if offset is negative.
    width = getSize().width;
    if (offset < 0) {
    off = width - maxWidth;
    //Custom component to draw the current image
    //at a particular offset.
    animator = new Animator();
    animator.setOpaque(true);
    animator.setBackground(Color.white);
    setContentPane(animator);
    //Put a "Loading Images..." label in the middle of
    //the content pane. To center the label's text in
    //the applet, put it in the center part of a
    //BorderLayout-controlled container, and center-align
    //the label's text.
    statusLabel = new JLabel("Loading Images...",
    JLabel.CENTER);
    statusLabel.setForeground(labelColor[0]);
    animator.add(statusLabel, BorderLayout.CENTER);
    //Called when this applet is loaded into the browser.
    public void init() {
    loadAppletParameters();
    //Execute a job on the event-dispatching thread:
    //creating this applet's GUI.
    try {
    javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
    public void run() {
    createGUI();
    } catch (Exception e) {
    System.err.println("createGUI didn't successfully complete");
    //Set up the timer that will perform the animation.
    timer = new javax.swing.Timer(speed, this);
    timer.setInitialDelay(pause);
    timer.setCoalesce(false);
    timer.start(); //Start the animation.
    //Loading the images can take quite a while, so to
    //avoid staying in init() (and thus not being able
    //to show the "Loading Images..." label) we'll
    //load the images in a SwingWorker thread.
    imgs = new ImageIcon[nimgs];
    final SwingWorker worker = new SwingWorker() {
    public Object construct() {
    //Images are numbered 1 to nimgs,
    //but fill array from 0 to nimgs-1.
    for (int i = 0; i < nimgs; i++) {
    imgs[i] = loadImage(i+1);
    finishedLoading = true;
    return imgs;
    //Executes in the event-dispatching thread.
    public void finished() {
    //Remove the "Loading images" label.
    animator.removeAll();
    loopslot = -1;
    worker.start();
    //The component that actually presents the GUI.
    public class Animator extends JPanel {
    public Animator() {
    super(new BorderLayout());
    protected void paintComponent(Graphics g) {
    super.paintComponent(g);
    if (finishedLoading &&
    (loopslot > -1) && (loopslot < nimgs)) {
    if (imgs != null && imgs[loopslot] != null) {
    imgs[loopslot].paintIcon(this, g, off, 0);
    //Update the the loopslot (frame number) and the offset.
    //If it's the last frame, restart the timer to get a long
    //pause between loops.
    public void actionPerformed(ActionEvent e) {
    loopslot++;
    if (!finishedLoading) {
    int colorIndex = loopslot % labelColor.length;
    try {
    statusLabel.setForeground(labelColor[colorIndex]);
    } catch (NullPointerException exc) {}
    return;
    if (loopslot >= nimgs) {
    loopslot = 0;
    off += offset;
    if (off < 0) {
    off = width - maxWidth;
    } else if (off + maxWidth > width) {
    off = 0;
    animator.repaint();
    if (loopslot == nimgs - 1) {
    timer.restart();
    //Called to start the applet's execution.
    public void start() {
    if (finishedLoading && (nimgs > 1)) {
    timer.restart();
    //Called to stop (temporarily or permanently) the applet's execution.
    public void stop() {
    timer.stop();
    protected ImageIcon loadImage(int imageNum) {
    String path = dir + "/Image" + imageNum + ".jpg";
    int MAX_IMAGE_SIZE = 2400; //Change this to the size of
    //your biggest image, in bytes.
    int count = 0;
    BufferedInputStream imgStream = new BufferedInputStream(
    this.getClass().getResourceAsStream(path));
    if (imgStream != null) {
    byte buf[] = new byte[MAX_IMAGE_SIZE];
    try {
    count = imgStream.read(buf);
    imgStream.close();
    } catch (java.io.IOException ioe) {
    System.err.println("Couldn't read stream from file: " + path);
    return null;
    if (count <= 0) {
    System.err.println("Empty file: " + path);
    return null;
    return new ImageIcon(Toolkit.getDefaultToolkit().createImage(buf));
    } else {
    System.err.println("Couldn't find file: " + path);
    return null;
    public String getAppletInfo() {
    return "Title: TumbleItem v1.2, 23 Jul 1997\n"
    + "Author: Interactive Mosaic\n"
    + "A simple Item class to play an image loop.";
    public String[][] getParameterInfo() {
    String[][] info = {
    {"img", "string", "the directory containing the images to loop"},
    {"pause", "int", "pause between complete loops; default is 3900"},
    {"offset", "int", "offset of each image to simulate left (-) or "
    + "right (+) motion; default is 0 (no motion)"},
    {"speed", "int", "the speed at which the frames are looped; "
    + "default is 100"},
    {"nimgs", "int", "the number of images to be looped; default is 16"},
    {"maxwidth", "int", "the maximum width of any image in the loop; "
    + "default is 0"}
    return info;
    import javax.swing.SwingUtilities;
    public abstract class SwingWorker {
    private Object value; // see getValue(), setValue()
    * Class to maintain reference to current worker thread
    * under separate synchronization control.
    private static class ThreadVar {
    private Thread thread;
    ThreadVar(Thread t) { thread = t; }
    synchronized Thread get() { return thread; }
    synchronized void clear() { thread = null; }
    private ThreadVar threadVar;
    * Get the value produced by the worker thread, or null if it
    * hasn't been constructed yet.
    protected synchronized Object getValue() {
    return value;
    * Set the value produced by worker thread
    private synchronized void setValue(Object x) {
    value = x;
    * Compute the value to be returned by the <code>get</code> method.
    public abstract Object construct();
    * Called on the event dispatching thread (not on the worker thread)
    * after the <code>construct</code> method has returned.
    public void finished() {
    * A new method that interrupts the worker thread. Call this method
    * to force the worker to stop what it's doing.
    public void interrupt() {
    Thread t = threadVar.get();
    if (t != null) {
    t.interrupt();
    threadVar.clear();
    * Return the value created by the <code>construct</code> method.
    * Returns null if either the constructing thread or the current
    * thread was interrupted before a value was produced.
    * @return the value created by the <code>construct</code> method
    public Object get() {
    while (true) { 
    Thread t = threadVar.get();
    if (t == null) {
    return getValue();
    try {
    t.join();
    catch (InterruptedException e) {
    Thread.currentThread().interrupt(); // propagate
    return null;
    * Start a thread that will call the <code>construct</code> method
    * and then exit.
    public SwingWorker() {
    final Runnable doFinished = new Runnable() {
    public void run() { finished(); }
    Runnable doConstruct = new Runnable() {
    public void run() {
    try {
    setValue(construct());
    finally {
    threadVar.clear();
    SwingUtilities.invokeLater(doFinished);
    Thread t = new Thread(doConstruct);
    threadVar = new ThreadVar(t);
    * Start the worker thread.
    public void start() {
    Thread t = threadVar.get();
    if (t != null) {
    t.start();
    }

    I have 2 classes for rendering images. When i run the application, the images kept flashing, may i know how could i actually have 1 image appearing instead of many images flashing? In other words, i would like in a way similar to mosaic rendering process...Thanks alot
    import javax.swing.ImageIcon;
    import javax.swing.JApplet;
    import javax.swing.JComponent;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.Graphics;
    import java.awt.Toolkit;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.io.BufferedInputStream;
    * TumbleItem.java requires these files:
    * SwingWorker.java
    * all the images in the images/tumble directory
    * (or, if specified in the applet tag, another directory [dir]
    * with images named T1.gif ... Tx.gif, where x is the total
    * number of images [nimgs])
    * the appropriate code to specify that the applet be executed,
    * such as the HTML code in TumbleItem.html or TumbleItem.atag,
    * or the JNLP code in TumbleItem.jnlp
    public class TumbleItem extends JApplet
    implements ActionListener {
    int loopslot = -1; //the current frame number
    String dir; //the directory relative to the codebase
    //from which the images are loaded
    javax.swing.Timer timer;
    //the timer animating the images
    int pause; //the length of the pause between revs
    int offset; //how much to offset between loops
    int off; //the current offset
    int speed; //animation speed
    int nimgs; //number of images to animate
    int width; //width of the applet's content pane
    Animator animator; //the applet's content pane
    ImageIcon imgs[]; //the images
    int maxWidth; //width of widest image
    boolean finishedLoading = false;
    JLabel statusLabel;
    static Color[] labelColor = { Color.black, Color.black,
    Color.black, Color.black,
    Color.black, Color.black,
    Color.white, Color.white,
    Color.white, Color.white };
    //Called by init.
    protected void loadAppletParameters() {
    //Get the applet parameters.
    String at = getParameter("img");
    dir = (at != null) ? at : "images/tumble";
    at = getParameter("pause");
    pause = (at != null) ? Integer.valueOf(at).intValue() : 1900;
    at = getParameter("offset");
    offset = (at != null) ? Integer.valueOf(at).intValue() : 0;
    at = getParameter("speed");
    speed = (at != null) ? (1000 / Integer.valueOf(at).intValue()) : 100;
    at = getParameter("nimgs");
    nimgs = (at != null) ? Integer.valueOf(at).intValue() : 16;
    at = getParameter("maxwidth");
    maxWidth = (at != null) ? Integer.valueOf(at).intValue() : 0;
    * Create the GUI. For thread safety, this method should
    * be invoked from the event-dispatching thread.
    private void createGUI() {
    //Animate from right to left if offset is negative.
    width = getSize().width;
    if (offset < 0) {
    off = width - maxWidth;
    //Custom component to draw the current image
    //at a particular offset.
    animator = new Animator();
    animator.setOpaque(true);
    animator.setBackground(Color.white);
    setContentPane(animator);
    //Put a "Loading Images..." label in the middle of
    //the content pane. To center the label's text in
    //the applet, put it in the center part of a
    //BorderLayout-controlled container, and center-align
    //the label's text.
    statusLabel = new JLabel("Loading Images...",
    JLabel.CENTER);
    statusLabel.setForeground(labelColor[0]);
    animator.add(statusLabel, BorderLayout.CENTER);
    //Called when this applet is loaded into the browser.
    public void init() {
    loadAppletParameters();
    //Execute a job on the event-dispatching thread:
    //creating this applet's GUI.
    try {
    javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
    public void run() {
    createGUI();
    } catch (Exception e) {
    System.err.println("createGUI didn't successfully complete");
    //Set up the timer that will perform the animation.
    timer = new javax.swing.Timer(speed, this);
    timer.setInitialDelay(pause);
    timer.setCoalesce(false);
    timer.start(); //Start the animation.
    //Loading the images can take quite a while, so to
    //avoid staying in init() (and thus not being able
    //to show the "Loading Images..." label) we'll
    //load the images in a SwingWorker thread.
    imgs = new ImageIcon[nimgs];
    final SwingWorker worker = new SwingWorker() {
    public Object construct() {
    //Images are numbered 1 to nimgs,
    //but fill array from 0 to nimgs-1.
    for (int i = 0; i < nimgs; i++) {
    imgs[i] = loadImage(i+1);
    finishedLoading = true;
    return imgs;
    //Executes in the event-dispatching thread.
    public void finished() {
    //Remove the "Loading images" label.
    animator.removeAll();
    loopslot = -1;
    worker.start();
    //The component that actually presents the GUI.
    public class Animator extends JPanel {
    public Animator() {
    super(new BorderLayout());
    protected void paintComponent(Graphics g) {
    super.paintComponent(g);
    if (finishedLoading &&
    (loopslot > -1) && (loopslot < nimgs)) {
    if (imgs != null && imgs[loopslot] != null) {
    imgs[loopslot].paintIcon(this, g, off, 0);
    //Update the the loopslot (frame number) and the offset.
    //If it's the last frame, restart the timer to get a long
    //pause between loops.
    public void actionPerformed(ActionEvent e) {
    loopslot++;
    if (!finishedLoading) {
    int colorIndex = loopslot % labelColor.length;
    try {
    statusLabel.setForeground(labelColor[colorIndex]);
    } catch (NullPointerException exc) {}
    return;
    if (loopslot >= nimgs) {
    loopslot = 0;
    off += offset;
    if (off < 0) {
    off = width - maxWidth;
    } else if (off + maxWidth > width) {
    off = 0;
    animator.repaint();
    if (loopslot == nimgs - 1) {
    timer.restart();
    //Called to start the applet's execution.
    public void start() {
    if (finishedLoading && (nimgs > 1)) {
    timer.restart();
    //Called to stop (temporarily or permanently) the applet's execution.
    public void stop() {
    timer.stop();
    protected ImageIcon loadImage(int imageNum) {
    String path = dir + "/Image" + imageNum + ".jpg";
    int MAX_IMAGE_SIZE = 2400; //Change this to the size of
    //your biggest image, in bytes.
    int count = 0;
    BufferedInputStream imgStream = new BufferedInputStream(
    this.getClass().getResourceAsStream(path));
    if (imgStream != null) {
    byte buf[] = new byte[MAX_IMAGE_SIZE];
    try {
    count = imgStream.read(buf);
    imgStream.close();
    } catch (java.io.IOException ioe) {
    System.err.println("Couldn't read stream from file: " + path);
    return null;
    if (count <= 0) {
    System.err.println("Empty file: " + path);
    return null;
    return new ImageIcon(Toolkit.getDefaultToolkit().createImage(buf));
    } else {
    System.err.println("Couldn't find file: " + path);
    return null;
    public String getAppletInfo() {
    return "Title: TumbleItem v1.2, 23 Jul 1997\n"
    + "Author: Interactive Mosaic\n"
    + "A simple Item class to play an image loop.";
    public String[][] getParameterInfo() {
    String[][] info = {
    {"img", "string", "the directory containing the images to loop"},
    {"pause", "int", "pause between complete loops; default is 3900"},
    {"offset", "int", "offset of each image to simulate left (-) or "
    + "right (+) motion; default is 0 (no motion)"},
    {"speed", "int", "the speed at which the frames are looped; "
    + "default is 100"},
    {"nimgs", "int", "the number of images to be looped; default is 16"},
    {"maxwidth", "int", "the maximum width of any image in the loop; "
    + "default is 0"}
    return info;
    import javax.swing.SwingUtilities;
    public abstract class SwingWorker {
    private Object value; // see getValue(), setValue()
    * Class to maintain reference to current worker thread
    * under separate synchronization control.
    private static class ThreadVar {
    private Thread thread;
    ThreadVar(Thread t) { thread = t; }
    synchronized Thread get() { return thread; }
    synchronized void clear() { thread = null; }
    private ThreadVar threadVar;
    * Get the value produced by the worker thread, or null if it
    * hasn't been constructed yet.
    protected synchronized Object getValue() {
    return value;
    * Set the value produced by worker thread
    private synchronized void setValue(Object x) {
    value = x;
    * Compute the value to be returned by the <code>get</code> method.
    public abstract Object construct();
    * Called on the event dispatching thread (not on the worker thread)
    * after the <code>construct</code> method has returned.
    public void finished() {
    * A new method that interrupts the worker thread. Call this method
    * to force the worker to stop what it's doing.
    public void interrupt() {
    Thread t = threadVar.get();
    if (t != null) {
    t.interrupt();
    threadVar.clear();
    * Return the value created by the <code>construct</code> method.
    * Returns null if either the constructing thread or the current
    * thread was interrupted before a value was produced.
    * @return the value created by the <code>construct</code> method
    public Object get() {
    while (true) { 
    Thread t = threadVar.get();
    if (t == null) {
    return getValue();
    try {
    t.join();
    catch (InterruptedException e) {
    Thread.currentThread().interrupt(); // propagate
    return null;
    * Start a thread that will call the <code>construct</code> method
    * and then exit.
    public SwingWorker() {
    final Runnable doFinished = new Runnable() {
    public void run() { finished(); }
    Runnable doConstruct = new Runnable() {
    public void run() {
    try {
    setValue(construct());
    finally {
    threadVar.clear();
    SwingUtilities.invokeLater(doFinished);
    Thread t = new Thread(doConstruct);
    threadVar = new ThreadVar(t);
    * Start the worker thread.
    public void start() {
    Thread t = threadVar.get();
    if (t != null) {
    t.start();
    }

  • Rendering Image in JPanel

    Hi,
    I am completely new to java imaging and I am planning to build a small image viewer application (something similar to the comic book reader).
    After some search and following the discussion here [http://forum.java.sun.com/thread.jspa?forumID=20&threadID=362429|http://forum.java.sun.com/thread.jspa?forumID=20&threadID=362429] , I have main app consists of JFrame with SplitPane which consists a ScrollPane. In separate class, I have JPanel class. I am trying to add the JPanel in ScrollPane when application starts. JPane is responsible for fetching and rendering image but something went wrong and it is giving me a NullPointer Exceptions. So far I was able to figure out that it is causing by the "paintComponent" method but no idea why. I am looking for a nice suggestions and guidance on this topic (especially something like why it didn't work and various ways to do things). "For Dummies" style suggestions are highly appreciated.
    Follwing are my two classes:
    ===============================
    =======================
    Separate JPanel Class
    =======================
    * JPanelCanvas.java
    * Created on July 17, 2008, 4:16 PM
    package org.zeenet.bookreader;
    * @author  Deepak K. Shrestha
    import java.awt.*;
    import java.awt.image.*;
    import javax.imageio.*;
    import java.io.*;
    public class JPanelCanvas extends javax.swing.JPanel {
        BufferedImage prevImg, currImg, nextImg = null;
        Graphics g;
        /** Creates new form JPanelCanvas */
        public JPanelCanvas() {
            initComponents();
            getImage();
            setSize();
            paintComponent(g); //<<<<-- so far this is causing the trouble <<<<
        //fetch image from file
        public void getImage() {
           try {
               currImg = ImageIO.read(new File("D:\\TEMPORARY\\logo.JPG"));
           } catch (IOException e) {
        public void setSize() {
            if (currImg == null) {
                 this.setPreferredSize(new Dimension (100,100));
            } else {
               this.setPreferredSize(new Dimension(currImg.getWidth(null), currImg.getHeight(null)));
        public void paintComponent(Graphics g) {
            super.paintComponent(g);
            g.drawImage(currImg, 0, 0, null);
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        @SuppressWarnings("unchecked")
        // <editor-fold defaultstate="collapsed" desc="Generated Code">                         
        private void initComponents() {
            javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
            this.setLayout(layout);
            layout.setHorizontalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGap(0, 400, Short.MAX_VALUE)
            layout.setVerticalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGap(0, 300, Short.MAX_VALUE)
        }// </editor-fold>                       
        // Variables declaration - do not modify                    
        // End of variables declaration                  
    }==========================
    Main application
    ==========================
    * JFrameReader.java
    * Created on July 16, 2008, 3:16 PM
    package org.zeenet.bookreader;
    import javax.swing.*;
    * @author  Deepak K. Shrestha
    public class JFrameReader extends javax.swing.JFrame {
        /** Creates new form JFrameReader */
        public JFrameReader() {
            initComponents();
            setExtendedState(JFrameReader.MAXIMIZED_BOTH); //maximize application
            jScrollPaneCanvas.add(new JPanelCanvas()); //<<<<---attached the JPanel here <<<<<<<<<
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        @SuppressWarnings("unchecked")
        // <editor-fold defaultstate="collapsed" desc="Generated Code">                         
        private void initComponents() {
            jLayeredPane1 = new javax.swing.JLayeredPane();
            jSplitPane1 = new javax.swing.JSplitPane();
            jScrollPaneCanvas = new javax.swing.JScrollPane();
            jScrollPaneList = new javax.swing.JScrollPane();
            jListItem = new javax.swing.JList();
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
            setTitle("zeeBookReader");
            jSplitPane1.setRightComponent(jScrollPaneCanvas);
            jListItem.setModel(new javax.swing.AbstractListModel() {
                String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };
                public int getSize() { return strings.length; }
                public Object getElementAt(int i) { return strings; }
    jScrollPaneList.setViewportView(jListItem);
    jSplitPane1.setLeftComponent(jScrollPaneList);
    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)
    .addComponent(jSplitPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)
    layout.setVerticalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
    .addComponent(jSplitPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 264, Short.MAX_VALUE)
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    .addComponent(jLayeredPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE))
    pack();
    }// </editor-fold>
    * @param args the command line arguments
    public static void main(String args[]) {
    java.awt.EventQueue.invokeLater(new Runnable() {
    public void run() {
    new JFrameReader().setVisible(true);
    // Variables declaration - do not modify
    private javax.swing.JLayeredPane jLayeredPane1;
    private javax.swing.JList jListItem;
    private javax.swing.JScrollPane jScrollPaneCanvas;
    private javax.swing.JScrollPane jScrollPaneList;
    private javax.swing.JSplitPane jSplitPane1;
    // End of variables declaration
    =======================
    By the way I am using Netbeans and all swing components are created using GUI editor.
    Trying to build this app gives me following error:
    ===========================================
    init:
    deps-jar:
    compile:
    run:
    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    at javax.swing.JComponent.paintComponent(JComponent.java:766)
    at org.zeenet.bookreader.JPanelCanvas.paintComponent(JPanelCanvas.java:54)
    at org.zeenet.bookreader.JPanelCanvas.<init>(JPanelCanvas.java:30)
    at org.zeenet.bookreader.JFrameReader.<init>(JFrameReader.java:22)
    at org.zeenet.bookreader.JFrameReader$2.run(JFrameReader.java:80)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
    BUILD STOPPED (total time: 10 seconds)
    ===============================================
    Thanks

    You should not call paintComponent explicitly (especially with a null Graphics object).
    It is called internally when the component needs to repaint itself.
    Read this: [Performing Custom Painting|http://java.sun.com/docs/books/tutorial/uiswing/painting/]

  • Rendered images are not appearing on the webpage. works fine on IE. All plugins appear to be present includeing Adobe Flash

    rendered images are not appearing on the webpage. works fine on IE. All plugins appear to be present including Adobe Flash

    If that only happens on a specific page or domain then make sure that you do not block images on that domain.
    See [[Images or animations do not show]]
    *A way to see which images are blocked is to click the favicon (<i>Site Identification</i> icon) on the left side of the location bar.
    *A click on the "More Information" button will open the Security tab of the "Page Info" window (also accessible via "Tools > Page Info").
    *Go to the <i>Media</i> tab of that "Tools > Page Info" window.
    *Select the first image link and scroll down though the list with the Down arrow key.
    *If an image in the list is grayed and there is a check-mark in the box "<i>Block Images from...</i>" then remove that mark to unblock the images from that domain.
    *You can see the permissions for the domain in the current tab in Tools > Page Info > Permissions
    *You can see all image exceptions in Tools > Options > Content: Load Images > Exceptions

  • Rendering images based on BLOB columns

    Hello
    I'm using JDevelpor 10G ..
    I want to render image from BLOB column , and its the first time working with servlet , I read this article
    http://www.pascalalma.net/2008/04/22/oracle-adf-medior-rendering-images-based-on-blob-columns/
    and I want to ask some questions ??
    - How can I check that the servlet is run .. I use this to call the servlet "" Do not laugh .. I am really new "
    <af:objectImage source="/render_image?img_id=#{row.ImageId}"/>
    You should read the article to understand my question
    rgds

    done , my problem was with mapping
    If you have any problem with this case I can help
    contact me
    [email protected]

  • GeoRaster theme: no rendered images

    I have loaded/validated a georaster. It appears fine in the GeoRasterViewer, and the spatial extent appears fine as a vector theme in Mapviewer. But addGeoRasterTheme in my jsp results in the log warning:
    "GeoRaster theme [themename] has no rendered images."
    Anyone have experience with the root cause of this warning? Does this indicate a problem with the georaster, or a problem with the request? Any feedback is appreciated.

    Here's the log. (the 'exception while getting srid...' is a red flag! Hopefully it will lead to my mistake)
    Tue May 17 11:11:18 GMT-08:00 2005 FINEST [oracle.lbs.mapserver.oms] request= <?xml version="1.0" standalone="yes"?>
    <map_request
    datasource="kingcomv"
    width="500"
    height="400"
    bgcolor="#ffffff"
    antialiase="false"
    format="JPEG_URL">
    <center size="10000.0">
    <geoFeature>
    <geometricProperty typeName="center">
    <Point>
    <coordinates>1301437.0,300000.0</coordinates>
    </Point>
    </geometricProperty>
    </geoFeature>
    </center>
    <themes>
    <theme name="georFootprint">
    <jdbc_query
    spatial_column="geometry"
    render_style="L.THICKBLUE"
    jdbc_srid="41177"
    datasource="kingcomv"
    asis="false">select a.georaster.spatialextent as geometry from georaster a
    </jdbc_query>
    </theme>
    <theme name="themeGeor" min_scale="Infinity" max_scale="-Infinity">
    <jdbc_georaster_query
    georaster_table="GEORASTER"
    georaster_column="GEORASTER"
    raster_table="GEORASTER_RDT1"
    jdbc_srid="41177"
    datasource="kingcomv"
    asis="false">
    </jdbc_georaster_query>
    </theme>
    </themes>
    </map_request>
    Tue May 17 11:11:18 GMT-08:00 2005 FINEST [oracle.sdovis.JSDOGeometry] exception while getting srid from a geometry node: For input string: ""
    Tue May 17 11:11:18 GMT-08:00 2005 DEBUG [oracle.lbs.mapserver.core.MapperPool] getMapper(kingcomv) begins...
    Tue May 17 11:11:18 GMT-08:00 2005 DEBUG [oracle.lbs.mapserver.core.MapperPool] getMapper() succeeded.
    Tue May 17 11:11:18 GMT-08:00 2005 FINEST [oracle.lbs.mapserver.core.RealWorker] adding additional themes...
    Tue May 17 11:11:18 GMT-08:00 2005 FINEST [oracle.lbs.mapserver.core.RealWorker] adding a JDBC Theme:
    ThemeDescriptor=
    name=georFootprint
    type=2
    minScale=Infinity
    maxScale=-Infinity
    srid=41177
    host=null
    sid=null
    port=null
    user=null
    mode=null
    query=select a.georaster.spatialextent as geometry from georaster a
    spatialColumn=geometry
    renderStyleName=L.THICKBLUE
    labelColumn=
    labelStyleName=
    renderStyleDef=null
    labelStyleDef=null
    localThem=null
    Tue May 17 11:11:18 GMT-08:00 2005 FINEST [oracle.lbs.mapserver.core.RealWorker] adding a JDBC GeoRaster Theme:
    ThemeDescriptor=
    name=themeGeor
    type=5
    minScale=Infinity
    maxScale=-Infinity
    srid=41177
    localThem=null
    Tue May 17 11:11:18 GMT-08:00 2005 FINEST [oracle.sdovis.SRS] got srs object for :41177
    Tue May 17 11:11:18 GMT-08:00 2005 FINEST [oracle.sdovis.SRS] *** isGeodetic=false, unit=U.S. FOOT
    Tue May 17 11:11:18 GMT-08:00 2005 DEBUG [oracle.sdovis.DBMapMaker] LoadThemeData running thread: Thread-741
    Tue May 17 11:11:18 GMT-08:00 2005 DEBUG [oracle.sdovis.theme.grtp] [Master scale] 2400.0 [Scale factor for theme themeGeor] 1.0
    Tue May 17 11:11:18 GMT-08:00 2005 DEBUG [oracle.sdovis.theme.grtp] [Query] SELECT * FROM ( select grt.GEORASTER from GEORASTER grt where grt.GEORASTER.rasterid = null ) grt WHERE MDSYS.SDO_FILTER(grt.GEORASTER.spatialextent, MDSYS.SDO_GEOMETRY(2003, 41177, NULL, MDSYS.SDO_ELEM_INFO_ARRAY(1, 1003, 3), MDSYS.SDO_ORDINATE_ARRAY(1295187.0,295000.0,1307687.0,305000.0)), 'querytype=WINDOW') = 'TRUE'
    Tue May 17 11:11:18 GMT-08:00 2005 DEBUG [oracle.sdovis.DBMapMaker] LoadThemeData running thread: Thread-742
    Tue May 17 11:11:18 GMT-08:00 2005 DEBUG [oracle.sdovis.theme.DGTP] [Master scale] 2400.0 [Theme scale factor] 1.0
    Tue May 17 11:11:18 GMT-08:00 2005 FINEST [oracle.sdovis.theme.grtp] # image loaded: 0
    Tue May 17 11:11:18 GMT-08:00 2005 FINEST [oracle.sdovis.theme.DGTP] [DynGeomTheme] rewritten query: SELECT * FROM ( select a.georaster.spatialextent as geometry from georaster a ) WHERE MDSYS.SDO_FILTER(geometry, MDSYS.SDO_GEOMETRY(2003, 41177, NULL, MDSYS.SDO_ELEM_INFO_ARRAY(1, 1003, 3), MDSYS.SDO_ORDINATE_ARRAY(1295187.0,295000.0,1307687.0,305000.0)), 'querytype=WINDOW') = 'TRUE'
    Tue May 17 11:11:18 GMT-08:00 2005 DEBUG [oracle.sdovis.theme.DGTP] Retrieving geometries...
    Tue May 17 11:11:18 GMT-08:00 2005 DEBUG [oracle.sdovis.theme.DGTP] Read all geometries.
    Tue May 17 11:11:18 GMT-08:00 2005 DEBUG [oracle.sdovis.theme.DGTP] [GEORFOOTPRINT] Time spent loading 1 geometries:47ms
    Tue May 17 11:11:18 GMT-08:00 2005 INFO [oracle.sdovis.DBMapMaker] **** time spent on loading features: 47ms.
    Tue May 17 11:11:18 GMT-08:00 2005 FINEST [oracle.sdovis.RE] xfm: 0.04 0.0 0.0 -0.04 -51807.48 12200.0
    Tue May 17 11:11:18 GMT-08:00 2005 FINEST [oracle.sdovis.RE] rendering image theme: themeGeor
    Tue May 17 11:11:18 GMT-08:00 2005 WARN [oracle.sdovis.ImageRenderer] GeoRaster theme themeGeor has no rendered images.
    Tue May 17 11:11:18 GMT-08:00 2005 DEBUG [oracle.sdovis.VectorRenderer] time to render theme GEORFOOTPRINT with 1 styled features: 0ms
    Tue May 17 11:11:18 GMT-08:00 2005 DEBUG [oracle.sdovis.VectorRenderer] time to label theme GEORFOOTPRINT with 1 styled features: 0ms
    Tue May 17 11:11:18 GMT-08:00 2005 INFO [oracle.sdovis.DBMapMaker] **** time spent on rendering: 0ms
    Tue May 17 11:11:18 GMT-08:00 2005 DEBUG [oracle.sdovis.util.JPEGMaker] Time spent on JPEG encoding:15
    Tue May 17 11:11:18 GMT-08:00 2005 DEBUG [oracle.lbs.mapserver.core.MapperPool] freeMapper() begins...
    Tue May 17 11:11:18 GMT-08:00 2005 DEBUG [oracle.lbs.mapserver.core.RealWorker] [RealWorker] preparation time: 47ms
    Tue May 17 11:11:18 GMT-08:00 2005 DEBUG [oracle.lbs.mapserver.core.RealWorker] [RealWorker] querying/rendering time: 62ms
    Tue May 17 11:11:18 GMT-08:00 2005 DEBUG [oracle.lbs.mapserver.core.RealWorker] [RealWorker] packing time: 31ms
    Tue May 17 11:11:18 GMT-08:00 2005 DEBUG [oracle.lbs.mapserver.core.RealWorker] [RealWorker] --------------- total time: 140ms

  • Updated to LR 5.4, images now importing extremely slow. After importing and rendering images are still very slow to go through and develop. No issues in LR 5.3 which was very fast.

    After importing and rendering images are still very slow to go through and develop. No issues in LR 5.3 which was very fast. Canon,Nikon, Leica and Fuji files all rendering slow. iMac 2.9 ghz 16gb RAM OSX 10.8.5. Catalogs and images are kept on external drives. Drives running fine. Really need a fix on this since I'm norally imported and processing at least 4,000 images per LR Catalog. Is there way to revert back to 5.3? I can't use 5.4 is its current state. Thanks.

    Download LR 5.3 and install it
    By the way, lots of people have this complaint about LR 5.4, and the advice I give is to use LR 5.3 unless you need one of the new camera models supported by LR 5.4

  • How to get the rendered image on portal.

    Hi.
    I have 2 problems..
    (i)I have installed IBR. i have configured UCM with IBR through Provider.
    Now i am able to get all the renditions.
    But, can some one tell me, how can i get the rendered formats. Through Content ID, i can able to get only the native file. I need to get the rendered image also.
    I need to use those rendered format image on portal.
    (ii)
    how to change the image resolution?
    In damconverter_baserenditions.hda file contains those details, I need to change those details like, i need to change the rendition set according to my requirement. I changed that still it is not working. Kindly suggest me something.

    (i)I have installed IBR. i have configured UCM with IBR through Provider.
    Now i am able to get all the renditions.
    But, can some one tell me, how can i get the rendered formats. Through Content ID, i can able to get only the native file. I need to get the rendered image also.
    I need to use those rendered format image on portal.If you run a search that return also content items with multiple renditions, you will see a little camera symbol which opens RENDITION_INFO (or just call the service like http://server:port/instance/idcplg?IdcService=RENDITION_INFO&dID=X&dDocName=Y ). This will open the list of available renditions. You may copy the link to the desired rendition. It will look like http://server:port/instance/idcplg?IdcService=GET_FILE&dID=X&dDocName=Y&RevisionSelectionMethod=specific&Rendition=Web&allowInterrupt=1

  • 'Could not create the file...' 'Access was denied.' and 'Cannot close a closed file.' Errors When Rendering Image Sequence

    Hello,
    I am getting the below error messages when I render a TIFF image sequence using default settings. I have double-checked and I have read-write privileges for the file destination. I have also emptied the Disk Cache and Cleaned the Database. My system set-up is also below - there was no error log. Any help/ideas would be greatly appreciated as this keeps happening.
    My Computer
    Windows 7 Professional Service Pack 1, 64-bit
    Intel Xeon CPU E5-2697 v2 @ 2.7 GHz
    64 GB RAM
    After Effects
    2014.2
    Render Settings
    After Effects Multiprocessing ON (I tried it with and without)
    Disk Cache Enabled
    Default TIFF Sequence with Alpha Output Module

    Google Drive? Directly rendering to a synced folder? This cannot work.
    Mylenium

  • DataGrid not rendering images during scrolling

    I've created a "Reusable Inline Item Renderer" to display an
    image in a DataGrid's column, as is shown here:
    http://www.adobe.com/devnet/flex/quickstart/using_item_renderers/#reusable_item
    With one difference: In the example the source of the Image
    component in the item rendered is being set to the URL of an image
    file. In mine I am setting the source as a Bitmap object, the
    Bitmap being a public and Bindable property of an Object in an
    Array. This Array of Objects is the DataGrid's dataProvider.
    And it works fine, except that when I scroll the DataGrid,
    any images that have been scroll off screen and then back on again
    are blank where the image used to be. I've tried tracing out the
    source of each Image when it renders and it still has a Bitmap
    object as it's source even though it is no longer displaying
    it.

    I have been beating my head against the wall on this problem too for awhile now.  There is precious little mentioned anywhere about it.
    I tried to recreate your code, as follows, to solve my problem but now am getting compilation errors.
    Can you please share your code segment on how you did it?    (It would also be helpful to see how you call it too.)  I am loading images from the web with Loader.
    This does not compile:
            public function get data():BitmapData {
                return _data;
            public function set data(value:BitmapData):void {
                _data = value;
                 var newBitmap:Bitmap = new Bitmap(value);
                source = newBitmap;
    In my main class, the data provider is already populated, so I am replacing the cell with the bitmap.
    Thanks for any help you can give.

  • My mac Mini has problem rendering images and video

    THE PROBLEM:
    My mac mini has problem rendering JPEG image. There are strips on the images. Other images such as GIF, PNG, TIFF, and BMP are displayed nicely.
    The images shown in the links below illustrate the problem:
    http://www.flickr.com/photos/terencewong/71481156/
    http://www.flickr.com/photos/terencewong/73360989/
    (Please note that this image is grabbed from my faulty Mac Mini and saved into TIFF. For uploading purpose, I converted it into JPEG on ANOTHER computer.)
    For movies, AVI can be playback without problem. But when it is converted to MPEG, it looks like an untunned TV channel.
    FIXES TRIED:
    I did erase and install 3 to 4 times using both the install disc and my Tiger Family Pack. All ended up with strips on the JPEG images and the generated MPEG movies.
    I've also tried to flash the firmware to 113-xxxxx-124 using ATI's october 2005 universal ROM update, however, the ROM Revision shown in System Profiler is still 113-xxxxx-116 no matter how many time I reboot the system.
    INVESTIGATION:
    Yesterday, I did some research and got to know that JPEG and MPEG are using DCT (Discrete Cosine Transform) for decompression. And the ATI Radeon 9200 chip provide such a transform on hardware basis, which free the CPU from doing something else. Feel free to point out my inaccuracy.
    HARDWARE SPECIFICATION:
    I bought the Mac Mini in the last Februray.
    The system Boot ROM version is: 4.8.9f1
    Display card is ATI Radeon 9200
    Chipset Model: ATY,RV280
    Revision ID: 0x0001
    ROM Revision: 113-xxxxx-116
    A POSSIBLE CONCLUSION:
    I suspect that it is this part of the chip (the DCT) that is faulty.
    Anyone know how to fix this problem?
    Many thanks!

    Assuming that your display is tightly connected, thus the problem is not caused by something as simple as that, the fact that a full erase and install has not removed the problem would, I think, point to this being a hardware issue, and given that everyone's mini (with the possible exception of some of the latest ones) has the same video chipset as yours, and do not suffer the problem that you appear to, it seems very likely that your mini has a fault which is in need of repair.
    If you have an Apple Store nearby, I would take it there to have it checked out - at the very least they should be able to replicate your problem using an in-store display, and if not, thusly suggest it's something external to the mini and concerning your display or something very unusual in the immediate environment of the mini. If you don't have an Apple Store in reach, I'd take the system to an Apple authorized service provider since at the present time it is under warranty.

  • Rendering images in Dreamweaver

    Hello
    I am busy redesigning my site and really want to learn how to display my images like this on my site:  http://www.andrewmcgibbon.co.za/
    I really like how the image increases as well as renders the image as per the size of browser? I had a look online and could not find any answers!
    Does anyone know what the code would be for this?
    thanks a million!
    Wes

    >Should I use relative instead of absolute links?
    Yes.
    You should not use absolute links unless you are creating a page for an email blast, or whenver your page will be hosted on a server that is not where the resouce is located - an ebay ad for example.
    Use either doc or site root relative links.

  • Rendering images in IE fast

    Hi all,
    My first question here is, how can we load images into our application much faster...?
    I have changed look and feel of our application, its taking sometime to load the images in IE only not in Netscape or Firefox.
    And second is:
    So when we view the application in IE, every time its taking time to load all the images whenever its goes to a different tab or a page which is consuming time. And again all these images sizes are very very small. 320bytes, 120bytes, 60bytes.
    Is it anything do with HTMLDB rendering engine or we have any workaround for this..?
    Thanks in advance!
    thx,
    r@vi.
    Message was edited by:
    Pixelfx

    Could be caused by one or both of
    1. ApEx image delivery method:
    Re: #IMAGE_PREFIX# or #WORKSPACE_IMAGES#
    Re: #WORKSPACE_IMAGES# ussage question?
    2. IE caching behaviour:
    http://dean.edwards.name/my/flicker.html
    http://www.fivesevensix.com/studies/ie6flicker/

Maybe you are looking for