Need Help Converting ESRI .asc Ascii Raster Grid Data to BitMap to draw in program
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Need Help Converting ESRI .asc Ascii Raster Grid Data to BitMap to draw in program

Hybrid View

  1. #1
    Join Date
    Jan 2012
    Location
    .NET 4.0 VS2010
    Posts
    6

    Exclamation Need Help Converting ESRI .asc Ascii Raster Grid Data to BitMap to draw in program

    I have as part of an assignment a task to open and manipulate raster datasets stored in an ascii string format. The main of the task is complete with the processing part working fine, however I want to implement a method that takes this string data and converts it into bitmap data.

    My experience using image data formats in programming is fairly minimal however I see this task as something I can use to start learning as I will at some point.

    Ok so some information about the program as it is...

    Clicking open simply takes the .asc similar ascii filename and passes it to a newly created object Grid, a class I have written for this program.

    The constructor takes this file and uses a streamreader to line by line read through the data splitting it down and storing it in a 2 dimensional array 'values[,]'. Each grid is processed seperatly as requested and not stored as a data member as part of a list or such. Just simply as the variable 'g1'.

    I want to add a button to the form that takes the data stored in the current instance of g1.values[,] and stores it as a bitmap file. I have already implemented an LinearScale8Bit method that takes the data and converts it to use values between 0 and 255 respective to their initial values.

    Some of the methods may be sloppy, as they are part of a practical set by my tutor, or they may be the simplest, I am not an expert and cannot give any recommendations on those.

    The methods I have written from scratch are:
    GridGlobalPearsonCorrelation
    GridNormalisedDifferenceVegetation
    GridWindowMean
    LinearScale8Bit

    The other methods will have heavy influence from my programming style however as I said, the basic algorithm was supplied by my tutor.

    Hopefully while looking at the code you understand my problem and the aim of the program a bit better, here are some links that could prove useful.

    Input File Example:
    http://codepaste.net/e5kupi

    Grid Class:
    http://codepaste.net/zu9jce

    Any help is greatly appreciated.

    Cheers
    earlbob91

  2. #2
    Join Date
    Jan 2012
    Location
    .NET 4.0 VS2010
    Posts
    6

    Re: Need Help Converting ESRI .asc Ascii Raster Grid Data to BitMap to draw in progra

    Basically, how do I convert a Multi-Dimensional Array or type double to an Image of type BitMap.

    Also can I not edit the title? A better one would be Need help converting multi-dimensional array to image. Or similar, if anyone has the ability to do so its fine with me if you change it to something similar and suitable.

    Cheers
    Ryan

  3. #3
    Join Date
    Jan 2012
    Location
    .NET 4.0 VS2010
    Posts
    6

    Re: Need Help Converting ESRI .asc Ascii Raster Grid Data to BitMap to draw in progra

    of type double*

    again I cannot edit....or do not know how to, but I see no edit link anywhere

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center