Help with adding a JPanel with multiple images to a JFrame

I'm trying to make a program that reads a "maze" and displays a series of graphics depending on the character readed. The input is made from a file and the output must be placed in a JFrame from another class, but i can't get anything displayed. I have tried a lot of things, and i am a bit lost now, so i would thank any help. The input is something like this:
20
SXXXXXXXXXXXXXXXXXXX
XXXX XXXXXXXXXXX
X XXXXX
X X XX XXXXXXXXXXXX
X XXXXXXXXX XXX
X X XXXXXXXXX XXXXX
X XXXXX XXXXX XXXXX
XX XXXXX XX XXXX
XX XXXXX XXXXXXXX
XX XX XXXX XXXXXXXX
XX XX XXXXXXXX
XX XXX XXXXXXXXXXXXX
X XXXXXXXXXXXXX
XX XXXXXXX !
XX XXXXXX XXXXXXXXX
XX XXXXXXX XXXXXXXXX
XX XXXXXXXX
XX XXXX XXXXXXXXXXXX
XX XXXX XXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXX
Generated by the Random Maze Generator
And the code for the "translator" is this:
package project;
import java.io.*;
import java.awt.*;
import javax.swing.*;
public class Translator extends JFrame {
   private FileReader Reader;
   private int size;
   Image wall,blank,exit,start,step1,step2;
  public Translator(){}
  public Translator(File F){
  try {
       Reader=new FileReader(F);}
  catch (IOException e){
       JOptionPane.showMessageDialog(null,"Error Opening File","Error",JOptionPane.ERROR_MESSAGE);}
  try {
  size=Reader.read();
  System.out.write(size);}
  catch (IOException e){
       JOptionPane.showMessageDialog(null,"Error Opening File","Error",JOptionPane.ERROR_MESSAGE);}
  Toolkit theKit=Toolkit.getDefaultToolkit();
  wall=theKit.getImage("wall.gif");
  blank=theKit.getImage("blanktile.jpg");
  exit=theKit.getImage("exit.jpg");
  start=theKit.getImage("start.jpg");
  step1=theKit.getImage("start.jpg");
  step2=theKit.getImage("step1.jpg");
  JPanel panel=new JPanel(){
  public void paintComponent(Graphics g) {
  super.paintComponents(g);
  int ch=0;
  System.out.print("a1 ");
  int currentx=0;
  int currenty=0;
  try {ch=Reader.read();
      System.out.write(ch);}
  catch (IOException e){}
  System.out.print("b1 ");
  while(ch!=-1){
    try {ch=Reader.read();}
    catch (IOException e){}
    System.out.write(ch);
    switch (ch){
        case '\n':{currenty++;
                  break;}
        case 'X':{System.out.print(">x<");
                 g.drawImage(wall,(currentx++)*20,currenty*20,this);
                 break;}
       case ' ':{
                 g.drawImage(blank,(currentx++)*20,currenty*20,this);
                 break;}
        case '!':{
                 g.drawImage(exit,(currentx++)*20,currenty*20,this);
                  break;}
        case 'S':{
                 g.drawImage(start,(currentx++)*20,currenty*20,this);
                  break;}
        case '-':{
                 g.drawImage(step1,(currentx++)*20,currenty*20,this);
                  break;}
        case 'o':{
                  g.drawImage(step2,(currentx++)*20,currenty*20,this);
                  break;}
        case 'G':{ch=-1;
                  break;}
              }//Swith
      }//While
  }//paintComponent
};//Panel
panel.setOpaque(true);
setContentPane(panel);
}//Constructor
}//Classforget all those systems.out and that stuff, that is just for the testing
i call it in another class in this way:
public Maze(){
    firstFrame=new JFrame("Random Maze Generator");
    firstFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    Container c = getContentPane();
    c.setLayout(new FlowLayout());
    (...)//more constructor code here
    Translator T=new Translator(savefile);
    firstFrame.add(T);
    firstFrame.getContentPane().add(c);
    firstFrame.setBounds(d.width/3,d.height/3,d.width/2,d.height/4);
    firstFrame.setVisible(true);
    c.setSize(d.width/2,d.height/4);
    c.show();
    }i know it may be a very basic or concept problem, but i can't get it solved
thanks for any help

