Reading colour image using raster object and getsample() method

Hello all,
I am trying to read a grey image using this code below and it perfectly works:
File filename = new File("myimage.jpg");
BufferedImage inputimage = ImageIO.read(filename);
Raster input = inputimage.getRaster();
double pixelvalue = input.getSample(xx, yy, 0) ; // to read pixel colour.
Now:
what modifications should i do to read a colour image using getsample() method.
any help, by example if y would.
Thanks

The code below
double pixelvalue = input.getSample(xx, yy, 0) ; // to read pixel colour.actually doesn't obtain the pixel color. It reads a band of the specified pixel. If you are reading a tripple band image (24-bit colored image RGB ) then you have to invoke this method three times for band 0, 1 and 2. The arrangment of them depends on the BufferedImage type.
In reply of your question, you can use getSamples method, refer to the java API documentation of the BufferedImage class for more info.
you can also check methods getRGB and setRGB, they used to get/set the entire pixel in range of 0x00000000 to 0x00FFFFFF ( 0x00RRGGBB of image type TYPE_INT_RGB )
Regards,
Mohammed M Saleem

Similar Messages

  • Create a new Buffered Image using Raster and ColorModel

    Sorry , I crosspost this message,because no one reply.
    Recently,I write a programme combining C++ and Java .
    The C++ part create a array containing image data in form of BI_RGB and biBitCount==32.
    The java part create a image using Raster and ColorModel like this:
       static int[] data ;
       DataBuffer db = new DataBufferInt(data, data.length);
       WritableRaster wr =Raster.createPackedRaster(db, 1024,768, 32, null);
       ColorModel cm = new DirectColorModel(32,0xff0000,0x00ff00,0x0000ff);
       img = new BufferedImage(cm, wr, false, null);But it doesn't work .
    it report this:
    Exception in thread "main" java.lang.IllegalArgumentException: Raster sun.awt.im
    age.SunWritableRaster@dff3a2 is incompatible with ColorModel DirectColorModel: r
    mask=ff0000 gmask=ff00 bmask=ff amask=0
    at java.awt.image.BufferedImage.<init>(BufferedImage.java:549)
    at monitor.test.Perform2.main(Perform2.java:39)

    hey epico
    compiles & runs 4 me
    see javadocs for SinglePixelPackedSampleModel
    import java.awt.image.*;
    public class Tester {
    DataBuffer db;
    WritableRaster wr;
    ColorModel cm;
    BufferedImage im;
    int[] data;
    int[] masks;
    int w = 768;
    int h = 576;
      public Tester() {
        data = new int[768*576];
        for (int i = 0;i < w*h ;i++ ) {
          data[i] = 0;
        masks = new int[3];
        masks[0] = 0xff0000;
        masks[1] = 0x00ff00;
        masks[2] = 0x0000ff;
        db = new DataBufferInt(data,data.length);
        SinglePixelPackedSampleModel sm = new SinglePixelPackedSampleModel(DataBuffer.TYPE_INT,w,h,masks);
        cm = new DirectColorModel(32,0xff0000,0x00ff00,0x0000ff);
        wr = Raster.createWritableRaster(sm,db,null);
        im = new BufferedImage(cm,wr,false,null);
      public static void main(String[] args) {
        Tester tester1 = new Tester();
    }

  • Can we use Call transaction and session method in same program ?

    Hi experts,
                     Is it suggested to use call Transaction and session method in the same Program ?
                     i have a doubt , why cant we use multiple call transactions in same program instead of session method if we have multiple transaction updations ?

    Hi Dengyong Zhang,
    we can use the call transation and session method in same program.
    However for better performance it's benificial to use call trasaction method of BDC. but if u want to upload very large amount of data then Session method is more preferable to use.
    Session method is one of the method of BDC.
    U can also use BAPI to upload the data in SAP but it's a different concept than BDC. Performance wise BAPI is more advantageous than BDC.

  • I have a VI A. I want A to call another VI B and execute. After B executes, I want it to close automatically and go back to A. Is this possible ? I tried using open reference and those methods, but I am not able to do it. Can someone help me ? Thanks !

    Thanks !
    Kudos always welcome for helpful posts

    Re: I have a VI A. I want A to call another VI B and execute. After B executes, I want it to close automatically and go back to A. Is this possible ? I tried using open reference and those methods, but I am not able to do it. Can someone help me ? Thanks !Hi Stephan ! Thanks ! I guess I explained my question not so right. I've created a customized menu and at the instance of me selecting a menu, a VI should load itself dynamically. I am using call by reference. Sometimes it works and sometimes it won't. In short, what I want to achieve is load VIs dynamically and close them dynamically once they finish executing. Thanks !
    Kudos always welcome for helpful posts

  • Using jpegEncoder object and filesystem

    Hi, I also posted this in the Flex general forum, but it
    seems to be more AIR related since it deals with saving to the
    local disk. I am trying to create a simple AIR application that
    creates a thumbnail from an image component and saves it as a jpeg
    to the desktop. I am not sure where I am going wrong here, but the
    file is corrupt and no information is being written to it. If I
    look at the content (via the "more" command on the command line) it
    is 8 blank lines.
    Thanks so much,
    Jed
    =========
    <?xml version="1.0" encoding="utf-8"?>
    <mx:WindowedApplication xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="vertical">
    <mx:Script>
    <![CDATA[
    import mx.graphics.ImageSnapshot;
    import mx.graphics.codec.*;
    import mx.events.FileEvent;
    private function captureImg():void{
    //captures the image as a jpg and saves it to the desktop
    var codec:JPEGEncoder = new JPEGEncoder();
    //var ba:ByteArray = new ByteArray;
    var file:File =
    File.desktopDirectory.resolvePath("test.jpg");
    var filestream:FileStream = new FileStream;
    var snapShot:ImageSnapshot = new ImageSnapshot;
    snapShot = ImageSnapshot.captureImage(bigImg,72,codec);
    filestream.open(file, FileMode.WRITE);
    filestream.writeBytes(
    codec.encodeByteArray(snapShot.data,420,120),0,snapShot.data.length);
    filestream.close();
    private function makeSmall():void{
    //makes the image on the screen thumbnail size
    var pic:Image = bigImg;
    pic.setActualSize(420, 120);
    ]]>
    </mx:Script>
    <mx:VBox horizontalAlign="center" verticalAlign="top">
    <mx:Image id="bigImg" width="480" height="320"
    source="orignial/test2.jpg"/>
    <mx:Button label="Reduce Size" id="btnSmaller"
    click="makeSmall();" />
    <mx:Button label="Snap Thumbnail" id="btnThumbnail"
    click="captureImg();"/>
    </mx:VBox>
    </mx:WindowedApplication>
    Text

    Well I didn't get any feedback here on this problem. But I
    did figure it out.
    ===============
    <mx:WindowedApplication xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="vertical">
    <mx:Script>
    <![CDATA[
    import flash.display.BitmapData;
    import mx.graphics.codec.JPEGEncoder;
    import flash.filesystem.*;
    private function captureImg():void{
    ** A bitmapData object is needed to contain the visual data
    var bmpd:BitmapData = new BitmapData(
    smallImg.width,smallImg.height, false, 0xFFFFFF);
    bmpd.draw(smallImg);
    ** the bitmapdata object needs to be encoded into an
    byteArray with
    ** the JPEGEncoder. there is also a PNGEncoder for .png
    files if wanted
    ** The paramerter passed is the quality of jpeg we are
    encoding, 50 - 100.
    var jpegEnc:JPEGEncoder = new JPEGEncoder(80);
    var ba:ByteArray = jpegEnc.encode(bmpd);
    ** Then we need to take the byteArray and save it to disk.
    ** this requries using a File and fileStream object. The try
    block
    ** catches the end of file error.
    var file:File =
    new
    File("file:///Developer/Flex/thumbnailDemo/src/thumbnail/thumb1.jpg");
    var filestream:FileStream = new FileStream();
    try{
    filestream.open(file, FileMode.WRITE);
    filestream.writeBytes(ba);
    filestream.close();
    }catch (e:Error){
    trace(e.message);
    filePath.text = file.name + " has been saved to " +
    file.nativePath;
    filePath.enabled = true;
    ** makeSmall reduces the size of the main image and places
    it in
    ** the smallImg component to await capture
    private function makeSmall():void{
    //makes the image on the screen thumbnail size
    var pic:Image = bigImg;
    var otherPic:Image = smallImg;
    smallImg.source = bigImg.source;
    otherPic.setActualSize(120, 80);
    ** loadThumb loads the saved thumbnail to the savedPic
    component
    private function loadThumb():void{
    var thumb:File =
    new
    File("file:///Developer/Flex/thumbnailDemo/src/thumbnail/thumb1.jpg");
    if (thumb.exists){
    var src:File = new
    File("file:///Developer/Flex/thumbnailDemo/src/");
    var relPath:String = src.getRelativePath(thumb);
    savedPic.source = relPath;
    filePath.text = "The Thumbnail has been sucessfully loaded
    from "
    + thumb.nativePath;
    ]]>
    </mx:Script>
    <mx:VBox horizontalAlign="left" verticalAlign="top">
    <mx:HBox>
    <mx:Image id="bigImg" width="480" height="320"
    source="orignial/test2.jpg"/>
    <mx:VBox verticalAlign="top" horizontalAlign="center">
    <mx:Label text="Thumbnail"/>
    <mx:Image id="smallImg" width="120" height="80" />
    <mx:Label text="Saved Thumbnail" />
    <mx:Image id="savedPic" width="120" height="80" />
    </mx:VBox>
    </mx:HBox>
    <mx:HBox horizontalAlign="left">
    <mx:Button label="Reduce Size" id="btnSmaller"
    click="makeSmall();" />
    <mx:Button label="Snap Thumbnail" id="btnThumbnail"
    click="captureImg();"/>
    <mx:Button label="Load Thumbnail" id="btnLoad"
    click="loadThumb();"/>
    </mx:HBox>
    <mx:Label id="filePath" enabled="false" />
    </mx:VBox>
    </mx:WindowedApplication>

  • Use of hashCode and equals method in java(Object class)

    What is the use of hashCode and in which scenario it can be used?similarly use of equals method in a class when it overides form Object class. i.e i have seen many scenario the above said method is overridden into the class.so why and in which scenario it has to override?Please help me.

    You could find that out easily with google, that is a standard junior developer interview question.

  • Unable to read big files into string object  and java.lang.OutOfMemory Prob

    Hi All,
    I have an application that uses applet and servlet communication. On the client side I am reading an large xml file of 12MB size (using JFileChooser) and converting the file to an string object using below code. But I am getting java.lang.OutOfMemory on the client side . But the same below code works fine for small xml files which are less than 4MB sizes:
    BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(file),"UTF8"), 1024*12);
    String s, s2 = new String();
    while((s = in.readLine())!= null)
         s2 += s + "\n";
    I even tried below code but still java.lang.OutOfMemory is coming:
    while (true)
         int i = in.read();
         if (i == -1)
              break;
         sb.append(i);
    Please let me know what am I doing wrong here ...
    Thanks & Regards,
    Sony.

    Using a String is bad for the following reason:
    When you initially create the String, it has a certain memory size (allocated length if you will). As you keep appending to this String, then memory reallocation will occur over and over, slowing your program down dramatically (ive seen with a 16k x 8 Char file taking 30 secs to read into memory using Strings in this way)
    A Better way would be if you knew the number of characters in the XML file (Using some File size method for example) Then you can use a StringBuffer, which will pre allocate enough space (or try to, it may just be that you cannot create a string as large as you need). You can use toString() method to get the resultant in a String Object (the extra allocated space at the end of the Buffer will be removed)
    StringBuffer strBuf = new StringBuffer(xxxx);
    Where xx is the length (int). Assuming that you are only allowed to enter an int to the constructor then (platform depedant) an int is 2^31 at maximum (or whatever) which allows 2.14e9 characters, therefore an xml file being totally filed would allow a size of ~2048 MB to be read in.
    Try it and see.

  • Draw to an image using graphics object

    ive been trying to this. create a starfield 800px wide and twice the height of the screen 2x600. this image would be scrolling down the screen giving the appearance of moving through space. what i did was create an image the called "starField", and created a graphics object "starFieldObj" to draw dots (stars) to this image.
    is this the correct way to do this? my program seems to work differently depending on where i call "generateStarField()" which draws to "starFieldObj"
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    public class Alpha1 extends Canvas implements Runnable, MouseMotionListener, MouseListener, KeyListener {
         private Image buffer; //bufer image
         private Graphics gfx;
         private Graphics starFieldObj;
         private Image playerShip;
         private int frames = 60; //frames per second
         private MediaTracker mediaTracker; //tracks loaded images
         private boolean ready; //ready to  start animation
         private int [] keys = new int[256];
         private int playerShipX = 100;
         private int playerShipY = 100;
         private static Random random = new Random();
         private Image starField;
         private int starFieldSpeed = 5;
         private int starFieldX = 0;
         private int starFieldY = -600;
         public static void main(String[] args)
              Alpha1 t = new Alpha1();
              Frame f = new Frame("blah");
              f.setSize(800, 600);
              f.add(t, BorderLayout.CENTER);
              f.show();
              t.start();
              t.requestFocus();
              f.addWindowListener(new WindowAdapter(){
                   public void windowClosing(WindowEvent e){
                        System.exit(0);}});
         public Alpha1()
              addKeyListener(this);
              addMouseListener(this);
              ready = false;
              mediaTracker = new MediaTracker(this);
              playerShip = getToolkit().getImage("testship1.png");
              //starField = getToolkit().getImage("testbg.png");
              //mediaTracker.addImage(playerShip, 0);
              mediaTracker.addImage(starField, 0);
              try {
                   mediaTracker.waitForID(0);
              catch (InterruptedException e) {
                   e.printStackTrace();
         public void start()
              buffer = createImage(getSize().width,getSize().height);
              //starField = createImage(getSize().width,getSize().height * 2);
              gfx = buffer.getGraphics();
              //starFieldObj = starField.getGraphics();
              generateStarfield();
              ready = true;
              new Thread(this).start();
         public void mouseDragged(MouseEvent e)     {}
         public void mouseMoved(MouseEvent e)     
              playerShipX = e.getX();
              playerShipY = e.getY();
         public void mouseReleased(MouseEvent e)     {}
         public void mousePressed(MouseEvent e)     {}
         public void mouseExited(MouseEvent e)     {}
         public void mouseEntered(MouseEvent e)  {}
         public void mouseClicked(MouseEvent e)     {}
         public void keyTyped(KeyEvent keyevent)     {}
         public void keyPressed(KeyEvent keyevent)
              keys[keyevent.getKeyCode()] = 1;
              System.out.println(keyevent.getKeyCode());
         public void keyReleased(KeyEvent keyevent)     
              keys[keyevent.getKeyCode()] = 0;
         public void run()
              while (true)
                   if (isVisible())
                        repaint();
                        updatePositions();
                   }//end if
                   try 
                   { Thread.sleep(1000/frames); }
                   catch (InterruptedException e)
                   { e.printStackTrace(); }
              }//end while
         public void paint(Graphics g) {     /*empty etc*/ }
         public void updatePositions()
              if (keys[38] == 1 & keys[40] == 0) //IF UP IS PRESSED
              { playerShipY -= 3; }
              if (keys[40] == 1 & keys[38] == 0) //IF DOWN IS PRESSED
              { playerShipY += 6; }
              if (keys[37] == 1 & keys[39] == 0) //IF LEFT IS PRESSED
              { playerShipX -= 5; }
              if (keys[39] == 1 & keys[37] == 0) //IF RIGHT IS PRESSED
              { playerShipX += 5; }
              //starFieldY = starFieldY + starFieldSpeed;
              //if (starFieldY == 0)
              //     starFieldY = -600;
              //     System.out.println("dadssa");
         public int getRandom(int from, int to)
              if (from > to)
                   int randTemp;
                   randTemp = from;
                   from = to;
                   to = randTemp;
              return random.nextInt(to-from+1)+from;
         public void generateStarfield()
              starFieldObj.setColor(Color.black);
              starFieldObj.fillRect (0, 0, 800, 600 * 2);
              for (int td=0; td < 900 ; td++) //draw 900x2 dots on 800x1200 image
                        starFieldObj.fillRect (getRandom(1,800), getRandom(1,600), 1, 1);
                        starFieldObj.fillRect (getRandom(1,800) + 800, getRandom(1,600) + 800, 1, 1);
         public void update(Graphics g)
              if (ready)
                   gfx.setColor(Color.black);
                   gfx.fillRect (0, 0, this.getSize().width, this.getSize().height);
                   //gfx.drawImage(starField,starFieldX,starFieldY,null);
                   gfx.drawImage(playerShip,playerShipX,playerShipY,null);
                   //gfx.drawString(Integer.toString(showFps),5,5);
                   g.drawImage(buffer,0,0,null);
    }

    updated code, i cant get starField to be 1200px in height
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    public class Alpha1 extends Canvas implements Runnable, MouseMotionListener, MouseListener, KeyListener {
         private Image buffer; //bufer image
         private Graphics gfx;
         private Graphics starFieldObj;
         private Image playerShip;
         private int frames = 60; //frames per second
         private MediaTracker mediaTracker; //tracks loaded images
         private boolean ready; //ready to  start animation
         private int [] keys = new int[256];
         private int playerShipX = 100;
         private int playerShipY = 100;
         private static Random random = new Random();
         private Image starField;
         private int starFieldSpeed = 5;
         private int starFieldX = 0;
         private int starFieldY = -600;
         public static void main(String[] args)
              Alpha1 t = new Alpha1();
              Frame f = new Frame("blah");
              f.setSize(800, 600);
              f.add(t, BorderLayout.CENTER);
              f.show();
              t.start();
              t.requestFocus();
              f.addWindowListener(new WindowAdapter(){
                   public void windowClosing(WindowEvent e){
                        System.exit(0);}});
         public Alpha1()
              addKeyListener(this);
              addMouseListener(this);
              ready = false;
              mediaTracker = new MediaTracker(this);
              playerShip = getToolkit().getImage("testship1.png");
              //starField = getToolkit().getImage("testbg.png");
              //mediaTracker.addImage(playerShip, 0);
              mediaTracker.addImage(starField, 0);
              try {
                   mediaTracker.waitForID(0);
              catch (InterruptedException e) {
                   e.printStackTrace();
         public void start()
              buffer = createImage(getSize().width,getSize().height);
              starField = createImage(getSize().width,1200);
              gfx = buffer.getGraphics();
              starFieldObj = starField.getGraphics();
              ready = true;
              new Thread(this).start();
         public void mouseDragged(MouseEvent e)     {}
         public void mouseMoved(MouseEvent e)     
              playerShipX = e.getX();
              playerShipY = e.getY();
         public void mouseReleased(MouseEvent e)     {}
         public void mousePressed(MouseEvent e)     {}
         public void mouseExited(MouseEvent e)     {}
         public void mouseEntered(MouseEvent e)  {}
         public void mouseClicked(MouseEvent e)     {}
         public void keyTyped(KeyEvent keyevent)     {}
         public void keyPressed(KeyEvent keyevent)
              keys[keyevent.getKeyCode()] = 1;
              System.out.println(keyevent.getKeyCode());
         public void keyReleased(KeyEvent keyevent)     
              keys[keyevent.getKeyCode()] = 0;
         public void run()
              generateStarfield();
              while (true)
                   if (isVisible())
                        repaint();
                        updatePositions();
                   }//end if
                   try 
                   { Thread.sleep(1000/frames); }
                   catch (InterruptedException e)
                   { e.printStackTrace(); }
              }//end while
         public void paint(Graphics g) {     /*empty etc*/ }
         public void updatePositions()
              if (keys[38] == 1 & keys[40] == 0) //IF UP IS PRESSED
              { playerShipY -= 3; }
              if (keys[40] == 1 & keys[38] == 0) //IF DOWN IS PRESSED
              { playerShipY += 6; }
              if (keys[37] == 1 & keys[39] == 0) //IF LEFT IS PRESSED
              { playerShipX -= 5; }
              if (keys[39] == 1 & keys[37] == 0) //IF RIGHT IS PRESSED
              { playerShipX += 5; }
              starFieldY = starFieldY + starFieldSpeed;
              if (starFieldY == 0)
                   starFieldY = -600;
                   System.out.println("dadssa");
         public int getRandom(int from, int to)
              if (from > to)
                   int randTemp;
                   randTemp = from;
                   from = to;
                   to = randTemp;
              return random.nextInt(to-from+1)+from;
         public void generateStarfield()
              starFieldObj.setColor(Color.black);
              starFieldObj.fillRect (0, 0, 800, 1200);
              for (int td=0; td < 900 ; td++) //draw 900x2 dots on 800x1200 image
                        starFieldObj.setColor(Color.white);
                        starFieldObj.fillRect (getRandom(1,800), getRandom(1,600), 1, 1);
                        starFieldObj.fillRect (getRandom(1,800) + 800, getRandom(1,600) + 800, 1, 1);
         public void update(Graphics g)
              if (ready)
                   gfx.setColor(Color.black);
                   //gfx.fillRect (0, 0, this.getSize().width, this.getSize().height);
                   gfx.drawImage(starField,starFieldX,starFieldY,null);
                   gfx.drawImage(playerShip,playerShipX,playerShipY,null);
                   //gfx.drawString(Integer.toString(showFps),5,5);
                   g.drawImage(buffer,0,0,null);
    }

  • Reading SNMP packet using PL/SQL and XML

    Hi,
    Is it possible to read the content of a SNMP packet using MIB file converted into XML. I know it's possible to develop a java program which can collect SNMP packets from the network and inserts them into Oracle. The problem after that is how to read the content using MIB library file. It's possible to convert the MIB file into XML file but the problem is to create s PL/SQL block which can read the XML file and based on the content to translate the information from the SNMP packet. Is it possible?
    regards
    Edited by: user10484841 on Sep 24, 2010 3:15 AM

    Thank you for the reply!
    I have converted oracle MIB into xml using prtg's import tool. As far as I see prtg also uses xml as you can see below.
    So how I can translate string for example 1.3.6.1.2.1.39.1.1.1.1.1111111111 using xml and pl/sql?
    Can you give me direction where to start?
    <?xml version="1.0" encoding="ISO8859-1" ?>
    <oidlist>
    <system>
    <version>
    1
    </version>
    </system>
    <list>
    <entry>
    <name>
    RDBMS-MIB|rdbms db: #[1.3.6.1.2.1.39.1.1.1.1]|rdbms db index
    </name>
    <oid>
    1.3.6.1.2.1.39.1.1.1.1
    </oid>
    <type>
    vmAbsolute
    </type>
    <kind>
    mkTable
    </kind>
    <unittype>
    sutCustom
    </unittype>
    <units>
    </units>
    <indicator>
    rdbms db index
    </indicator>
    <scale>
    1
    </scale>
    <multiply>
    no
    </multiply>
    <max>
    0
    </max>
    <usegetnext>
    no
    </usegetnext>
    <is64bit>
    no
    </is64bit>
    <isunsigned>
    no
    </isunsigned>
    <isfloat>
    no
    </isfloat>
    <description>
    A numeric index, unique among all the databases from all products on this host. This value is a surrogate for the conceptually unique key, which is {PrivateMibOID, databasename}
    </description>
    </entry>
    <entry>
    <name>
    RDBMS-MIB|rdbms db info: #[1.3.6.1.2.1.39.1.1.1.3]|rdbms db info size units
    </name>
    <oid>
    1.3.6.1.2.1.39.1.2.1.3
    </oid>
    <type>
    vmAbsolute
    </type>
    <kind>
    mkTable
    </kind>
    <unittype>
    sutCustom
    </unittype>
    <units>
    </units>
    <indicator>
    rdbms db info size units
    </indicator>
    <scale>
    1
    </scale>
    <multiply>
    no
    </multiply>
    <max>
    0
    </max>
    <usegetnext>
    no
    </usegetnext>
    <is64bit>
    no
    </is64bit>
    <isunsigned>
    no
    </isunsigned>
    <isfloat>
    no
    </isfloat>
    <description>
    Identification of the units used to measure the size of this database in rdbmsDbInfoSizeAllocated and rdbmsDbInfoSizeUsed. bytes(1) indicates ndividual bytes, kbytes(2) indicates units of kilobytes, mbytes(3) indicates units of megabytes, gbytes(4) indicates units of gigabytes, and tbytes(5) indicates units of terabytes. All are binary multiples -- 1K = 1024. If writable, changes here are reflected in the get values of the associated objects.
    </description>
    </entry>
    <entry>
    <name>
    RDBMS-MIB|rdbms db info: #[1.3.6.1.2.1.39.1.1.1.3]| rdbms db info size allocated
    </name>
    <oid>
    1.3.6.1.2.1.39.1.2.1.4
    </oid>
    <type>
    vmAbsolute
    </type>
    <kind>
    mkTable
    </kind>
    <unittype>
    sutCustom
    </unittype>
    <units>
    </units>
    <indicator>
    rdbms db info size allocated
    </indicator>
    <scale>
    1
    </scale>
    <multiply>
    no
    </multiply>
    <max>
    0
    </max>
    <usegetnext>
    no
    </usegetnext>
    <is64bit>
    no
    </is64bit>
    <isunsigned>
    no
    </isunsigned>
    <isfloat>
    no
    </isfloat>
    <description>
    The estimated size of this database (in rdbmsDbInfoSizeUnits), which is the disk space that has been allocated to it and is no longer available to sers on this host. rdbmsDbInfoSize does not necessarily indicate the amount of space actually in use for database data. Some databases may support extending allocated size, and others may not. Note that a compliant agent does not need to allow write access to this object.
    </description>
    </entry>
    </list>
    </oidlist>
    *Note that the xml file is not full die to 30000 character restriction of oracle's forum
    regards
    Edited by: user10484841 on Oct 19, 2010 6:07 PM
    Edited by: user10484841 on Oct 19, 2010 6:07 PM

  • Problems reading BMP images using ReadImage function

    I am trying to load BMP images using the IMAQ Vision ReadImage function (VB6). The images load as monochrome images.
    I use the CWIMAQViewer1.Pallette as a parameter in the command.
    Note: The images load fine when using Vision Assistant or other image viewing software.
    Any ideas?
    Thanks!

    Sorry. Wrong forum. I'll repost on Machine Vision forum.

  • How to use an object's paint method

    I have created a class imagePanel which extends a jPanel to display an image. When I create a new imagePanel object I pass it an image argument which is used to paint my image on the jPanel, so far so good. I don't wish to have to continuously create new ImamePanels to display new images so I thought I could make a set_Image method that would set a new image in an exising imagePanel object. This is where I run into problems how to use the existing object paint method to replace the image. I tried this without success:
    public Image setMyImage (Image myImage)
    imageX = myImage; // imageX is the image that is painted by the imagePanel object's paint method
    paint(g);
    Something must be wrong on how I access the paint method. Thanks for any help.
    Jack

    Yahoooo, got it. This was the code I needed and thanks for your help:
    public void setImage (Image myImage)
    imageX = myImage;
    repaint(300);
    }

  • When we use call transaction and session method?

    cud anyone tell me the exact difference between session and call transaction ? when we have to use ?

    hi,
    BATCH INPUT METHOD
    Asynchronous processing     
    Transfer data for multiple transactions.
    Synchronous database update.
    A batch input process log is generated for each session.
    Session cannot be generated in parallel.
    CALL TRANSACTION METHOD:
    Using CALL TRANSACTION USING statement
    Faster processing of data
    Synchronous processing
    Transfer data for a single transaction.
    No batch input processing log is generated.

  • Difference between invoking a method using reflect.proxy and reflect.Method

    Could any one tell me the difference between invoking a method using reflection java.lang.reflect.Method and java.lang.reflect.Proxy
    using both the class, we can invoke a method at runtime
    1)
    Method mthd=cl.getMethod("methodName",parameterName);
    Integer output=(Integer)mthd.invoke(new RunMthdRef(),input);
    2)
    Proxy.newProxyInstance(super.getClass().getClassLoader(), new Class[] { adapter }, new SomeClass(this));
    Does anybody have any idea?

    The two idioms are fundamentally different. Using java.lang.reflect.Method is how we call a method on a class, using Proxy is how we intercept that method call. An exercise for you, to illustrate that they do not do the same thing: write a simple class with one method, then use java.lang.reflect.Method to invoke that method, and then use a Proxy to invoke that method

  • OLE objects and OO methods - Error using OLE automation

    Hi,
    I'm developing an class to read/write excel sheets and i'm getting an error on the OLE method that is:
    on this instruction
    call method of l_obj_excel 'WORKBOOKS' = l_workb_col.
    i got a dump that give me the following error UC_OBJECTS_NOT_CONVERTIBLE
    The strange is that i've got the same code running on reports and it works fine only when passing it to a oo method i get that dump.
    Thzs in advanced to all
    Best regards
    Jaime

    hi check this..
    Report ZMULTICOLOR_TEST no standard page heading.
    this report demonstrates how to send some ABAP data to an
    EXCEL sheet using OLE automation.
    include ole2incl.
    handles for OLE objects
    data: h_excel type ole2_object,        " Excel object
          h_mapl type ole2_object,         " list of workbooks
          h_map type ole2_object,          " workbook
          h_zl type ole2_object,           " cell
          h_f type ole2_object,            " font
          h_c type ole2_object.            " color
    DATA: FILENAME LIKE RLGRAP-FILENAME.
    tables: spfli.
    data  h type i.
    table of flights
    data: it_spfli like spfli occurs 10 with header line.
    *&   Event START-OF-SELECTION
    start-of-selection.
    read flights
      select * from spfli into table it_spfli.
    display header
      uline (61).
      write: /     sy-vline no-gap,
              (3)  'Flg'(001) color col_heading no-gap, sy-vline no-gap,
              (4)  'Nr'(002) color col_heading no-gap, sy-vline no-gap,
              (20) 'Von'(003) color col_heading no-gap, sy-vline no-gap,
              (20) 'Nach'(004) color col_heading no-gap, sy-vline no-gap,
              (8)  'Zeit'(005) color col_heading no-gap, sy-vline no-gap.
      uline /(61).
    display flights
      loop at it_spfli.
        write: / sy-vline no-gap,
                 it_spfli-carrid color col_key no-gap, sy-vline no-gap,
                 it_spfli-connid color col_normal no-gap, sy-vline no-gap,
                 it_spfli-cityfrom color col_normal no-gap, sy-vline no-gap,
                 it_spfli-cityto color col_normal no-gap, sy-vline no-gap,
                 it_spfli-deptime color col_normal no-gap, sy-vline no-gap.
      endloop.
      uline /(61).
    tell user what is going on
      call function 'SAPGUI_PROGRESS_INDICATOR'
         exporting
              PERCENTAGE = 0
               text       = text-007
           exceptions
                others     = 1.
    start Excel
      create object h_excel 'EXCEL.APPLICATION'.
    PERFORM ERR_HDL.
      set property of h_excel  'Visible' = 1.
    CALL METHOD OF H_EXCEL 'FILESAVEAS' EXPORTING #1 = 'c:\kis_excel.xls'  .
    PERFORM ERR_HDL.
    tell user what is going on
      call function 'SAPGUI_PROGRESS_INDICATOR'
         exporting
              PERCENTAGE = 0
               text       = text-008
           exceptions
                others     = 1.
    get list of workbooks, initially empty
      call method of h_excel 'Workbooks' = h_mapl.
      perform err_hdl.
    add a new workbook
      call method of h_mapl 'Add' = h_map.
      perform err_hdl.
    tell user what is going on
      call function 'SAPGUI_PROGRESS_INDICATOR'
         exporting
              PERCENTAGE = 0
               text       = text-009
           exceptions
                others     = 1.
    output column headings to active Excel sheet
      perform fill_cell using 1 1 1 200 'Carrier id'(001).
      perform fill_cell using 1 2 1 200 'Connection id'(002).
      perform fill_cell using 1 3 1 200 'City from'(003).
      perform fill_cell using 1 4 1 200 'City to'(004).
      perform fill_cell using 1 5 1 200 'Dep. Time'(005).
      loop at it_spfli.
    copy flights to active EXCEL sheet
        h = sy-tabix + 1.
        if it_spfli-carrid cs 'AA'.
          perform fill_cell using h 1 0 000255000 it_spfli-carrid.
        elseif it_spfli-carrid cs 'AZ'.
          perform fill_cell using h 1 0 168000000 it_spfli-carrid.
        elseif it_spfli-carrid cs 'JL'.
          perform fill_cell using h 1 0 168168000 it_spfli-carrid.
        elseif it_spfli-carrid cs 'LH'.
          perform fill_cell using h 1 0 111111111 it_spfli-carrid.
        elseif it_spfli-carrid cs 'SQ'.
          perform fill_cell using h 1 0 100100100 it_spfli-carrid.
        else.
          perform fill_cell using h 1 0 000145000 it_spfli-carrid.
        endif.
        if it_spfli-connid lt 400.
          perform fill_cell using h 2 0 255000255 it_spfli-connid.
        elseif it_spfli-connid lt 800.
          perform fill_cell using h 2 0 077099088 it_spfli-connid.
        else.
          perform fill_cell using h 2 0 246156138 it_spfli-connid.
        endif.
        if it_spfli-cityfrom cp 'S*'.
          perform fill_cell using h 3 0 155155155 it_spfli-cityfrom.
        elseif it_spfli-cityfrom cp 'N*'.
          perform fill_cell using h 3 0 189111222 it_spfli-cityfrom.
        else.
          perform fill_cell using h 3 0 111230222 it_spfli-cityfrom.
        endif.
        if it_spfli-cityto cp 'S*'.
          perform fill_cell using h 4 0 200200200 it_spfli-cityto.
        elseif it_spfli-cityto cp 'N*'.
          perform fill_cell using h 4 0 000111222 it_spfli-cityto.
        else.
          perform fill_cell using h 4 0 130230230 it_spfli-cityto.
        endif.
        if it_spfli-deptime lt '020000'.
          perform fill_cell using h 5 0 145145145 it_spfli-deptime.
        elseif it_spfli-deptime lt '120000' .
          perform fill_cell using h 5 0 015215205 it_spfli-deptime.
        elseif it_spfli-deptime lt '180000' .
          perform fill_cell using h 5 0 000215205 it_spfli-deptime.
        else.
          perform fill_cell using h 5 0 115115105 it_spfli-deptime.
        endif.
      endloop.
    EXCEL FILENAME
      CONCATENATE SY-REPID '_' SY-DATUM6(2) '_' SY-DATUM4(2) '_'
                  SY-DATUM(4) '_' SY-UZEIT '.XLS' INTO FILENAME.
      CALL METHOD OF H_MAP 'SAVEAS' EXPORTING #1 = FILENAME.
      free object h_excel.
      perform err_hdl.
          FORM FILL_CELL                                                *
          sets cell at coordinates i,j to value val boldtype bold       *
    form fill_cell using i j bold col val.
      call method of h_excel 'Cells' = h_zl
        exporting
          #1 = i
          #2 = j.
      perform err_hdl.
      set property of h_zl 'Value' = val .
      perform err_hdl.
      get property of h_zl 'Font' = h_f.
      perform err_hdl.
      set property of h_f 'Bold' = bold .
      perform err_hdl.
      set property of h_f 'Color' = col.
      perform err_hdl.
    endform.                    "FILL_CELL
    *&      Form  ERR_HDL
          outputs OLE error if any                                       *
    -->  p1        text
    <--  p2        text
    form err_hdl.
      if sy-subrc <> 0.
        write: / 'OLE-Automation Error:'(010), sy-subrc.
        stop.
      endif.
    endform.                    " ERR_HDL
    regards,
    venkat

  • How to generate formated (defined position) text and image using pl/sql and

    Hello,
    I need to use pl/sql to create a dynamic html page (or image , if possible) with defined positions for text and bar code. It is necessary because the page will be printed and it should be able to be read by one other process , OCR, that needs to have all the data in defined positions.
    Any suggestion are welcome.
    Thanks in advance,
    Emilio

    I don't think it's that easy. Notice that if you put the insert into an actual pl/sql block, you don't get the correct column pointer anymore.
    BEGIN insert into bob(col1, col2) values (123.12, 12345.12); END;
    ERROR at line 1:
    ORA-01438: value larger than specified precision allows for this column
    ORA-06512: at line 1
    Richard

Maybe you are looking for

  • Text Entry not waiting for entry before continuing

    Captivate 4 I'm trying to add a TEB where the user will need to enter the correct text before moving to the next slide.  I would like it to continue as soon as they user types the correct entry.  The problem is that the slide doesn't pause to wait fo

  • Where can I buy a 5g replacement battery?

    My battery only lasts about 8 hours on the suggested settings from Apple. I sent it in and they sent it back with nothing in the box, just the ipod. Incidentally they wiped all my videos and music and put on a whole new set of stuff. I called technic

  • How can I add a website to a 'block' list so that Mozilla will not display it as a selection in a Google search?

    I search for images with no filtering using Google and receive a bunch of sites that are known for installing Trojans or other malware. One of them ends with brstsecond.net. 'brstsecond" seems to be bad in any web address. In fact, any website with m

  • I-photo application is gone

    I logged on to my computer today and I have no I-photo application. the icon is still present at the bottom of the screen but nothing opens. I used finder to open applications and were I-photo used to be is now a blank space. When I looked in the pic

  • How to create a new custom tag in JSF 1.2

    Hi there, In JSF 1.2, all the classes (CommandButtonTag, CommandLinkTag, DataTableTag,...) in package com.sun.faces.taglib.html_basic are defined as final class. In JSF 1.1, we can create a custom tag that extends the tag in JSF taglib; it save us lo