Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to load part of an image from file/resource?

Status
Not open for further replies.

jgudnas

IS-IT--Management
Feb 8, 2004
4
CA
Hi,

I have a 40MB jpg detailed map graphic file, and need to write an app which can bring up sections of the map at any given time. Delphi 2005.

I need to know if there is a way to load a chunk of the file into a timage or other component without reading the entire file. i.e. dimensions are 12236x17559. would like to load 1000,1000 to 3000,3000.

As it is i cant even load the map in IDE due to size, so short of breaking it down into pieces, i am not sure what to do.

Thanks
Jared
 
Mmmmm....

1) JPG is not an addressable format.

2) Resources are not chunkable either.

3) A BMP file (not resource) is addressable if you know how to address it... but it will be many times the size of the JPG file. Depends on the original file (for solid color files JPG do not compress so much, for natural color files compression can be 100x). Furthermore, converting a pixel chunk of a BMP file in a fully functional TBitmap can be a funny thing.

4) The other approach is cutting down the map (with a graphical editor) in a lot of *little* sections (tiles) and load a bunch of the sections centered on the tile to be shown.
Check
buho (A).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top