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.

Similar Messages

  • MAKE AN IMAGE USING A FUNCTION

    HI genius....
    i want to make an image using the function 1/cos(RotAngle).The image will look like i have attached below.
    faithfully.
    akhil...
    Attachments:
    New folder1.jpg ‏59 KB

    Hi Ragil,
    the attached image just shows black/white stripes.
    How is this related to "making the image using 1/cos(Angle)"???
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • 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

  • Problem to output image using ServletOutputStream

    Hallo everybody! Can anybody help me? I try to output image (jpeg) using ServletOutputStream. First I upload jpeg image to server disassemble it to binary data and save to database binary data, image length, and image type. Then I try to output image.
    Here the code:
    response.reset();
    response.setContentType(strContentType);
    ServletOutputStream sos=response.getOutputStream();
    sos.write(buf,0,bflen);
    sos.close();
    variable buf is array of byte with binary data
    bflen is image length
    strContentType it image type (image/pjpeg)
    I use JRun server 3.1
    I tried to save an image file:
    FileOutputStream fos = new FileOutputStream("test_logo.jpg");
    fos.write(buf,0,bflen);
    fos.close();
    And I got an jpeg file.

    I've done the exact same thing... almost. I have a
    servlet that sends a jpeg file to an applet for
    processing. Anyway, I did two things differently.
    First I used the write(byte[]) rather than
    write(byte[], int offset, int length). If you're
    going to send the whole array anyway, don't bother
    with the other parameters.
    Second, I call flush() on the output stream before I
    close it. I have a feeling this is why. Remember,
    web connections are connectionless. You don't know if
    the data was send or received. I assume what is
    happening is that you try to send the data then close
    the connection right away and the data may not get to
    the destination.
    Here's what I have. I don't think the content type
    really matters but I know multipart/form-data is
    binary.
    response.setContentType("multipart/form-data");
    response.getOutputStream().write(image.data);
    response.getOutputStream().flush();
    response.getOutputStream().close();
    I'll try it. But I have problem to call getOutputStream() method. It produce IllegalStateExeption. I think that because implicit getWriter() method calls. (I use JSP)
    Do you know how to reset somehow response to have ability to call getOutputStream()?

  • Problem reading file after using webutil_file_transfer.as_to_client

    Hi all,
    The Forms webapplication I'm working on has to talk with a cardreading-application on the client-PC. The communication is carried out by exchanging small files. Reading from the client by Forms on the AS goes well (using client_text_io from webutil). The problem arises when the application has to respond back with a file. The file is made on the AS and then transfered from the AS to the client using webutil_file_transfer.as_to_client. This file can not be read by the cardreading application when the AS is on Linux. Our developement AS server is on a Windows 2000 box and then the communication doesn't show this problem.
    If I open the file from the AS on Linux , I can see that there is only 1 long line. The Windows version of the file contains 2 lines (as it should be). It seems that before/during/after the transfer some special characters like carriage return and tab are causing the problem.
    Looking in web_file_transfer.as_to_client I see that the procedure reads lines from a temporary file into a buffer. The lines are separated by a CHR(10). Could the transfer from Linux to Windows(DOS) cause a problem with these characters ?
    Has anyone experienced this problem ? If someone has a clue this would be very welcome.
    We work with :
    - Forms and AS 10.1.2.0.2
    - Webutil 1.0.6
    - Development OS: Windows 2000 (Service Pack 4)
    - Production OS: Red Hat Enterprise Linux AS release 3 (Taroon Update 3)
    - Client-PC OS: Windows 2000 (Service Pack 4)
    Thanx,
    Enrico

    Without going into a long winded answer, the only thing I can really offer is to say this... If you feel as though your code has been correctly written and you simply cannot identify any other possible solution, add SYNCHRONIZE. In short, its execution acts similar to a reset or refresh button.
    Another common place where SYNCHRONIZE has been helpful is when calling RUN_REPORT_OBJECT. For example, if you use the code we offer in the Forms/Reports Integration document you will find that it works very well - most of the time. However, sometimes it fails for what seems to be unexplainable reasons. If you message out the values being assigned you will see that some variable values are not being set even though the code execution has already passed the point where a value should have been assigned. Adding the SYNCHRONIZE just after the point where the value should have been assigned forces the assignment before executing the next line of code. For example,
         v_rep := RUN_REPORT_OBJECT(repid);
         rep_status := report_object_status(v_rep);
    In the above code, a request for a report is made followed by a check of its status. At this point you would expect that the status would be something like one of the following:
         'RUNNING', 'OPENING_REPORT', 'ENQUEUED'
    However, we have seen instances where the value assigned to the variable would actually be NULL, which of course will make the rest of the code likely fail. By adding SYNCHRONIZE the problem is correctable.
         v_rep := RUN_REPORT_OBJECT(repid);
         rep_status := report_object_status(v_rep);
         SYNCHRONIZE;
    It is important to understand, however that using SYNCHRONIZE comes at a price. Each time it is executed a network round-trip occurs which will give the application the appearance of degraded performance. So use this built-in only when you know you must.

  • Problem in processing image using IMAQ

    I want to do image processing (filtering, thresholding and skeletonizing) on my acquired image. Unfortunately, the program that I made cannot run. When I try to execute it, the error message: incompatible image size appears. Anybody can point out what's wrong with my program? Attached is the VI that I made. Really appreciate your help.
    Attachments:
    Image_Acquisition.vi ‏71 KB

    Check where you are getting your image from. You should be taking the image from the IMAQ Get Image.VI. The way your code is currently set up, you are processing a non-existant image. LabVIEW will run any subVI as soon as all of it's inputs are satisfied. Your processing is set up to start just after you create the image buffer, rather than waiting until after you fill it.

  • Problem reading disk image

    I just purchased and downloaded a full upgrade version of Lightroom 5 (not creative cloud). I successfully completed the purchase and download but my Mac Pro cannot open the package (i just downloaded a different Adobe product successfully yesteday).
    I have lots of disk space. I have Mac OS X 10.6.8 and 8 GBs of RAM. Any ideas why this won't open?
    I have a copy of Lightroom 3 and 4 on the machine already, running just fine.
    I'm going to try redownloading this package but wondering if others are having this problem.

    It appears that I needed to download it again. It ran this time. Thanks for the idea, but no, for some reason it must have been corrupted. 

  • Problem in displaying images using JLabel in Netbeans

    hi all,
    i am trying to display an image on JLabel in Netbeans.The image is visible in the design view but not displayed in the runtime.Can anyone help me out with suggestions???

    Duplicate - answer here http://forum.java.sun.com/thread.jspa?threadID=5153605&messageID=9578626#9578626

  • How to read 32 bit depth .bmp image

    How to read 32 bit depth .bmp image using LabVIEW?
    @nk
    Solved!
    Go to Solution.

    A "standard" image, by which I mean an image type most typically encountered, stores image data in RGB format with 8 bits per colour, making them 24-bit images (24bbp - bits per pixel). A 32-bit image normally includes an additional 8 bits for the alpha channel, but in BMP files this format is complex (see wiki article), and it appears the LabVIEW Read BMP function does not support it.
    Do you have the IMAQ toolkit? I can't test the theory, but perhaps the IMAQ functions for reading image files are more advanced and can read your images?
    Thoric (CLA, CLED, CTD and LabVIEW Champion)

  • Problem using LIKE function

    Hi Guyz,
    I am having small problem using LIKE function . The problem is I am using LIKE function in the WHERE clause
    to compare a column to a particular value, which gets this value from the front end. If the user has a single quote in the string he entered then the LIKE function is not working because of the single quote. Is there any way I can escape the single quote like we escape '%' and '_'.
    Thankyou.

    Mod_plsql supports bind variables, as do almost all front-end tools that deal with Oracle (and most other databases). I do not code mod pl/sql myself, but others here do, and I see bind variables in their code all the time (if I don't, they hear from me :-)).
    If you pass a bind variable, the quote problem goes away. As far as I know (which is not very far), you should be able to take the string with the quote directly from your input field, bind it to the variable in your query and have no problems.
    I suspect that the reson you are having issues is that you are just gluing strings together to create a sql statement. this is the wrong approach.
    The java term for what you are looking for is prepared statement, I'm not sure what the equivalent is i mod plsql, but that should give you a start.
    John

  • Problem reading image from input Stream

    I'm having a problem reading an image through an input stream. It gives me the error
    Premature end of JPEG file
    sun.awt.image.ImageFormatException: JPEG datastream contains no imageand my code looks like
    public Image getImage(String name, String command){
              if(command.equals(pCode)){
                   Image image=null;
                   System.out.println(name);
                   InputStream is = getClass().getResourceAsStream(name);
                   BufferedInputStream bis = new BufferedInputStream(is);
                    byte[] byBuf =new byte[10000];
                     try {
                        int byteRead = bis.read(byBuf,0,10000);
                   } catch (IOException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                     image = Toolkit.getDefaultToolkit().createImage(byBuf);
                   return image;
              return null;
         }And the string name looks when printed is: usr/images/PRLogo.jpg

    If the image is bigger than 10K, this code will break.
    You can pass an InputStream to javax.imageio.ImageIO.read. That's probably an easier option than trying to do the buffering yourself.

  • Problems with output using html2fo function

    Hello,
    I have a problem with output when using html2fo function.
    My sample xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <RTECODE>
    <![CDATA[
    <table border="1">
    <tr>
    <td>row 1, cell 1</td>
    <td>row 1, cell 2</td>
    </tr>
    <tr>
    <td>row 2, cell 1</td>
    <td>row 2, cell 2</td>
    </tr>
    </table>
    ]]>
    </RTECODE>
    Can anybody explain why the rtf template output is different in pdf, rtf, excel ? It looks ok only in pdf.
    Thanks in advance.

    Check these
    http://docs.oracle.com/cd/E23943_01/bi.1111/e22254/create_rtf_tmpl.htm#CHDCEEIJ
    https://blogs.oracle.com/xmlpublisher/entry/html_in_xml_support
    If helps mark
    Edited by: Srini VEERAVALLI on Feb 25, 2013 10:04 AM

  • How to add Image in "SX_OBJECT_CONVERT_OTF_PDF" Function module

    Hi,
    We have scenario to add a BMP image from report to PDF format ,they are  using the SX_OBJECT_CONVERT_OTF_PDF function module to generate the report in PDF ,so we want to know how to add a image(BMP) for this function module or is there any other function module to get the image in PDF format.
    Replies would be appreciated.
    Regards
    Raghava

    Hi Brad Bohn ,
    We have the scenario were in we have two tabs (If click first tab output is displayed in excel with image using OLE functionality) for second tab output is displayed in PDF by using SX_OBJECT_CONVERT_OTF_PDF-Function module without the image(*.bmp).
    Our requirement is to get image in PDF.
    Please let us know which is the way to approach this scenario.
    Regards,
    Raghava

  • Read an image from jar

    I have a problem reading an image file inside a jar file. I basically want to read an image file from a jar and throw it on the browser. The following is the code that I'm using.
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.net.URL;
    public class ImageServlet extends HttpServlet {
    public void doGet(HttpServletRequest request, HttpServletResponse response)
    try {
    response.setContentType("image/jpeg");
    InputStream inputStream = ImageServlet.class.getResourceAsStream("/duke.jpg");
    //InputStream inputStream = getServletContext().getResourceAsStream("/duke.jpg");
    byte x[] = new byte[inputStream.available()];
    inputStream.read(x);
    ByteArrayOutputStream ostr = new ByteArrayOutputStream();
    ServletOutputStream outputStream = response.getOutputStream();
    ostr.write(x);
    ostr.writeTo(outputStream);
    inputStream.close();
    outputStream.close();
    ostr.close();
    } catch (java.net.MalformedURLException e) {
    System.out.println( "URL: " + e.toString() );
    } catch (java.io.IOException e) {
    System.out.println("IO: no Jar! searching ..." );
    } catch (Exception e) {
    System.out.println(e.toString());
    When duke.jpg is in web application's root, both
    InputStream inputStream = ImageServlet.class.getResourceAsStream("/duke.jpg");
    and
    InputStream inputStream = getServletContext().getResourceAsStream("/duke.jpg");
    works fine.
    But when I delete it from web application's root and instead have it in a jar file in WEB-INF/lib, it doesn't work. It just gives me a broken image (doesn't throw an Exception).
    Any ideas?
    Thanks
    Saravanan

    Well, it should work, as long as you truly do have those SP jars ahead in the correct classpath parts (boot goes into the normal classpath, and the other one goes into the -Dweblogic.class.path (or something like that) command-line parameter). It works for me, and I know for a fact that in service pack 8 and below it's broken (don't know about service pack 9), and it got fixed in service pack 10. Sounds simple, but make certain your service pack jar files are in the directory specified in the classpath(s), and spelled correctly - you know it won't give you an error to let you know if you mistyped something, like if you included "nonexistent.jar" for example.

  • How to use this function in crm5.2 -   /CEM/ENT_IMPORT_DATAFROMEXCEL

    i am having a problem regarding how to use this function to import values from an excel sheet.
    in call funtion what to specify at place of ct_ent_action = ?
    CALL FUNCTION '/CEM/ENT_IMPORT_DATAFROMEXCEL'
      CHANGING
        CT_ENT_ACTION       =
    EXCEPTIONS
      FILE_ERROR          = 1
      IMPORT_ERROR        = 2
      OTHERS              = 3
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.

    Hi
    The use of Standard Parner functions are as follows:
    1. Ordering Address (OA): The PO will be sent this vendor and not the main vendor.
    2. Goods Supplier (WL): In case of return deliveries, Goods will be returned to thsi vendor's address
    3. Invoicing party (RS): The payment will be made to this vendor.
    Hope this clarifies.
    Thansk

Maybe you are looking for

  • How to convert avchd footage when it's on your hard drive in your computer?

    hey guys, I have a problem. I have a Sony Hdr-sr7 hard drive avchd camcorder and I can convert the footage to pro res just fine when i plug in my camera via usb. but when I download the avchd files (.mts .mt2s) to my mac hard drive I'm not able to co

  • How do I get rid of App Store notification for a software update that does not conform to the OS that I am using?

    I am using Snow Leopard and have no wish to upgrade to Lion.  App Store notification indicates that there is an iPhoto 11 update available.  When I try to update, the error message indicates that I need Lion to download the update.  The notification

  • Unlock pdf

    how can I unlock a pdf to answer questions using the computer?

  • 25 days and counting, a disgrace!

    Hi everyone, let me share with you a little timeline. Day 1, April 14th, our broadband and phoneline suddenly stop working. I hear from a neighbour that his is down too, so we both call it in. Will be sorted in 3 days we're told. Day 3, April 16th, I

  • Calling script masters

    I have a index.asp page with the following java script... amongst the code is the js for my countdown clock... The problem is that when I add my news summary asp page to the site (ssi) which has some code (see below) the clock function disappears - c