Loading bitmap (.BMP) files

I am writing a sort of Image Viewers with Flex 2 - loading
and displaying image files resided in local disk.
Using mx.controls.Image class, I could load and display the
JPG / GIF / PNG files at runtime.
But I could not do the BMP files with the Image class (or
control); what I get is only broken-image icon.
Still I don't understand why the BMP format files are not
included in the "Bitmap object".
How can I load / display BMP files in Flex 2 MXML
application?
Thanks in Advance,
Joseph

Hi,
I have tried the loader.unload(); method and now I get this
following error:
TypeError: Error #1009: Cannot access a property or method of
a null object reference.
at loadCorrect_fla::MainTimeline/clip1()
I am obviously missing the point here, but how am I doing
this wrong?
Kind Regards,
Boxing Boom

Similar Messages

  • How to save a CWGraph into a bitmap (.bmp) file in Visual C++?

    I plot (chart) data into a graph control on a MFC dialog in Visual C++ and I need to save the image into a bmp file. I found the ControlImage method, but did not find any way to use it in Visual C++.
    I would also like to retrieve the chart data (the point charted on the graph for each plot) and to use them to build data files. How to do it?

    Dealing with images in VC++ is far from easy. You would need to create the following objects: CBitmap, CArchive, CPictureHolder and a CDC.
    Then call the SelectObject function on the CDC and pass in the CBitmap object. Then you can put the image of the graph in the CPictureHolder with:
    ph.SetPictureDispatch((LPPICTUREDISP)m_CWGraph.Con​trolImage().m_lpDispatch);
    where ph is the CPictureHolder and m_CWGraph is the CWGraph.
    Then you can render the image to the bitmap CDC by calling the CPictureHolder::Render function. It will ask for the bounds of the picture in CRect form as well.
    Then you can call the CBitmap.Serialize function with the CArchive object which should be pointing to the appropriate BMP file. Don't you just love MFC?
    As for you second qu
    estion, you can't retrieve the data that has been plotted to the graph. We don't maintain the data that is sent in because it would be very inefficient memory usage since data is usually decimated for display. I would recommend that you just send your data to a global buffer at the same time as plotting.
    Best Regards,
    Chris Matthews
    Measurement Studio Support Manager

  • Bmp files - easy ?

    maybe this is a begginner's question:
    how do i load a bmp file into a BufferedImage ? i'm guessing it should be as easy as a jpeg (with the JPEGdecoder and all). or do i have to write my own format reader for this ???
    thanks

    You should use ImageIO.read.
    Unfortunately, the j2se ships with readers for only gif, jpeg and png, but you can get more
    service providers, including one for format bmp here.

  • Load .bmp file into BLOB column in 9i - how to?

    Hello all,
    How do I update a table with a BLOB column with a .bmp file in 9i? I tried using the DBMS_LOB package but got a ORA-06502: PL/SQL: numeric or value error: invalid LOB locator specified: ORA-22275 (and since there is more native support in 9i, I'm not sure I need it to begin with). We do not have Inter-Media. tia [email protected]

    Hi,
    please, search a bit on the forum before do a question:
    Just searching by "upload blob pdf" ...
    How to batch upload PDF files into database BLOB
    Regards,
    Jose.

  • Converting bmp file to pdf

    Hi all,
    Please help me to solve this:
    1) convert bmp file to PDF( using FM) .
    2)There can be many such bmp files ..append them to single pdf file after converting them.
    Thanks and Regards,
    KC

    As has been discussed many times here before, you can't really merge PDF files programmatically in ABAP after they have been created.  Your best bet with this 'unique' requirement is to use a form-based approach I think.
    With a smartform one approach is to create a single page with a window with a graphics node (dynamic name) in it, with the bitmap name specified in the form interface.  Unless you have already loaded the bitmaps in the graphics manager (SE78), you would load the bitmaps at runtime from the presentation server or the application server and then create the graphics dynamically using the methods of class CL_BDS_DOCUMENT_SET prior to calling the form for each bitmap (a topic discussed recently in the ABAP forums or you can view how SE78 does it by checking the code).  Create a merged spool and then use the standard function to convert the OTF data to PDF format.
    A similar approach can be used with Adobe forms, but you would need to load the bitmaps to the web repository, not the graphics manager.
    What exactly is in the bmp files and where are they stored?  Are they form templates?  You may get a better answer with more details.

  • Can Java support .bmp files?

    This is probably a dumb question but I'm just wondering if Java supports .bmp files. I know how big they are and that they're not 100% reliable at being transparent and that they are slow when it comes to scaling. I also found them slow when they are drawn transparently not to mention that they are also not reliable at being translucent either. But I do have a program that can convert bitmaps to GIFs, JPEGs, PNGs, PCX... well, just about every image format that there is out there but I do start creating my images as .bmp's because they're easy to edit. So does Java support them?

    I assume it does... If you're not sure, try it. But why the heck would you want to do that? BMP's are no easier to edit than PNG's, and PNG's are better than BMP's in every way. Using BMP's would be like shooting yourself in the foot. Also, when loading an image into memory, they don't work any differently than any other format. The only thing format affects is how the image works BEFORE it's loaded in. Once it's loaded, it's just another image. Different formats won't change the speed of working with them in Java.

  • Error while uploading *.BMP file using SE78

    Hi
    I am trying to upload a BMAP file from presentation server onto the document server using SE78.
    I am facing an error saying
    "This is not a *.BMP file(they begin with <> "BM")"
    Message no. TD874
    I have the necessary company logo in this file and I want to put this in the sapscript.
    Is there some formatting that needs to be done to the bitmap file before importing in SE78.
    Please help!
    Thanks
    Bala

    hi
    Convert BMP from <b>Command prompt using ren command</b>
    then follow below process
    Go to transaction SE78.
    Follow the path given below (on the left windows box) :-
    SAPSCRIPT GRAPHICS --> STORED ON DOCUMENT SERVER --> GRAPHICS --> BMAP
    Enter the name of the graphics file on the right side and Go to the menu GRAPHIC --> IMPORT
    The program is RSTXLDMC, the logo needs to be save in .TIF format.
    Use transaction SE78 to inmport graphics to SAP.
    In the form painter, you can either include directly to the form using menu Edit->Graphic->Create or using the INCLUDE statement in a window.
    To use an INCLUDE stanment, goto into the woindow script editor and use menu Include->Graphic. The include can look like this for a bitmap:
    /: BITMAP MYLOGO OBJECT GRAPHICS ID BMAP TYPE BMON
    regards
    vinod

  • Problem in reading BMP file .....

    I've facing some inconsistency in reading BMP headers. There are two of them, and I've outlined them below....
    Here's a description of the BMP headers, just for refreshing ....
    1.
         typedef struct {
         BITMAPFILEHEADER bmfHeader;
         BITMAPINFOHEADER bmiHeader;
         GLubyte *image_data;
         } BITMAP_IMAGE;
         typedef struct tagBITMAPFILEHEADER {
              WORD bfType;               // 2B
              DWORD bfSize;               // 4B
              WORD bfReserved1;     // 2B
              WORD bfReserved2;     // 2B
              DWORD bfOffBits;          // 4B
         } BITMAPFILEHEADER, *PBITMAPFILEHEADER;
         typedef struct tagBITMAPINFOHEADER{
         DWORD biSize;
         LONG biWidth;
         LONG biHeight;
         WORD biPlanes;
         WORD biBitCount;
         DWORD biCompression;
         DWORD biSizeImage;
         LONG biXPelsPerMeter;
         LONG biYPelsPerMeter;
         DWORD biClrUsed;
         DWORD biClrImportant;
         } BITMAPINFOHEADER, *PBITMAPINFOHEADER;
    2. The file I'm reading test2.bmp has the following parameters
         File Type                     Windows 3.x Bitmap (BMP)
         Width                         4
         Height                         4
         Horizontal Resolution     96
         Vertical Resolution          96
         Bit Depth                    24
         Color Representation     True Color RGB
         Compression                    (uncompressed)
         Size                         102 bytes
         Size on disk               4.00 KB (4,096 bytes)
    3. Output of the program is....
              File Headers are...
              bfType :424d
              bfSize :102
              bfReserved1 :0
              bfReserved2 :0
              bfOffBits :54
              File Info Headers are...
              biSize :40
              biWidth :4
              biHeight :4
              biPlanes :0
              biBitCount :1
              biCompression :1572864
              biSizeImage :48
              biXPelsPerMeter :196
              biYPelsPerMeter :234881220
              biClrUsed :234881024
              biClrImportant :0
    4.      readInt()     4
              Reads four input bytes and returns an int value.
         readUnsignedShort()     2
              Reads two input bytes and returns an int value in the range 0 through 65535.
         readByte()
              Reads one Byte
    5. The bfType fields value should be 'BM' whose Hex is 0x4D42 according to this link
    http://edais.earlsoft.co.uk/Tutorials/Programming/Bitmaps/BMPch1.html
    But the Hex I get is 424d.How come ?
    6. When reading bfSize (see ## ), we should read 4 bytes as per the above structure. But I don't
    get the answer of 102 when I do readInt() (which reads 4B). On the contrary, when I do
    readByte(), thats when I the right file size of 102.
    Why ?
    Rest all the output look ok.
    import java.io.*;
    class BMPReader{
         private byte data[];
         private DataInputStream dis = null;
         public BMPReader(String fileName){
              readFile(fileName);
         private void readFile(String fileName){
              try{
                   dis = new DataInputStream(new FileInputStream(new File(fileName)));
              catch(Exception e){
                   System.out.println(e);
         public void printFileHeader(){
              System.out.println("File Headers are...");
              try{
                   // converting the 2 bytes read to Hex
                   System.out.println("bfType :" + Integer.toString(dis.readUnsignedShort(),16));
                   System.out.println("bfSize :" + dis.readInt());
                   //System.out.println("bfSize :" + dis.readByte());// ## identifier, should read 4B here instead of 1B
                   System.out.println("bfReserved1 :" + dis.readUnsignedShort());     // bfReserved1
                   System.out.println("bfReserved2 :" + dis.readUnsignedShort());     // bfReserved2
                   System.out.println("bfOffBits      :" + dis.readInt());               // bfOffBits
              catch(Exception e){
                   System.out.println(e.toString());
         public void printFileInfoHeader(){
              System.out.println();
              System.out.println("File Info Headers are...");
              try{
                   System.out.println("biSize           :" + dis.readInt());                         //DWORD
                   System.out.println("biWidth      :" + dis.readInt());                     //LONG
                   System.out.println("biHeight      :" + dis.readInt());                     //LONG
                   System.out.println("biPlanes      :" + dis.readUnsignedShort());          //WORD
                   System.out.println("biBitCount      :" + dis.readUnsignedShort());     //WORD
                   System.out.println("biCompression     :" + dis.readInt());               //DWORD
                   System.out.println("biSizeImage      :" + dis.readInt());               //DWORD
                   System.out.println("biXPelsPerMeter :" + dis.readInt());          //LONG
                   System.out.println("biYPelsPerMeter :" + dis.readInt());          //LONG
                   System.out.println("biClrUsed          :" + dis.readInt());                    //DWORD
                   System.out.println("biClrImportant      :" + dis.readInt());               //DWORD
              catch(Exception e){
                   System.out.println(e.toString());
    public class BMPReadForum{
         public static void main(String args[]){
              String fName = "test2.bmp";
              BMPReader bmpReader = new BMPReader(fName);
              bmpReader.printFileHeader();
              bmpReader.printFileInfoHeader();
    }

    I stumbled across this thread while messing with numbers coming out of my palm (via pilot-xfer) that are unsigned 32 bit values read into a 4 element byte array. I would very much like to turn these things into longs. I looked over the above posted code (for which I am most grateful) and made some alterations that seemed prudent, would someone be so kind as to verify that this is doing what I would like it to do?
    private long makeUInt(byte[] b) {
        // Convert a four byte array into an unsigned
        // int value. Created to handle converting
        // binary data in files to DWORDs, or
        // unsigned ints.
        long result = 0;
        int bit;
        int n = 0;    // I assumed this was the power to take the base to - 0 for lsb
        // I further assumed that we need to move backwards through this array,
        // as LSB is in the largest index, is this right?
        for (int a=3; a >= 0; a--) {
            // Similarly, I need to step through this backwards, for the same
            // reason
            for (int i=7; i >= 0; i--) {
                bit = b[a] & 1;
                result += bit * Math.pow(2, n++);
                b[a] >>>= 1;
        return result;
    }So, as you see - I assumed the "n" term was a count for what power of 2 we were in in the bit string, and I further assumed that, since for me the MSB is in the byte array element with the largest index, I needed to work backwards through this thing.
    Does this seem reasonable?
    Thanks a lot
    Lee

  • Loading PNG image file from Applet?

    Hi All,
    My applet running on IE6 and it will often loads 100 PNG image files from a webserver.
    Size of PNG file is about 60Kb so 100*60=6000 Kb ~ 6M.
    In theory, the applet will took 6M of memory to store all 100 files. In practical, it tooks about
    6M* 25 = 150M of memory, that make my applet run in out of memory sometimes.
    I know the reason, may be the brower/applet convert the PNG file format to BMP file format before showing on the screen.
    So the main point here is the applet should not loads all 100 files into the memory,
    it should loads only 10 files at the same time, another 90 files should be cached in memory as PNG file format, not BMP image file format to save the memory usage.
    Is this solution possible in applet field?
    If it is possible how can I implement it?
    And please show me better solution if anys.
    Many Thanks.

    I know the reason, may be the brower/applet convert the PNG file format to
    BMP file format before showing on the screen.This sounds VERY unlikely! Why should the browser do that? And the applet does what you have coded I hope!
    Your problem is probably somewhere else. And it has nothing to do with applets I presume. Use a heap analyzer tool to find out what hogs the memory. A thorough code review can't hurt either. If you still thinks it is the images though, then just don't load them all at once then.

  • .bmp files

    Hello, I am currently starting on a project that requires me to modify the binary structure of bitmap files. I will be using Java to create a program that will need to be able to open bitmap files that have had their binary data corrupted in some known way, modify the binary data to repair the bmp files, and save a new, fixed, bmp file that can be viewed.
    I have researched the bmp file format a little bit. This website seems to be a good reference: http://local.wasp.uwa.edu.au/~pbourke/dataformats/bmp/
    My question is, how would I open and save a bmp in its binary form in Java? Whenever I've worked with image files, I've just used Java's built-in imageio library to open and save them.
    For example, the aforementioned website describes the file header being structured like this:
    typedef struct {
       unsigned short int type;                 /* Magic identifier            */
       unsigned int size;                       /* File size in bytes          */
       unsigned short int reserved1, reserved2;
       unsigned int offset;                     /* Offset to image data, bytes */
    } HEADER;(That's some C code from the website that defines the structure of the header)
    How would I go about getting that data in Java, and then continuing on to get the data from the "info header" and finally the pixel data?
    Edited by: etgohomeok on Mar 27, 2009 1:35 PM
    Edited by: etgohomeok on Mar 27, 2009 1:38 PM

    There are actually [4 or 5 versions of bmp|http://www.fileformat.info/format/bmp/egff.htm]. The default bmp image reader
    ImageIO.read(/*someImageFile.bmp*/);can read up to and including version 3 (and can maybe read version 4). The code above is how you would normally read a bmp file, but you stated this
    >bitmap files that have had their binary data corrupted in some known way
    If the actual file is corrupted then you probably won't be able to read it with the default bmp image reader. So you may have to write your own bmp image reader which takes into account the corruption.
    This link goes through the process of creating a simple ImageReader/ImageWriter/SPI Service for a hypothetical format called "MyFormat." Give it a read and use the [first link|http://www.fileformat.info/format/bmp/egff.htm] as a guide to decoding the bytes.

  • How to open a bmp file

    I Want to display a bmp file and use an image icon to display it, how do I do this?
    tnx

    Hi
    I am giving you the source code to display BMP file in Java
    SOURCE CODE =======>>
    public Image loadBitmap (byte[] bmpImage)
    Image image = null;
    try
    ByteArrayInputStream fs=new ByteArrayInputStream(bmpImage);
    int bflen=14; // 14 byte BITMAPFILEHEADER
    byte bf[]=new byte[bflen];
    fs.read(bf,0,bflen);
    int bilen=40; // 40-byte BITMAPINFOHEADER
    byte bi[]=new byte[bilen];
    fs.read(bi,0,bilen);
    // Interpret data.
    int nsize = (((int)bf[5]&0xff)<<24) | (((int)bf[4]&0xff)<<16) | (((int)bf[3]&0xff)<<8)| (int)bf[2]&0xff;
    int nbisize = (((int)bi[3]&0xff)<<24)| (((int)bi[2]&0xff)<<16) | (((int)bi[1]&0xff)<<8)| (int)bi[0]&0xff;
    int nwidth = (((int)bi[7]&0xff) << 24) | (((int)bi[6]&0xff)<<16) | (((int)bi[5]&0xff)<<8)| (int)bi[4]&0xff;
    int nheight = (((int)bi[11]&0xff) << 24)| (((int)bi[10]&0xff)<<16)| (((int)bi[9]&0xff)<<8)| (int)bi[8]&0xff;
    int nplanes = (((int)bi[13]&0xff)<<8)|(int)bi[12]&0xff;
    int nbitcount = (((int)bi[15]&0xff)<<8)|(int)bi[14]&0xff;
    // Look for non-zero values to indicate compression
    int ncompression = (((int)bi[19])<<24)|
    (((int)bi[18])<<16)| (((int)bi[17])<<8)|(int)bi[16];
    int nsizeimage = (((int)bi[23]&0xff)<<24)|
    (((int)bi[22]&0xff)<<16)| (((int)bi[21]&0xff)<<8)|
    (int)bi[20]&0xff;
    int nxpm = (((int)bi[27]&0xff)<<24)|
    (((int)bi[26]&0xff)<<16)| (((int)bi[25]&0xff)<<8)|
    (int)bi[24]&0xff;
    int nypm = (((int)bi[31]&0xff)<<24)| (((int)bi[30]&0xff)<<16)| (((int)bi[29]&0xff)<<8)| (int)bi[28]&0xff;
    int nclrused = (((int)bi[35]&0xff)<<24)|(((int)bi[34]&0xff)<<16)| (((int)bi[33]&0xff)<<8)| (int)bi[32]&0xff;
    int nclrimp = (((int)bi[39]&0xff)<<24)| (((int)bi[38]&0xff)<<16)| (((int)bi[37]&0xff)<<8)| (int)bi[36]&0xff;
    Toolkit tk = Toolkit.getDefaultToolkit();
    if (nbitcount==24)
    * No Palette data for 24-bit format butscan lines are
    * padded out to even 4-byte boundaries.
    int npad = (nsizeimage / nheight) - nwidth * 3;
    if (npad == 4)
    npad = 0;
    int ndata[] = new int [nheight * nwidth];
    byte brgb[] = new byte [( nwidth + npad)* 3 * nheight];
    fs.read (brgb, 0, (nwidth + npad) * 3 *nheight);
    int nindex = 0;
    for (int j = 0; j < nheight; j++)
    for (int i = 0; i < nwidth; i++)
    ndata [nwidth * (nheight- j - 1) + i] = (255&0xff)<<24 | (((int)brgb[nindex+2]&0xff)<<16)|(((int)brgb[nindex+1]&0xff)<<8) | (int)brgb[nindex]&0xff;
    nindex += 3;
    nindex += npad;
    image = tk.createImage( new MemoryImageSource (nwidth, nheight, ndata, 0, nwidth));
    else if (nbitcount == 8)
    * Have to determine the number ofcolors, the clrsused
    * parameter is dominant if it is greaterthan zero. If
    * zero, calculate colors based onbitsperpixel.
    int nNumColors = 0;
    if (nclrused > 0)
    nNumColors = nclrused;
    else
    nNumColors = (1&0xff)<<nbitcount;
    // Some bitmaps do not have the sizeimagefield calculated// Ferret out these cases and fix 'em.
    if (nsizeimage == 0)
    nsizeimage =((((nwidth*nbitcount)+31) & ~31 ) >> 3);
    nsizeimage *= nheight;
    int tempSize = ((((nwidth*nbitcount)+31)& ~31 ) >> 3);
    tempSize *= nheight;
    // Read the palatte colors.
    int npalette[] = new int [nNumColors];
    byte bpalette[] = new byte[nNumColors*4];
    fs.read (bpalette, 0, nNumColors*4);
    int nindex8 = 0;
    for (int n = 0; n < nNumColors; n++)
    npalette[n] = (255&0xff)<<24|(((int)bpalette[nindex8+2]&0xff)<<16)|(((int)bpalette[nindex8+1]&0xff)<<8)|(int)bpalette[nindex8]&0xff;
    nindex8 += 4;
    * Read the image data (actually indices into the palette)//
    * Scan lines are still padded out to even 4-byte// boundaries.
    int npad8 = (nsizeimage / nheight) -nwidth;
    int ndata8[] = new int [nwidth*nheight];
    byte bdata[] = new byte[(nwidth+npad8)*nheight];
    fs.read (bdata, 0,(nwidth+npad8)*nheight);
    nindex8 = 0;
    for (int j8 = 0; j8 < nheight; j8++)
    for (int i8 = 0; i8 < nwidth;i8++)
    ndata8[nwidth*(nheight-j8-1)+i8] = npalette[((int)bdata[nindex8]&0xff)];
    nindex8++;
    nindex8 += npad8;
    image = tk.createImage( new MemoryImageSource (nwidth, nheight, ndata8, 0, nwidth));
    //support for 4Bpp bmps...
    else if (nbitcount == 4)
    int nNumColors = 0;
    if (nclrused > 0)
    nNumColors = nclrused;
    else
    nNumColors = (1&0xff)<<nbitcount;
    * Some bitmaps do not have the sizeimagefield calculated//
    * Ferret out these cases and fix 'em.
    if (nsizeimage == 0)
    nsizeimage =((((nwidth*nbitcount)+31) & ~31 ) >> 3);
    nsizeimage *= nheight;
    * Read the color table. BMP's always have the complete color
    * table when the number of colors used = 0
    int npalette[] = new int [nNumColors];
    byte bpalette[] = new byte[nNumColors*4];
    fs.read (bpalette, 0, nNumColors*4);
    int nindex8 = 0;
    for (int n = 0; n < nNumColors; n++)
    npalette[n] = (255&0xff)<<24|(((int)bpalette[nindex8+2]&0xff)<<16)|(((int)bpalette[nindex8+1]&0xff)<<8)|(int)bpalette[nindex8]&0xff;
    nindex8 += 4;
    * Read the image data (actually indicesinto the palette)//
    * Scan lines are still padded out toeven 4-byte// boundaries.
    int half = nwidth/2;
    if (nwidth%2 != 0)
    half++;
    int npad4 = (nsizeimage / nheight) -half;
    int tempSize = ((((nwidth*nbitcount)+31)& ~31 ) >> 3);
    tempSize *= nheight;
    int ndata4[] = new int [2*half*nheight];
    byte bdata[] = new byte [(half +npad4)*nheight];
    fs.read (bdata, 0, (half +npad4)*nheight);
    int nindex4 = 0;
    for (int j4 = 0; j4 < nheight; j4++)
    for (int i4 = 0; i4 < half; i4++)
    int i1 =nwidth*(nheight-j4-1)+(2*i4) ;
    ndata4 [i1] = npalette[((int)bdata[nindex4]&0xf0)>>4];
    ndata4 [i1+1] = npalette[((int)bdata[nindex4]&0xf)];
    nindex4++;
    nindex4 += npad4;
    image = tk.createImage( new MemoryImageSource (nwidth, nheight, ndata4, 0, nwidth));
    //support for monochrome...
    else if (nbitcount == 1)
    int nNumColors = 0;
    if (nclrused > 0)
    nNumColors = nclrused;
    else
    nNumColors = (1&0xff)<<nbitcount;
    * Some bitmaps do not have the sizeimagefield calculated
    * Ferret out these cases and fix 'em.
    if (nsizeimage == 0)
    nsizeimage =((((nwidth*nbitcount)+31) & ~31 ) >> 3);
    nsizeimage *= nheight;
    * Read the color table...
    * BMP's always have the complete color table when the number
    * of colors used = 0
    int npalette[] = new int [nNumColors];
    byte bpalette[] = new byte[nNumColors*4];
    fs.read (bpalette, 0, nNumColors*4);
    int nindex1 = 0;
    for (int n = 0; n < nNumColors; n++)
    npalette[n] = (255&0xff)<<24|(((int)bpalette[nindex1+2]&0xff)<<16)|(((int)bpalette[nindex1+1]&0xff)<<8)|(int)bpalette[nindex1]&0xff;
    nindex1 += 4;
    * Read the image data (actually indicesinto the palette)
    * Scan lines are still padded out to even 4-byte// boundaries.
    int limit = nwidth/8;
    int npad1 = (nsizeimage / nheight) -limit;
    if (nwidth%8 != 0)
    int tempSize = ((((nwidth*nbitcount)+31)& ~31 ) >> 3);
    tempSize *= nheight;
    int ndata1[] = new int[(nwidth*nheight)];
    byte bdata[] = new byte [(limit +npad1)*nheight];
    fs.read (bdata, 0, (limit +npad1)*nheight);
    nindex1 = 0;
    for (int j1 = 0; j1 < nheight; j1++)
    for (int i1 = 0; i1 < limit;i1++)
    int id1 =nwidth*(nheight-j1-1)+(8*i1);
    * here each bit of thearray should be converted to a
    * byte - 0 or 1
    ndata1 [id1] = npalette[(int)((bdata[nindex1]&0x80)>>7)];
    ndata1 [id1+1] = npalette[(int)((bdata[nindex1]&0x40)>>6)];
    ndata1 [id1+2] = npalette[(int)((bdata[nindex1]&0x20)>>5)];
    ndata1 [id1+3] = npalette[(int)((bdata[nindex1]&0x10)>>4)];
    ndata1 [id1+4] = npalette[(int)((bdata[nindex1]&0x8)>>3)];
    ndata1 [id1+5] = npalette[(int)((bdata[nindex1]&0x4)>>2)];
    ndata1 [id1+6] = npalette[(int)((bdata[nindex1]&0x2)>>1)];
    ndata1 [id1+7] =npalette [(int)(bdata[nindex1]&0x1)];
    nindex1++;
    nindex1 += npad1;
    image = tk.createImage( new MemoryImageSource (nwidth, nheight, ndata1, 0, nwidth));
    else
    image = (Image)null;
    fs.close();
    return image;
    catch (Exception e)
    e.printStackTrace();
    return (Image) null;
    Deepak
    [email protected]

  • Tranferring Display Data on an Agilent DSO6014L to a .BMP file

    Hello,
    I'm able to read the DSO6014L Scope Display Data into a .bmp file, but I can't open it. Windows say the file must be corrupted, or to large. My file is the the same size as the .bmp file that's saved to my memory stick on the scope. There's something different, but I not sure what it could be. Any ideas. Thanks.
    Test Engineering
    Empower RF Systems Inc.
    Attachments:
    SCOPE Dump Plot 2 File.vi ‏20 KB

    Mal,
    It looks like you are using the Write to Binary File VI, don't you want to use Write to Bitmap?
    Ian K.
    Applications Engineer
    National Instruments

  • Emailing .BMP Files

    'Some' .BMP files that are emailed to me simply show up as an icon at the end of the message with 'filename.bmp' posted below it.
    I thought that maybe it wasn't downloaded so I would refresh the email or click on it to try to get it to download but it doesn't change anything. I can't get it to display from the email. It doesn't seem to be a size issue.
    Going into the mail from my computer I can detach the picture and transfer it over to the iPhone through sync and view it without a problem. Any ideas on what we are doing wrong?

    You were right again.
    Seems this also helped answer my earlier incompatibility issue too. Looks like the iTunes software converts all pictures to .JPG when you load them onto your iPhone. Pictures that I have in my sync folder have been converted to .JPG when I select them to mail out to someone else. It's also quite picky about the exact format of the .JPG incoming from outside sources.
    When I use an external email source to email myself a .BMP it does not display the picture, just an icon with the filename displayed below it.

  • Client can't open my BMP files

    Howdy,
    I've been using my current system to create software interface graphics (buttons, icons, etc. ) but recently my clients who are all on Windows are not able to open my BMP files. They can open PSD and PNG and JPG files, to problem. I need the BMPs because of the alpha channel.
    Now, don't laugh, this "old, basic" system has served me well for many years and I'm in no mood or financial situation to upgrade, so I'm hoping that the problem is not related to the age of the system. I'm running:
    CS1 (Photoshop 8.0, MIcrosoft Bitmap File Format 8.0) on a G5 iMac with system 10.4.11
    Thanks for any suggestions you might have.

    I imagine that that error code 14 was accompanied by some verbiage. It is often the case that said verbiage actually points you in the right direction as to what the problem is. The error code alone is only going to be meaningful to people who have run into it. I don't think there's a place to go where the error codes are explained -- although there might be.
    Ask your client what the complete message was.
    Also, have her hold down Command and choose About InDesign from the InDesign menu. She should see something like:
    Adobe InDesign Version CS3(5.0.3.662)
    immediately under Application Info. Compare what she has with what yours says.
    Dave

  • How can create color table for "write bmp file.vi"?

    i want to create a color table for a 8 bit bitmap.The color table is the input of "write bmp file.vi". how can i make it?
    thanks!

    > i want to create a color table for a 8 bit bitmap.The color table is
    > the input of "write bmp file.vi". how can i make it?
    > thanks!
    >
    There is a color control on the front panel numerics palette. A color
    in LV is a four byte xRGB formatted number. So you can make an array of
    the color numerics and set them by hand or format the numbers however
    you like. If unwired it will use the LV color palette which is pretty
    much the HTML palette.
    Greg McKaskle

Maybe you are looking for