Try this. It's trivial to convert it to use your images.
If you insist on storing the maze in a file, just read one line at a
time into an ArrayList than convert to an array and pass that to the
MazePanel constructor.
Any questions, just ask.
import java.awt.*;
import javax.swing.*;
public class CFreman1
     static class MazePanel
          extends JPanel
          private final static int DIM= 20;
          private String[] mMaze;
          public MazePanel(String[] maze) { mMaze= maze; }
          public Dimension getPreferredSize() {
               return new Dimension(mMaze[0].length()*DIM, mMaze.length*DIM);
          public void paint(Graphics g)
               g.setColor(Color.BLACK);
               g.fillRect(0, 0, getSize().width, getSize().height);
               for (int y= 0; y< mMaze.length; y++) {
                    String row= mMaze[y];
                    for (int  x= 0; x< row.length(); x++) {
                         Color color= null;
                         switch (row.charAt(x)) {
                              case 'S':
                                   color= Color.YELLOW;
                                   break;
                              case 'X':
                                   color= Color.BLUE;
                                   break;
                              case '!':
                                   color= Color.RED;
                                   break;
                         if (color != null) {
                              g.setColor(color);
                              g.fillOval(x*DIM, y*DIM, DIM, DIM);
     public static void main(String[] argv)
          String[] maze= {
               "SXXXXXXXXXXXXXXXXXXX",
               "    XXXX XXXXXXXXXXX",
               "X              XXXXX",
               "X  X XX XXXXXXXXXXXX",
               "X    XXXXXXXXX   XXX",
               "X  X XXXXXXXXX XXXXX",
               "X  XXXXX XXXXX XXXXX",
               "XX XXXXX XX     XXXX",
               "XX XXXXX    XXXXXXXX",
               "XX  XX XXXX XXXXXXXX",
               "XX  XX      XXXXXXXX",
               "XX XXX XXXXXXXXXXXXX",
               "X      XXXXXXXXXXXXX",
               "XX XXXXXXX         !",
               "XX  XXXXXX XXXXXXXXX",
               "XX XXXXXXX XXXXXXXXX",
               "XX          XXXXXXXX",
               "XX XXXX XXXXXXXXXXXX",
               "XX XXXX XXXXXXXXXXXX",
               "XXXXXXXXXXXXXXXXXXXX"
          JFrame frame= new JFrame("CFreman1");
          frame.getContentPane().add(new MazePanel(maze));
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          frame.pack();
          frame.setResizable(false);
          frame.setVisible(true);
}

Similar Messages

  • Help with multiple images

    I am new to Final Cut Express. I am trying to make a clip that has multiple images on the screen at one time. For instance one picture in each corner and then one in the middle that all have separate effects. Any help would be appreciated.
    Thanks in advance.

    Welcome to the forum!
    You'll need to place each image that will be on-screen at the same time on it's own video track in the Timeline. So one image will be on V1, another on V2, another on V3 and so on. Once you have the images on the Timeline, start with the one on the highest track. Set the Canvas window to Image+Wireframe mode while the highest image is highlighted in the Timeline. Use the Wireframe to resize and position the image where you want it. Repeat for each image.
    -DH

  • Exporting a template with multiple images

    Let's assume I want to have a large print made at an outside commecial lab because my printer does not handle the size.
    In the Print Module, is there a way to export a template with multiple images so that it can be sent to an outside lab for printing?
    Or, is this not possible and I would have to design the template in Photoshop and send the file to the lab?
    If Lightroom is not yet capable of this, it certainly seems like a worthwhile feature.

    Thanks for sticking with this thread to help me.
    I am on Windows and I do have PDF capability, the full Adobe Acrobat Professional.
    I have been experimenting with your suggestions and, yes, saving it as a PDF and bringing it into Photoshop is a workaround. The images and Identity plate come into Photoshop as they appear in the template in Lightroom.
    What doesn't appear in Photoshop is the whitespace(margins)around the images. They appear in the PDF, but they don't appear when I open the PDF in Photoshop. Is there a setting I'm overlooking in the PDF settings dialog that will correct this? Or, is this just the way importing a PDF works when it comes to margins? Must I always go to Image/Canvas size to get the canvas I want? Is there a way of not having to do this?

  • I am having a problem when i open a new tab with multiple images. If there is more than five or six images they won't all open.

    I open emails with multiple images. The new version is having a problem opening a tab with more than maybe 6 or 7 images. Older versions sometimes had the same problem but the unopened images appeared on the page as a small blank box that you could try to reload. Not anymore. Now you have to reload the whole tab. Sometimes this works other times it doesn't.

    You seem to be using a beta version. Maybe go back to a regular release and wait for V. 30 to become a regular release, and maybe whatever bug it is will be fixed.

  • Help with multiple httpservice calls

    I need help with multiple httpservice call back to back, doing 10 different mysql query at startup of the app loading results into 14 datagrids/combobox all queries are to different tables.

    Hello,
    I think what Grizzzzzzzzzz means is the following:
        <mx:HTTPService id="serviceOne"
            url="here goes url"
            result="resultHandler1(event);"
            fault="faultHandler(event);"/>
        <mx:HTTPService id="serviceTwo"
            url="here goes url"
            result="resultHandler2(event);"
            fault="faultHandler(event);"/>
        <mx:HTTPService id="serviceThree"
            url="here goes url"
            result="resultHandler3(event);"
            fault="faultHandler(event);"/>
         // Result handler 1
         private function resultHandler1(event:ResultEvent):void{
              //Here do something with the results
             xmlCollection = event.result as XML;
             //then call the next service
             serviceTwo.send();
          // Result handler 2
          private function resultHandler2(event:ResultEvent):void{
              //Here do something with the results
             xmlCollection = event.result as XML;
             //then call the next service
              serviceThree.send();
    I hope this helps,
    Pierre

  • Trying to create a surface  with multiple images with mouse events

    novice programmer (for a applet program)
    hi trying to create a surface i.e jpanel, canvas, that allows multiple images to be created.
    Each object is to contain a image(icon) and a name associated with that particular image. Then each image+label has a mouse event that allows the item to be dragged around the screen.
    I have tried creating own class that contains a image and string but I having problems.
    I know i can create a labels with icons but having major problems adding mouse events to allow each newly created label object to moved by the users mouse?
    if any one has any tips of how to acheive this it would be much appreciated. Thanks in advance.
    fraser.

    This should set you on the right track:- import java.awt.*;
        import java.awt.event.*;
        import javax.swing.*;
        public class DragTwoSquares extends JApplet implements MouseListener, MouseMotionListener {  
           int x1, y1;   // Coords of top-left corner of the red square.
           int x2, y2;   // Coords of top-left corner of the blue square.
           /* Some variables used during dragging */
           boolean dragging;      // Set to true when a drag is in progress.
           boolean dragRedSquare; // True if red square is being dragged, false                              //    if blue square is being dragged.                            
           int offsetX, offsetY;  // Offset of mouse-click coordinates from
                                  //   top-left corner of the square that was                           //   clicked.
           JPanel drawSurface;    // This is the panel on which the actual
                                  // drawing is done.  It is used as the
                                  // content pane of the applet.  It actually                      // belongs to an anonymous class which is
                                  // defined in place in the init() method.
            public void init() {
                 // Initialize the applet by putting the squares in a
                 // starting position and creating the drawing surface
                 // and installing it as the content pane of the applet.
              x1 = 10;  // Set up initial positions of the squares.
              y1 = 10;
              x2 = 50;
              y2 = 10;
              drawSurface = new JPanel() {
                        // This anonymous inner class defines the drawing
                        // surface for the applet.
                    public void paintComponent(Graphics g) {
                           // Draw the two squares and a black frame
                           // around the panel.
                       super.paintComponent(g);  // Fill with background color.
                       g.setColor(Color.red);
                       g.fillRect(x1, y1, 30, 30);
                       g.setColor(Color.blue);
                       g.fillRect(x2, y2, 30, 30);
                       g.setColor(Color.black);
                       g.drawRect(0,0,getSize().width-1,getSize().height-1);
              drawSurface.setBackground(Color.white);
              drawSurface.addMouseListener(this);
              drawSurface.addMouseMotionListener(this);
              setContentPane(drawSurface);
           } // end init();
           public void mousePressed(MouseEvent evt) {
                  // Respond when the user presses the mouse on the panel.
                  // Check which square the user clicked, if any, and start
                  // dragging that square.
              if (dragging)  // Exit if a drag is already in progress.
                 return;           
              int x = evt.getX();  // Location where user clicked.
              int y = evt.getY();        
              if (x >= x2 && x < x2+30 && y >= y2 && y < y2+30) {
                     // It's the blue square (which should be checked first,
                     // since it's in front of the red square.)
                 dragging = true;
                 dragRedSquare = false;
                 offsetX = x - x2;  // Distance from corner of square to (x,y).
                 offsetY = y - y2;
              else if (x >= x1 && x < x1+30 && y >= y1 && y < y1+30) {
                     // It's the red square.
                 dragging = true;
                 dragRedSquare = true;
                 offsetX = x - x1;  // Distance from corner of square to (x,y).
                 offsetY = y - y1;
           public void mouseReleased(MouseEvent evt) {
                  // Dragging stops when user releases the mouse button.
               dragging = false;
           public void mouseDragged(MouseEvent evt) {
                   // Respond when the user drags the mouse.  If a square is
                   // not being dragged, then exit. Otherwise, change the position
                   // of the square that is being dragged to match the position
                   // of the mouse.  Note that the corner of the square is placed
                   // in the same position with respect to the mouse that it had
                   // when the user started dragging it.
               if (dragging == false)
                 return;
               int x = evt.getX();
               int y = evt.getY();
               if (dragRedSquare) {  // Move the red square.
                  x1 = x - offsetX;
                  y1 = y - offsetY;
               else {   // Move the blue square.
                  x2 = x - offsetX;
                  y2 = y - offsetY;
               drawSurface.repaint();
           public void mouseMoved(MouseEvent evt) { }
           public void mouseClicked(MouseEvent evt) { }
           public void mouseEntered(MouseEvent evt) { }
           public void mouseExited(MouseEvent evt) { }  
        } // end class

  • Help with unloading images AS3

    Please can anyone help me. I am new to Action Script and flash and am having a nightmare unloading images. The code below works but I keep getting the following error messages:
    TypeError: Error #2007: Parameter child must be non-null.
    at flash.display::DisplayObjectContainer/removeChild()
    at index_fla::MainTimeline/clickSection()
    ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
    at flash.display::DisplayObjectContainer/removeChild()
    at index_fla::MainTimeline/clickSection()
    Any help with this would be much appreciated.
    var ImgReq01:URLRequest=new URLRequest("images/home/01.jpg");
    var ImgReq02:URLRequest=new URLRequest("images/home/02.jpg");
    var ImgReq03:URLRequest=new URLRequest("images/home/03.jpg");
    var ImgReq04:URLRequest=new URLRequest("images/home/04.jpg");
    var ImgReq05:URLRequest=new URLRequest("images/home/05.jpg");
    var imgList:Array=[ImgReq01,ImgReq02,ImgReq03,ImgReq04,ImgReq05];
    var imgRandom = imgList[Math.floor(Math.random()* imgList.length)];
    var imgLoader:Loader = new Loader();
    imgLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);
    imgLoader.load(imgRandom);
    function onComplete(event:Event):void
      var randomImage:Bitmap = Bitmap(imgLoader.content);
      randomImage.x=187.4;
      randomImage.y=218.1;
      addChild(randomImage);
    //handle events for info buttons...
    information. addEventListener (MouseEvent.CLICK, clickSection);
    home. addEventListener (MouseEvent.CLICK, clickSection);
    galleries. addEventListener (MouseEvent.CLICK, clickSection);
    function clickSection (evtObj:MouseEvent) {
    //Trace shows what's happening.. in the output window
    trace ("The "+evtObj.target.name+" button was clicked")
    //go to the section clicked on...
    gotoAndStop (evtObj.target.name)
    // this line is causing errors when navigating between the gallery and information buttons
    var Image:Bitmap = Bitmap(imgLoader.content);
      removeChild(Image);

    you really should be adding the loader to the displaylist, not the content.
    try:
    var ImgReq01:URLRequest=new URLRequest("images/home/01.jpg");
    var ImgReq02:URLRequest=new URLRequest("images/home/02.jpg");
    var ImgReq03:URLRequest=new URLRequest("images/home/03.jpg");
    var ImgReq04:URLRequest=new URLRequest("images/home/04.jpg");
    var ImgReq05:URLRequest=new URLRequest("images/home/05.jpg");
    var imgList:Array=[ImgReq01,ImgReq02,ImgReq03,ImgReq04,ImgReq05];
    var imgRandom = imgList[Math.floor(Math.random()* imgList.length)];
    var imgLoader:Loader = new Loader();
    imgLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);
    imgLoader.load(imgRandom);
    function onComplete(event:Event):void
    imgLoader.x=187.4;
    imgLoader.y=218.1;
      addChild(imgLoader);
    //handle events for info buttons...
    information. addEventListener (MouseEvent.CLICK, clickSection);
    home. addEventListener (MouseEvent.CLICK, clickSection);
    galleries. addEventListener (MouseEvent.CLICK, clickSection);
    function clickSection (evtObj:MouseEvent) {
    //Trace shows what's happening.. in the output window
    trace ("The "+evtObj.target.name+" button was clicked")
    //go to the section clicked on...
    gotoAndStop (evtObj.target.name)
    // this line is causing errors when navigating between the gallery and information buttons
    if(this.contains(imgLoader){
      removeChild(imgLoader);

  • Need some help with ".png" image.

    Good day everyone. Here's the run down. I need to add an
    image (image "A") ontop of another image (image"B"). Image "B" is a
    paterned background. And Image "A" a logo with a transparent
    background.
    As it stands I have image "A" as a "png" and as you know....
    they are fri**ing huge! Haveing it as a "gif" only presents me with
    the IE6 problem of it adding a colored background to the image.
    So I'm stuck! Can any one tell me or point me in the
    difection of a tutorial to tell me the best way to add an image
    with a transparent background in Dreamweaver.
    Really need some help with this!
    Thanks all!

    >Right you can see the work in progress here>
    http://www.stclairecreative.com/DoughBoys_Site_Folder/home.html
    Before going much further I'd recommend reconsidering the use
    of a textured background. They are usually included for the benefit
    of the site owner only, and likely to annoy visitors. Studies on
    the subject suggest they often lead to usability problems. I do
    like to header graphic, but at 200K it's kinda heavy and can
    probably be optimized.

  • Help with unloading images

    Please can anyone help me. I am new to Action Script and flash and am having a nightmare unloading images. The code below works but I keep getting the following error messages:
    TypeError: Error #2007: Parameter child must be non-null.
    at flash.display::DisplayObjectContainer/removeChild()
    at index_fla::MainTimeline/clickSection()
    ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
    at flash.display::DisplayObjectContainer/removeChild()
    at index_fla::MainTimeline/clickSection()
    Any help with this would be much appreciated.
    var ImgReq01:URLRequest=new URLRequest("images/home/01.jpg");
    var ImgReq02:URLRequest=new URLRequest("images/home/02.jpg");
    var ImgReq03:URLRequest=new URLRequest("images/home/03.jpg");
    var ImgReq04:URLRequest=new URLRequest("images/home/04.jpg");
    var ImgReq05:URLRequest=new URLRequest("images/home/05.jpg");
    var imgList:Array=[ImgReq01,ImgReq02,ImgReq03,ImgReq04,ImgReq05];
    var imgRandom = imgList[Math.floor(Math.random()* imgList.length)];
    var imgLoader:Loader = new Loader();
    imgLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);
    imgLoader.load(imgRandom);
    function onComplete(event:Event):void
      var randomImage:Bitmap = Bitmap(imgLoader.content);
      randomImage.x=187.4;
      randomImage.y=218.1;
      addChild(randomImage);
    //handle events for info buttons...
    information. addEventListener (MouseEvent.CLICK, clickSection);
    home. addEventListener (MouseEvent.CLICK, clickSection);
    galleries. addEventListener (MouseEvent.CLICK, clickSection);
    function clickSection (evtObj:MouseEvent) {
    //Trace shows what's happening.. in the output window
    trace ("The "+evtObj.target.name+" button was clicked")
    //go to the section clicked on...
    gotoAndStop (evtObj.target.name)
    // this line is causing errors when navigating between the gallery and information buttons
    var Image:Bitmap = Bitmap(imgLoader.content);
      removeChild(Image);

    you really should be adding the loader to the displaylist, not the content.
    try:
    var ImgReq01:URLRequest=new URLRequest("images/home/01.jpg");
    var ImgReq02:URLRequest=new URLRequest("images/home/02.jpg");
    var ImgReq03:URLRequest=new URLRequest("images/home/03.jpg");
    var ImgReq04:URLRequest=new URLRequest("images/home/04.jpg");
    var ImgReq05:URLRequest=new URLRequest("images/home/05.jpg");
    var imgList:Array=[ImgReq01,ImgReq02,ImgReq03,ImgReq04,ImgReq05];
    var imgRandom = imgList[Math.floor(Math.random()* imgList.length)];
    var imgLoader:Loader = new Loader();
    imgLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);
    imgLoader.load(imgRandom);
    function onComplete(event:Event):void
    imgLoader.x=187.4;
    imgLoader.y=218.1;
      addChild(imgLoader);
    //handle events for info buttons...
    information. addEventListener (MouseEvent.CLICK, clickSection);
    home. addEventListener (MouseEvent.CLICK, clickSection);
    galleries. addEventListener (MouseEvent.CLICK, clickSection);
    function clickSection (evtObj:MouseEvent) {
    //Trace shows what's happening.. in the output window
    trace ("The "+evtObj.target.name+" button was clicked")
    //go to the section clicked on...
    gotoAndStop (evtObj.target.name)
    // this line is causing errors when navigating between the gallery and information buttons
    if(this.contains(imgLoader){
      removeChild(imgLoader);

  • Server goes out of memory when annotating TIFF File. Help with Tiled Images

    I am new to JAI and have a problem with the system going out of memory
    Objective:
    1)Load up a TIFF file (each approx 5- 8 MB when compressed with CCITT.6 compression)
    2)Annotate image (consider it as a simple drawString with the Graphics2D object of the RenderedImage)
    3)Send it to the servlet outputStream
    Problem:
    Server goes out of memory when 5 threads try to access it concurrently
    Runtime conditions:
    VM param set to -Xmx1024m
    Observation
    Writing the files takes a lot of time when compared to reading the files
    Some more information
    1)I need to do the annotating at a pre-defined specific positions on the images(ex: in the first quadrant, or may be in the second quadrant).
    2)I know that using the TiledImage class its possible to load up a portion of the image and process it.
    Things I need help with:
    I do not know how to send the whole file back to servlet output stream after annotating a tile of the image.
    If write the tiled image back to a file, or to the outputstream, it gives me only the portion of the tile I read in and watermarked, not the whole image file
    I have attached the code I use when I load up the whole image
    Could somebody please help with the TiledImage solution?
    Thx
    public void annotateFile(File file, String wText, OutputStream out, AnnotationParameter param) throws Throwable {
    ImageReader imgReader = null;
    ImageWriter imgWriter = null;
    TiledImage in_image = null, out_image = null;
    IIOMetadata metadata = null;
    ImageOutputStream ios = null;
    try {
    Iterator readIter = ImageIO.getImageReadersBySuffix("tif");
    imgReader = (ImageReader) readIter.next();
    imgReader.setInput(ImageIO.createImageInputStream(file));
    metadata = imgReader.getImageMetadata(0);
    in_image = new TiledImage(JAI.create("fileload", file.getPath()), true);
    System.out.println("Image Read!");
    Annotater annotater = new Annotater(in_image);
    out_image = annotater.annotate(wText, param);
    Iterator writeIter = ImageIO.getImageWritersBySuffix("tif");
    if (writeIter.hasNext()) {
    imgWriter = (ImageWriter) writeIter.next();
    ios = ImageIO.createImageOutputStream(out);
    imgWriter.setOutput(ios);
    ImageWriteParam iwparam = imgWriter.getDefaultWriteParam();
    if (iwparam instanceof TIFFImageWriteParam) {
    iwparam.setCompressionMode(ImageWriteParam.MODE_EXPLICIT);
    TIFFDirectory dir = (TIFFDirectory) out_image.getProperty("tiff_directory");
    double compressionParam = dir.getFieldAsDouble(BaselineTIFFTagSet.TAG_COMPRESSION);
    setTIFFCompression(iwparam, (int) compressionParam);
    else {
    iwparam.setCompressionMode(ImageWriteParam.MODE_COPY_FROM_METADATA);
    System.out.println("Trying to write Image ....");
    imgWriter.write(null, new IIOImage(out_image, null, metadata), iwparam);
    System.out.println("Image written....");
    finally {
    if (imgWriter != null)
    imgWriter.dispose();
    if (imgReader != null)
    imgReader.dispose();
    if (ios != null) {
    ios.flush();
    ios.close();
    }

    user8684061 wrote:
    U are right, SGA is too large for my server.
    I guess oracle set SGA automaticlly while i choose default installion , but ,why SGA would be so big? Is oracle not smart enough ?Default database configuration is going to reserve 40% of physical memory for SGA for an instance, which you as a user can always change. I don't see anything wrong with that to say Oracle is not smart.
    If i don't disincrease SGA, but increase max-shm-memory, would it work?This needs support from the CPU architecture (32 bit or 64 bit) and the kernel as well. Read more about the huge pages.

  • Help with partial image loss from Viewer to Canvas

    Hi--I'm brand new to FCP and would really appreciate any help with my problem. I'm creating 2 second video clips composed of four still images (15 frames...or 500ms each) laid back to back, then rendered. Very simple, I know. The individual images are tiff files that look great in the FCP Viewer. But in the Canvas, part of the image is missing. Specifically, in the center of each image there should be a + sign, about 1cm square. This + should remain constant thoughout the short movie, while the items around it vary (from image to image). (This is a psychology experiment, and the center + is a fixation cross.) The problem is that in the Viewer the + sign is intact, but in the Canvas (and the resulting rendered video), only the vertical bar of the + is present! This is true for every individual tiff, and for the resulting movie. The items around the fixation cross are fine. My question is WHY on earth does the central horizontal bar get "lost" between the Viewer and the Canvas? I've read the manuals, but obviously I've got something set wrong. Also, there is a considerable overall reduction in quality between the viewer and canvas, even though I'm trying my best to maximize video quality. Everything looks a bit blurry. Truly, all ideas are welcome. Sorry if it's obvious. Thanks.
    G5   Mac OS X (10.4.3)  

    steve, i'm viewing on my 23" cinema screen. i read up on quality and know that this is a no-no; that i should only judge quality when viewing on an ntsc monitor or good tv. the problem is that i'll ultimately be displaying these videos on my Dell LCD, so i've got to maximize what i've got. thanks to the discussion boards i have a short list of things to try now. thanks!
    -heather

  • Lightbox with multiple images attached to one thumbnail?

    Is it possible to have one thumbnail allow you to scroll through multiple images without having to click on another thumbnail? 
    For example,  lets say that I have three projects with 10 images per project.  I only want to have three thumbnails which will allow the user to see each project by clicking on it's "master" thumbnail.
    Thanks.

    If your intent is to have a single thumbnail (image) that your visitors click and it launches a Lightroom with Slideshow, you can try the following.
    The gist :
    Insert Slideshow Widget into target of Composition Widget
    The details :
    01. Drag & drop the Lightroom Display Composition Widget onto your design surface.
    02. Drag & drop a Slideshow Widget into (this is the important bit) the Target of the Lightroom Display Composition Widget
    The Target is the large area of the Composition Widget
    The Target is what appears as a light box when you click on the Trigger (the smaller boxes)
    03. Add your thumbnail image to the Trigger of the Lightroom Display Composition Widget (the smaller boxes)
    Style it :
    You're now ready, style your widgets and replace the images of the Slideshow Widget and you'll have the effect you're looking for.
    Very crude example :
    http://slideshowwidgetincompositionwidget.businesscatalyst.com/index.html

  • Seeking Help with Album Image Issues in iPod Classic

    Hi folks -
    I have a new 160 iPod Classic and have two album image-related issues I'd appreciate some help with.
    In the case of several albums where I'd associated my own art with them in iTunes, the formatting appeared off in my iPod due to the vertical/horizontal proportions. So I corrected the images, replaced the images via iTunes, and re-synced. All of the old images were replaced - except for two. Is there any way to get my iPod to recognize the change to these two images, as it did for all the others?
    Secondly, my "The Allman Brothers Band Live at Fillmore East" album was appearing twice in both the Cover Flow and Album list. That was strange, except that after the latest sync it now appears six times! It's only in one place in iTunes, and not erroneously set as a compilation or anything. This is the only album displaying this behavior...
    Thanks for any suggestions or advice!
    Frank
    Message was edited by: frank3si

    Yes my e-mail address is [email protected] 
    Thank you for your kind attention to my problem. I am looking for one on one brief consultation with my laptop in Cincinnati. If not then I will compose a clear question with VI.
    These manuals are well known to me NI Visions Concepts ManualIMAQ Vision for LaVIEW User ManuelNI-IMAQ for USB Cameras My problem is moving to the next step of Create an array of USB imagePerform math on array Display results Sincerely,Tom Lohre cell 513-236-1704, [email protected] http://tomlohre.com/images/lafley.jpgAG Lafley, Chairman & CEO of Proctor & Gamble http://tomlohre.com/lafley.htm A.G. Lafley enjoyed hearing of Tom's painting robot and thought it played well to his new book: "The Game-Changer: How You Can Drive Revenue and Profit Growth With Innovation." http://tomlohre.com/newart.htm
    Tom Lohre artist/scientist
    Has a operating painting robot using RoboLab/RCX
    Developing a LabView/ NXT robot that analyzes an image for aesthetic quality.

  • Help With Multiple Schemas In Multiple Environments

    Dear Oracle Forum:
    We have a bit of controversy around the office and I was hoping we could get some expert input to get us on the right track.
    For the purposes of this discussion, we have two machines, development and production. Currently, on each machine, we have one database with multiple schemas, say, one for sales data and another for inventory. The sales data has maybe 200 tables and the inventory has another 50. About 12 times a year, once a month, we have a release and move code from dev to prod. The database is accessed by several hundred Pro*C and Pro*Cobol programs for online transaction processing.
    The problem comes up when we need to have multiple development environments. If I need to work on something for May that requires the customer address field to be 50 characters and somebody else is working on something for July that requires the customer address field to be 100 characters, we can’t both function in the same schema. We have a method of configuring running programs to attach to a given schema/database. Currently, everything connects to the same place. We were told that we should not have the programs running as the owners of the schemas for some reason so we set up additional users. The SALES schema is accessed with the connect string: SALES_USER/[email protected]. (I don’t know where we got dot world from but that is not the current discussion.)
    One of the guys said that we should have 12 copies of the database running, which is kind of painful to think about in my opinion. Oracle is not a lightweight product and there are any number of ancillary processes that would have to be duplicated 12 times.
    My recommendation is that we have 12 schemas each for sales and inventory with 12 users each to access them. We would have something like JAN_SALES_USER, FEB_SALES_USER, etc. Each user would have synonyms set up for each of the tables it is interested in. When my program connects as MAY_SALES_USER, I could select from the customer table and I would get my 50 character address field. When the other user connects as JUL_SALES_USER, he would get his 100 character address field. Both of us would not know anything different.
    Another idea that came up is to have a logon trigger that would set the current schema for that user to the appropriate base schema. When JUL_SALES_USER logs in, the current schema would be set to JUL_SALES, etc. This would simplify things by allowing us to avoid having something like 2400 synonyms to maintain (which could be automated without too much difficulty) but it would complicate things by requiring a trigger.
    There are probably other ways to go about this we have not considered as yet. Any input you can give will be appreciated.
    Regards,
    /Bob Bryan

    Hans Forbrich wrote:
    I'd rather see you with 12 schemas than with 12 databases. Unless you have lots of CPUs to spare ... and lots of cash to pay for those extra CPU licenses.
    Then again, I'd take it one step further and ask to investigate the base design. There should be little reason to change the schema based on time. Indeed, from what little I know of your app, I'd have to ask whether adding a 'date' column and appropriate views or properly coded SQL statements might simplify things. Interesting. If we were to have one big Customer table with views for each month, how would we handle the case where the May people have to see 50 character address and July have to see a 100 character address field. I guess we could have MAY_ADDRESS VARCHAR2(50) and JULY_ADDRESS VARCHAR2(100) and take care to make sure that people connecting as May can only see the May columns, etc. This is simpler than multiple schemas?
    I may have overly simplified things in my effort to get something down that would not require too much explanation. The big thing is that multiple people are doing development and they have to be independent of each other. If we were to drop a column for July, the May people will have trouble compiling if we don’t keep things separate. It is not a case of making the data available. The data in development is something we cook up to allow us to test. The other part is the code we compile now will be released to production one of these times. In production, there is only a need for one database.
    We are moving from another database product where multiple databases are effectively different sets of files. We have lots of disk space so multiple databases were no problem. Oracle is such a powerful product; I can’t believe there is not some way to set up something similar.

  • Database block with multiples images

    Hi,
    I have a database block with 5 image items for each record (all database items too).
    Block property "number of record displayed"=6....so I have 30 image item into the canvas. But when runs forms..only show me 1 image for each record (last image item of block!!)
    Someone could help me?
    I user for development environment:
    -Forms Versión 10.1.2.0.2
    -Oracle Database 10g Express Edition Release 10.2.0.1.0
    -Windows XP

    Yes...I have 5 image (blob) fields in each database record.
    Fields are identicals...
    :ARTICULOS.IMAGE1
    :ARTICULOS.IMAGE2
    :ARTICULOS.IMAGE3
    :ARTICULOS.IMAGE4
    :ARTICULOS.IMAGE5 (only show me this for each record)
    I make this test to understand if I made something wrong: delete field :ARTICULOS.IMAGE5 and after that :ARTICULOS.IMAGE4 shows the image...

Maybe you are looking for

  • Application to be install for Siebel Insurance

    Hi We are preparing a demo for Insurance Client but we are not sure which Siebel application will be the ideal for Insurance client. I found some document(http://download.oracle.com/docs/cd/B31104_02/books/InsureSIA/FinanceSIAoverview.html) in google

  • Help me return an iPod to its owner...

    A friend of mine went on a trip and found someone had left their iPod on his plane seat and, unable to locate the previous owner on the plane, he brought it back home with him. It's a 32GB iPod with 3G capability and it's currently locked with the 4

  • Problem after the uninstall  of windows with the bootcamp assistant!!!!

    I have too problems: The first is my bad english i like to excuse for that. I hope you can even so understand my main problem. I try to describe it to you: I install windows on my mac. After a short time i decide, i don't like it and i uninstall it w

  • Incorrect value getting fetched

    Hi in my requirement  I want to fetch the wbs element based on the prefixed placed in it .I have coded as follows for one part check gw_auak-objnr CA 'PR'.     SELECT  pspnr FROM prps INTO TABLE gi_prps WHERE objnr = gw_auak-objnr. Here the value is

  • When we use ZBW220 Function Exit   EXIT_SAPLRSAP_001& what meant for .

    Hi, When we use ZBW220 Function Exit   EXIT_SAPLRSAP_001& what meant for EXIT_SAPLRSAP_001 EXIT_SAPLRSAP_002 EXIT_SAPLRSAP_003 EXIT_SAPLRSAP_004 Regards, Anand Mehrotra.