Read Binary(raw Image) data from a file

Hi
PLEASE HELP, I want to Read Binary(Raw Image)data (16 bit integer) from a file and display on the JPanel or JFrame.

Hi, you'll need to use MemoryImageSource.
You read each RGB triple and add it to a pixel[].
Heres the roughg idea.
Hope that helps.
Harley.
int width,height;
int[] pixels = new int[width*height];
while(!fileDone)
for(int i=0; i<(width*height) i++){
int rgb = inputStream.readInt();
pixels[i] = rgb;
DirectColorModel colorModel = new DirectColorModel(16,0xff00,0x00ff,0x00ff);
MemoryImageSource memImage = new MemoryImageSource(width,height,pixels,0,width));

Similar Messages

  • Help! Read raw Image data from a file and display on the JPanel or JFrame.

    PLEASE HELP, I want to Read Binary(Raw Image)data (16 bit integer) from a file and display on the JPanel or JFrame.

    Hey,
    I need to do the same thing. Did you find a way to do that?
    Could you sent me the code?
    It's urgent, please.
    My e-mail is [email protected]

  • How to read and write a data from extrenal file

    Hi..
    How to read and write a data from extrenal file using Pl/sql?
    Is it possible from Dyanamic Sql or any other way?
    Reagards
    Raju

    utl_file
    Re: How to Create text(dat) file.
    Message was edited by:
    jeneesh

  • AE not reading all the XMP data from DNG files

    I'm working on a very large time-lapse for a construction company - I have a sunset that is broken between two folders and rendering the folders seperately makes Quicktime unhappy during playback and I get an ugly jump in sunset exposure.
    So I combined the two folders in Lightroom (LR) from my RAW files (NEF) and exported the entire sequence as DNG files with simpler numbering. The sequence is about 1560 files and constitutes about 22 GB of data. I created a new LR library from the DNG sequence to make sure it all looked good and it does.
    I imported the same DNG sequence into AE, checked a few frames in the preview and sent it out to render. Two thirds of the way through the QT movie, exported in H.264 at 30 fps, I start seeing problems. Huge sections look like the XMP data has not been read, then there's a good section and then bad again. I matched the movie time to preview in AE and indeed saw the same problems in the AE preview. So the problem begain in AE's reading the files from the folder, not in rendering.
    I went back to LR for file comparison. There was no problem in LR. All the DNGs look great.
    I'm on a MacBookPro Retina with 2.8 GHz Intel processor, 16GB 1600 MHz DDR3 Ram and NVIDIA GeForce GT 650M 1024 MB graphics
    I have the standard 69GB cache on an external drive and have 11GB RAM available for AE.
    Installed CPUs =8
    CPUs reserved for other apps = 2
    RAM allocation per background CPU = 1GB
    Actual CPUs that will be used = 6
    I have the latest AE from the Adobe Cloud, although I haven't done the most recent update yet.
    My thought was to break the folder up into smaller segments for rendering, but that's not the problem. I see the XMP hasn't been consistantly read in preview. To me it doesn't make sense that the folder is too large for preview because it's not even rendering it there, just reading the files...?
    Any insight, solutions?
    Thanks,
    Dennis

    Moominman wrote:
    I am basically trying to export xmp files from a set of low resolution dng files so that I can access my Lightroom edits in the RAW files. I have separated the RAW and dng files in different folders
    Hi Andy,
    I dunno how best to get extracted xmp files into the raw folders, but if you are comfortable with exiftool, you can use it to extract xmp sidecars from DNG files.
    If you want a turn-key solution which does not required you to futz with exiftool, then consider a free plugin I wrote:
    robcole.com - xEmP
    It will allow you to create xmp sidecars with all your DNG adjustments and metadata (which can then be applied to the non-dng raw files).
    However, if you won't need the DNGs in your catalog afterward, then the easiest way is to convert them back to proprietary raw format using this plugin (also free, and I wrote it):
    robcole.com - UnDNG
    Conceptually, you can think of it as converting the DNGs to proprietary raw format, but note: it doesn't convert anything, it just allows existing raw files that are NOT in the catalog, to replace the DNGs that are in the catalog. All adjustments and metadata and everything else will be preserved (just like when you convert a proprietary raw to DNG format).
    Rob

  • Read and average n data from text file

    I acquire numeric data from the oscilloscope [reading a waveform] that is stored in one column in a text file.
    I need to read in selectable amount of data points to average/plot them.
    So basically I wanna have a text file with millions of data points but I wanna plot say only every 1000. data point. I have tried many things I found here on the forum but as I am new to LabView, none of them really worked.
    Does anybody have a suggestion.
    Thanks.
    Solved!
    Go to Solution.

    Hi,
    among others I have tried to build the VI below but somehow I cannot get to the desired solution because according to the indicators it always stops after the first loop.
    Can you have a look please?
    Thanks.
    Attachments:
    read_and_average.vi ‏13 KB

  • How to extract data from .xltm file in a (dataset, datatable or a list) using wpf c#

    Hi all,
    As we can get data from .xls, .xlsx file in a dataset. Now i want to read all the entire data from .xltm file.
    I also want to get all sheets name from .xltm file. I am using .Net framework 4.5, Visual studio 2012.
    Please help me. I am unable to extract it. It is urgent.

    Hello Kalpna Bindal,
    I just investigate this issue and use the following way but it does work:
    private void Button_Click(object sender, RoutedEventArgs e)
    // initialize connection
    OleDbConnection con = new OleDbConnection();
    con.ConnectionString =
    "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\\Fruits1.xltm;Extended Properties=\"Excel 12.0 Xml;HDR=YES;\"";
    //pass query to Insert values into Excel
    OleDbCommand cmd = new OleDbCommand();
    cmd.CommandText = "insert into [Sheet1$] values('')";
    cmd.Connection = con;
    // EXECUTE QUERY
    con.Open();
    cmd.ExecuteNonQuery();
    con.Close();
    I then did a research about this issue and find the following case:
    http://stackoverflow.com/questions/22225017/reading-excel-xltm-files-programmatically
    To test whether it is possible I use the following code in WPF:
    Microsoft.Office.Interop.Excel.Application xltmApp = new Microsoft.Office.Interop.Excel.Application();
    xltmApp.Visible = false;
    xltmApp.ScreenUpdating = false;
    Workbook xltmBook = xltmApp.Workbooks.Open(@"D:\Fruits1.xltm");
    Worksheet xlworksheet = xltmBook.Worksheets.get_Item(1);
    for (int i = 1; i <= 1; i++)
    for(int j=1;j<=1;j++)
    string str = (string)(xlworksheet.UsedRange.Cells[i, j] as Microsoft.Office.Interop.Excel.Range).Value;
    MessageBox.Show(str);
    The result is that I can read this .xltm file and read the firstline without problem.
    I would think you can also use this way to work with your .xltm file and output it to your application.
    For more details about how to fill to your WPF, common wpf and excel thread will be helpful:
    http://www.codearsenal.net/2012/06/c-sharp-read-excel-and-show-in-wpf.html#.URPyfPJJocU
    http://www.dotnetcurry.com/showarticle.aspx?ID=988
    http://mozouna.com/Blog/2013/03/28/wpf-reading-and-writing-to-excel-file-with-c/
    By the way, for WPF case please post on WPF forum instead of C# forum.Best regards,
    Barry
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Read the raw image file

    I want to read the raw image file , i have the basic labview 8.0 version

    That is a broad question... I'll make some asumptions.
    I think you have a file with some raw image format. This can be quite a few formats. Every camera firm has it's own proprietry format. Often, when talking about a raw image, it is simply a 2d array of colors. So you'll have a file with numbers that are U8's that represent R G B, alpha R G B, B G R, etc., or a U32 that represent the same, combined in one U32...
    The data can be stored binary or ASCII. Both formats are handled differently.
    The ASCII format can be one large array of data, or seperated with enters for each scan line.
    In both cases, you might need to remove information, like height and width, from the data before parsing the image data.
    You can use the "Spreadsheet String To Array" to convert the a ASCII string to a LabVIEW 1D or 2D array. Or use "Read From Spreadsheet File.vi" to read the file directly as an array. Use Reshape Array to convert a 1D array to a 2D array.
    The binary file is a bit different. Use "Read Binary File". It will get you a string. This string is a converted array of U8, the string doesn't need to be ASCII. convert this string to an array of U8's, with "String To Byte Array". Convert the 1D array just like before.
    Now you have a 2D array. You can convert it into a pixmap with "Flatten Pixmap.vi". You can then display it in a picture control with "Draw Flattened Pixmap.vi".
    Regards,
    Wiebe.

  • Kinect Explorer WPF C# read depth data from the file and conversion to skeleton

    Hello,
    I am using Kinect sensor to do some research on biometrics. Since it is impossible to find people to collect some samples, I would like to use samples from the TUM - GAID database, where there exist Color View and Depth View (in .raw format) samples. Therefore,
    I need to read these samples from the file and do a batch processing, instead of performing real-time collecting of samples (where I can take automatically the Skeleton view using the Kinect SDK). So, I need help on
    1. Reading the data from the file (instead of activating the Kinect sensor) and give this data as an input for conversion to a skeleton
    2. Read the .raw files 
    Thank you very much
    Kind regards

    Hiya,
     I doubt this forum, C Sharp, will provide much help. You are asking about the Kinects system not C#
    language. However, you can try this link; http://kinectforwindows.codeplex.com/
    Hope this help. Thanks :)

  • Dynamic Internal Table for reading data from external file

    Hello All,
    The task was to create a internal table with dynamic columns,
    Actually this is my first task in the WebAS 6.20, my program is based on input file provided by user with certain effort. this file can have different effort for a one yr to five year frame..
    I needed to read the raw data from file, based on months create a internal table to hold the data, after this i need to validate the data...
    I have browsed thru dynamic internal table topic, but couldn't find any dynamic appending structure, the dynamic structure would contains 12 month fileds.
    can any one help me in getting my task completed..
    Thanks
    Kumar

    Hi,
    I see that you posted the same question a couple of days ago at Dynamic Internal Table for reading data from external file Didn't Charles's response address your problem?
    Regards

  • Read data from xml files and  populate internal table

    Hi.
    How to read data from xml files into internal tables?
    Can u tell me the classes and methods to read xml data..
    Can u  explain it with a sample program...

    <pre>DATA itab_accontextdir TYPE TABLE OF ACCONTEXTDIR.
    DATA struct_accontextdir LIKE LINE OF itab_accontextdir.
    DATA l_o_error TYPE REF TO cx_root.
    DATA: filename type string ,
                 xmldata type xstring .
    DATA: mr      TYPE REF TO if_mr_api.
    mr = cl_mime_repository_api=>get_api( ).
    mr->get( EXPORTING  i_url     = 'SAP/PUBLIC/BC/xml_files_accontext/xml_accontextdir.xml'
                  IMPORTING  e_content = xmldata ).
    WRITE xmldata.
    TRY.
    CALL TRANSFORMATION id
          SOURCE XML xmldata
          RESULT shiva = itab_accontextdir.
      CATCH cx_root INTO l_o_error.
    ENDTRY.
    LOOP AT itab_accontextdir INTO struct_accontextdir.
        WRITE: / struct_accontextdir-context_id,
               struct_accontextdir-context_name,
               struct_accontextdir-context_type.
        NEW-LINE.
        ENDLOOP.</pre>
    <br/>
    Description:   
    In the above code snippet I am storing the data in an xml file(you know xml is used to store and transport data ) called 'xml_accontextdir.xml' that is uploaded into the MIME repository at path 'SAP/PUBLIC/BC/xml_files_accontext/xml_accontextdir.xml'.
    The below API is used to read a file in MIME repo and convert it into a string that is stored in ' xmldata'. (This is just a raw data that is got by appending the each line of  xml file).
    mr = cl_mime_repository_api=>get_api( ).
    mr->get( EXPORTING  i_url     = 'SAP/PUBLIC/BC/xml_files_accontext/xml_accontextdir.xml'
                  IMPORTING  e_content = xmldata ).
        Once the 'xmldata' string is available we use the tranformation to parse the xml string that we have got from the above API and convert it into the internal table.
    <pre>TRY.
    CALL TRANSFORMATION id
          SOURCE XML xmldata
          RESULT shiva = itab_accontextdir.
      CATCH cx_root INTO l_o_error.
    ENDTRY.</pre>
    Here the trasnsformation 'id ' is used to conververt the source xml 'xmldata' to resulting internal table itab_accontextdir, that have same structure as our xml file 'xml_accontextdir.xml'.  In the RESULT root of the xml file has to be specified. (In my the root is 'shiva'). 
    Things to be taken care:
    One of the major problem that occurs when reading the xml file is 'format not compatible with the internal table' that you are reading into internal table.  Iin order to get rid of this issue use one more tranformation to convert the data from the internal table into the xml file.    
    <pre>TRY.
          CALL TRANSFORMATION id
            SOURCE shiv = t_internal_tab
            RESULT XML xml.
        CATCH cx_root INTO l_o_error.
      ENDTRY.
      WRITE xml.
      NEW-LINE.</pre>
    <br/>
    This is the same transformation that we used above but the differnce is that the SOURCE and RESULT parameters are changed the source is now the internal table and result is *xml *string. Use xml browser that is available with the ABAP workbench to read the xml string displayed with proper indentation. In this way we get the format of xml file to be used that is compatable with the given internal table. 
    Thank you, Hope this will help you!!!
    Edited by: Shiva Prasad L on Jun 15, 2009 7:30 AM
    Edited by: Shiva Prasad L on Jun 15, 2009 11:56 AM
    Edited by: Shiva Prasad L on Jun 15, 2009 12:06 PM

  • Read and write excel sheet data from uploded file in sharepoint site programmatically 2013

    hi team,
    I am working on sharepoint 2013.I want to read and write data in excel sheet (micrsoft excel) from stored file in shrepoint docoumnt library .please suggest me
    vijay

    Hi
    Vijay,
    check those links
    http://www.sharepointwithattitude.com/archives/61
    https://social.technet.microsoft.com/Forums/en-US/e760051b-a92f-473c-9ec9-0f0c36c99e40/read-and-write-excel-sheet-data-from-uploded-file-in-sharepoint-site-programmatically-2013?forum=sharepointdevelopment
    Kind Regards, John Naguib Technical Consultant/Architect MCITP, MCPD, MCTS, MCT, TOGAF 9 Foundation. Please remember to mark the reply as answer if it helps.

  • How to read the data from Excel file and Store in XML file using java

    Hi All,
    I got a problem with Excel file.
    My problem is how to read the data from Excel file and Store in XML file using java excel api.
    For getting the data from Excel file what are all the steps i need to follow to get the correct result.
    Any body can send me the code (with java code ,Excel sheet) to this mail id : [email protected]
    Thanks & Regards,
    Sreenu,
    [email protected],
    india,

    If you want someone to do your work, please have the courtesy to provide payment.
    http://www.rentacoder.com

  • Regarding reading the data from the files without using Stremas

    hai to all of u...
    here i have a problem where i have to read the data from the files without using any streams.
    please guide me how to do this one,if possible by giving with an example
    Thanks & Regard
    M.Ramakrishna

    Simply put, you can't.
    By why do you need to?

  • Reading in data from a file

    Hi,
    I am tring to read data from a file into my Web Service program. Its a plain text file with item descriptions and price info etc. At the moment I'm trying BufferedReader in = new BufferedReader(...) but I keep getting an exception with Tomcat not being able to locate my file.
    Should there be a specific location for files such as this? Or do I need to add a path to a properties or build file? I have tried many different system locations.
    I've tried to follow the Sun coffee bean example, but I have found it very complex and would appreciate a clear simple answer.
    This is driving me crazy and any help would be much appreciated.
    //Daniel.

    public static void main(String argv[]) {
         try {
              String filename="absolute path to some file";
              BufferedReader in = new BufferedReader(
    (Reader)new FileReader(filename)
              String line;
              while ((line=in.readLine()) != null)
    System.out.println(line);
         catch (Exception e) {
              System.out.println(e.toString());

  • Reading Unicode data from a file...

    I am writing an application that needs to read some configuration data from a file. An end user edits the configuration file to provide the configuration data. The Java code reads this file and uses the configuration data supplied by the user.
    The user can also save non-ascii characters as part of the configuration data. hence, I do not want to use java properties files. What are the other options available that allow me reading Unicode data into my Java code and will also allow user to save the configuration file as Unicode?

    Java characters are Unicode characters. Read file data that consists of Unicode characters as Java characters or strings.
    You can read the data as primitive char values using the DataInputStream class. The InputStreamReader class can also read Unicode (UTF-16) data.
    Data can be written using the OutputStreamWriter class.

Maybe you are looking for

  • Writing thumbnail to blob column

    hi i am taking bufferedinputstream as parameter and create thumbnail frm it and stored in blob column but when i retrive that blob column i get blank (black) image as thumbnail plz help me out i have given code here. public int addThumbnailDtl(Buffer

  • HDMI Video corruption under Mountain Lion

    I have a mid 2011 15 inch Macbook pro.  Upgraded to Mountain Lion.  I use an HDMI TV connection as an external monitor with the laptop closed.  I switch to another work PC on the TV using the source selection.  This causes the Mac to Sleep because no

  • IC Webclient Integration with MS Exchange

    Hi Can someone please help me with configuration/customization documents on crm IC Webclient Integration with MS Exchange. Please email me at [email protected] Thanks Abhijit

  • Why is the search on my mail app not working?

    I just bought the new iPod touch 5th generation. I synced it with my iTunes, transferring all the apps I had on my old 3rd generation iPod touch. Everything works fine, except the search on my mail app. When I type in some keyword to search, and clic

  • F110 remittance print requires street2 and street3

    We have a requirement to print street2 and street3 from our vendor/customer masters in the printed remittance we use the standard payment print programs RFFONL_I and RFFOD_U, but have our own version of the international remittance Z110_IN_AVIS is th