--- Start of Idrisi List message
--- Fred H <[EMAIL PROTECTED]> wrote:
> From Fred H Tue Aug 28 16:43:59 2001
> Received: from [142.22.16.53] by
> web12703.mail.yahoo.com via HTTP; Tue, 28 Aug 2001
> 16:44:00 PDT
> Date: Tue, 28 Aug 2001 16:43:59 -0700 (PDT)
> From: Fred H <[EMAIL PROTECTED]>
> Subject: Re: Idrisi-L : reading .img file with my
> own code
> To: Wei Luo <[EMAIL PROTECTED]>
> In-Reply-To:
>
<[EMAIL PROTECTED]>
> MIME-Version: 1.0
> Content-Type: text/plain; charset=us-ascii
> Content-Length: 2869
>
>
> --- Wei Luo <[EMAIL PROTECTED]> wrote:
> > --- Start of Idrisi List message
> > Hi all,
> >
> > I have a question regarding reading IDRISI .img
> > files. I want to read .img
> > files with my own code--I am using Visual Basic.
>
> Object pascal (Delphi) or C are much better for this
> type of work. Their code is much faster to execute
> than VB. BTW, that's one of the reasons why Clark
> Labs
> dumped VB in favour of Delphi. The latest versions
> of
> Idrisi are written in Delphi.
>
> > I tried to open my .img
> > file with Notepad, but it's not illegible at all.
>
> Of course not, it probably was in binary or packed
> binary format.
>
> > How can I convert .img
> > file into an ASCII format that is easily readible
> > with by own code?
>
> Why convert to ascii? Not only will the file sizes
> grow astronomically, but manipulation of the file it
> self will be much slower. Just read the binary file
> as is. Best and easiest thing to do is to work with
> binary files only. Packed binary is nice, but a
> little more work to decode the RLE (run-length
> encoding) compression(?) it uses.
>
> Now doing this programming requires a bit of
> homework
> on how to read binary files. I suspect that given
> your attempt to read a binary file with an ascii
> editor means you are probably pretty new to
> programming. No problem, we all started out as
> newbies, but you are going to have to do some
> research. Reading a binary file is dead easy in
> Delphi, and probably fairly simple in VB, though I
> am
> not sure how well it handles streams. In any event,
> I
> suggest you go on to the VB newsgroups and ask for a
> simple example of reading a binary file.
> Since these kinds of questions have been asked many
> time before go on to google first
> (http://groups.google.com/advanced_group_search) and
> search for "reading binary files" in the VB
> newsgroups
> (*.VB.*)
>
> Here check this link (all on *one* line)
>
http://groups.google.com/groups?as_q=reading%20binary%20files&as_ugroup=*.VB.*&lr=lang_en
>
> There are tons of examples.
>
> Idrisi has documented the format of the img file in
> its manuals. To read a img file you need to also
> read
> the ascii based DOC file. It tells you the number
> of
> rows and cols, the format of the file, whether its
> byte, real or integer, etc.
>
> Since you are using VB, you might also want to
> consider using an OCX there was one on the net a few
> years ago (http://www.inovagis.org). Also, check
> out
> http://www.clarklabs.org/13DNLDS/13dnlds.htm
> for information on the Idrisi API. Idrisi32 can act
> as
> a com server you can control from VB or any com
> compliant compiler. These solutions, however, will
> not
> match the performance you can achieve by coding a
> map
> reader yourself, but you may find them easier to
> implement.
>
> Good Luck,
__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/
--- End of Idrisi List message
IDRISI-L is an unmoderated list. As a service to list users, please post a
summary of useful responses to your questions.
To post a message to IDRISI-L, send it to [EMAIL PROTECTED] To
subscribe to the list, send an email from the address to be subscribed to
[EMAIL PROTECTED] with "subscribe" (without quotes) as the first line
of the message body. To unsubscribe, do the same, only with "unsubscribe"
as the first line of the message body.
The list is archived at
http://www.mail-archive.com/idrisi-l%40clarklabs.org/.