BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

New to graphics programming

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Graphics
View previous topic :: View next topic  
Author Message
Peter Hartlén
Guest





PostPosted: Tue Jan 30, 2007 9:11 am    Post subject: New to graphics programming Reply with quote



Hi!

Are there any recommended guides I could read to learn best practices in
graphics programming with maps.

I want to add a map module to my application.

The module should:
1. Be able to open maps in jpeg formats with .tfw coordinate file
2. I want to be able to paint bitmaps or simple shapes ontop (not in the
actual file) of the map, based on coordinates, and indicating certain
objects throughout the terrain.
3. Allow the user to click on these painted objects
4. Use the mousescroll to zoom
5. Load parts of the map-file as it could be really large. Possibly using
the screen resolution as tile-size and cache the map-tiles closest to the
active tile

Mainly I am interested in common techniques to prevent flickering when
loading large maps.

What component(s) should I use when loading the map(s). Should I use a
transparent componentontop of the base component displaying the map?

How easy/hard would it be to implement support for dxf (and various autocad
formats)?

Thanks in advance!

/ Peter
Back to top
willem van deursen
Guest





PostPosted: Tue Jan 30, 2007 9:11 am    Post subject: Re: New to graphics programming Reply with quote



Hi Peter,

there are some real GIS components around for Delphi (look at TatukGIS
at www.tatugis.com), but that might be a little bit overkill for your
application. Maybe you want to start with something like G32
(http://www.graphics32.org/wiki/) that can load quite large bitmaps and
allows you to zoom. You have to create your own coordinate system based
on the information in your world files, and convert from and to
bitmapcoordinates yourself.

If you have only a few objects you want on top of your map, you can use
components for that (they will give you an onclick event), otherwise you
have to draw them on one of the G32 layers and maintain a list with
coordinates which ou can use to search for clicks near your objects.

If you have the money available, go to the professional GIS components,
if you don't have the money, I would recommend G32.

Willem

Peter Hartlén wrote:
Quote:
Hi!

Are there any recommended guides I could read to learn best practices in
graphics programming with maps.

I want to add a map module to my application.

The module should:
1. Be able to open maps in jpeg formats with .tfw coordinate file
2. I want to be able to paint bitmaps or simple shapes ontop (not in the
actual file) of the map, based on coordinates, and indicating certain
objects throughout the terrain.
3. Allow the user to click on these painted objects
4. Use the mousescroll to zoom
5. Load parts of the map-file as it could be really large. Possibly using
the screen resolution as tile-size and cache the map-tiles closest to the
active tile

Mainly I am interested in common techniques to prevent flickering when
loading large maps.

What component(s) should I use when loading the map(s). Should I use a
transparent componentontop of the base component displaying the map?

How easy/hard would it be to implement support for dxf (and various autocad
formats)?

Thanks in advance!

/ Peter




--
Willem van Deursen, The Netherlands
wvandeursen_nospam (AT) nospam_carthago (DOT) nl
replace _nospam@nospam_ for @ to get a valid email address
www.carthago.nl
Back to top
Peter S.
Guest





PostPosted: Tue Jan 30, 2007 9:11 am    Post subject: Re: New to graphics programming Reply with quote



Hello,

You may also try this
http://www.ecostats.com/software/shapeviewer/svobjectsdelphi.htm

Regards

Ï "Peter Hartlén" <ph.no (AT) sib (DOT) spam.se> Ýãñáøå óôï ìÞíõìá
news:45bef669 (AT) newsgroups (DOT) borland.com...
Quote:
Hi!

Are there any recommended guides I could read to learn best practices in
graphics programming with maps.

I want to add a map module to my application.

The module should:
1. Be able to open maps in jpeg formats with .tfw coordinate file
2. I want to be able to paint bitmaps or simple shapes ontop (not in the
actual file) of the map, based on coordinates, and indicating certain
objects throughout the terrain.
3. Allow the user to click on these painted objects
4. Use the mousescroll to zoom
5. Load parts of the map-file as it could be really large. Possibly using
the screen resolution as tile-size and cache the map-tiles closest to the
active tile

Mainly I am interested in common techniques to prevent flickering when
loading large maps.

What component(s) should I use when loading the map(s). Should I use a
transparent componentontop of the base component displaying the map?

How easy/hard would it be to implement support for dxf (and various
autocad
formats)?

Thanks in advance!

/ Peter

Back to top
Nils Haeck
Guest





PostPosted: Tue Jan 30, 2007 3:49 pm    Post subject: Re: New to graphics programming Reply with quote

How big are the bitmaps? If they are larger than.. say 4000x4000 pixels you
will need a special tiled class reading them. If they're not, you can just
load them into memory (off-screen), and "blit" parts of this bitmap to the
screen using the StretchBlt command.

I can also help you perhaps by writing a demo with Pyro. Can you perhaps
send me a sample jpeg file, and a sample .tfw coordinate file (with a
description of it's format)?

Pyro isn't free but it would do the trick very well (allowing all kinds of
objects over a map, in a scrollable / zoomable window). Info here:
http://www.simdesign.nl/forum/viewforum.php?f=13

Preventing flicker is easy: just override the WM_EraseBkgnd message in your
form / panel / paintbox, and make sure the background is not "erased", or
painted white, by Windows:

TMyPanel = class(TCustomPanel)
private
..
procedure WMEraseBkgnd(var Message: TWMEraseBkgnd); message
WM_ERASEBKGND;


procedure TMyPanel.WMEraseBkgnd(var Message: TWMEraseBkgnd);
begin
// No automatic erase of background
Message.Result := LRESULT(False);
end;

Another (slower) option is to set the control to "DoubleBuffered".


Kind regards,

Nils Haeck
www.simdesign.nl

"Peter Hartlén" <ph.no (AT) sib (DOT) spam.se> schreef in bericht
news:45bef669 (AT) newsgroups (DOT) borland.com...
Quote:
Hi!

Are there any recommended guides I could read to learn best practices in
graphics programming with maps.

I want to add a map module to my application.

The module should:
1. Be able to open maps in jpeg formats with .tfw coordinate file
2. I want to be able to paint bitmaps or simple shapes ontop (not in the
actual file) of the map, based on coordinates, and indicating certain
objects throughout the terrain.
3. Allow the user to click on these painted objects
4. Use the mousescroll to zoom
5. Load parts of the map-file as it could be really large. Possibly using
the screen resolution as tile-size and cache the map-tiles closest to the
active tile

Mainly I am interested in common techniques to prevent flickering when
loading large maps.

What component(s) should I use when loading the map(s). Should I use a
transparent componentontop of the base component displaying the map?

How easy/hard would it be to implement support for dxf (and various
autocad formats)?

Thanks in advance!

/ Peter
Back to top
Lord Crc
Guest





PostPosted: Tue Jan 30, 2007 11:18 pm    Post subject: Re: New to graphics programming Reply with quote

On Tue, 30 Jan 2007 10:49:08 +0100, "Nils Haeck" <bla (AT) bla (DOT) com> wrote:

Quote:
If they are larger than.. say 4000x4000 pixels you
will need a special tiled class reading them.

I guess that's driver dependent then (I'm not considering 9x here).
I've successfully opened a 8192x6000 bitmap in TImage, and manipulated
it without problem. But I agree with your general idea, it's not
something I would count on working ;)

- Asbjørn
Back to top
Nils Haeck
Guest





PostPosted: Wed Jan 31, 2007 2:54 am    Post subject: Re: New to graphics programming Reply with quote

Indeed.. and the worst thing, it might work on *your* computer, but if your
software is used by many, there's always a user somewhere with a Win 95
system and horrible graphics card, where it crashes.

I think even the 4000x4000 is rather stressing, I once heard it's only
"safe" to create a bitmap the size of the user's screen resolution. So in
order to be really safe, one would have to query the screen resolution and
use that as upper bound.

Nils

"Lord Crc" <lordcrc (AT) hotmail (DOT) com> schreef in bericht
news:hbvur2dggbda8egq3jhhk92cjfoao4fe79 (AT) 4ax (DOT) com...
Quote:
On Tue, 30 Jan 2007 10:49:08 +0100, "Nils Haeck" <bla (AT) bla (DOT) com> wrote:

If they are larger than.. say 4000x4000 pixels you
will need a special tiled class reading them.

I guess that's driver dependent then (I'm not considering 9x here).
I've successfully opened a 8192x6000 bitmap in TImage, and manipulated
it without problem. But I agree with your general idea, it's not
something I would count on working ;)

- Asbjørn
Back to top
Chris Morgan
Guest





PostPosted: Wed Jan 31, 2007 6:05 am    Post subject: Re: New to graphics programming Reply with quote

Quote:
Are there any recommended guides I could read to learn best practices in
graphics programming with maps.

I want to add a map module to my application.

The module should:
1. Be able to open maps in jpeg formats with .tfw coordinate file
2. I want to be able to paint bitmaps or simple shapes ontop (not in the
actual file) of the map, based on coordinates, and indicating certain
objects throughout the terrain.
3. Allow the user to click on these painted objects
4. Use the mousescroll to zoom
5. Load parts of the map-file as it could be really large. Possibly using
the screen resolution as tile-size and cache the map-tiles closest to the
active tile

Mainly I am interested in common techniques to prevent flickering when
loading large maps.

I would investigate the available 3rd party Delphi components
and COM controls first to see if any do what you want.

If you cannot find a 3rd party set which suits your needs, your
requirements will involve a lot of work.

We have developed some in-house mapping components
for some of our applications.
We also use ArcGIS components from ESRI (www.esri.com)
(which are not cheap).

You will need to investigate coordinate transforms
(between floating point and integer coordinate systems),
possibly involving spheroidal coordinate systems, depending
on the scale and projection systems used in your maps.
You will also need to use a combination of bitmap and
vector graphics. Vectors are useful for indicating selection,
since you can 'undraw' them to remove the selection
(if you draw with an XOR pen).
Getting maps to scroll smoothly without flickering
or delay is also quite tricky. You need to have a fast spatial
index of your data so that you can quickly determine
the parts which need to be redrawn.

Cheers,

Chris
Back to top
Loren Pechtel
Guest





PostPosted: Thu Feb 01, 2007 2:03 am    Post subject: Re: New to graphics programming Reply with quote

On Tue, 30 Jan 2007 18:18:14 +0100, Lord Crc <lordcrc (AT) hotmail (DOT) com>
wrote:

Quote:
On Tue, 30 Jan 2007 10:49:08 +0100, "Nils Haeck" <bla (AT) bla (DOT) com> wrote:

If they are larger than.. say 4000x4000 pixels you
will need a special tiled class reading them.

I guess that's driver dependent then (I'm not considering 9x here).
I've successfully opened a 8192x6000 bitmap in TImage, and manipulated
it without problem. But I agree with your general idea, it's not
something I would count on working Wink

Yeah, that's the bugaboo--it is driver dependant. Just because it
works on your box doesn't mean it works on someone else's.
Back to top
Bryan
Guest





PostPosted: Sat Feb 03, 2007 12:21 am    Post subject: Re: New to graphics programming Reply with quote

Peter,

Take a look at TGlobe (www.tglobe.com). It is a very nice component for mapping etc...
- Georeference images
- Shapefile, MIF, E00 and others.
- 100% user interactive, panning, zooming etc....

You can download demos to see if this is what you want.

Cheers,
Bryan

"Peter Hartlén" <ph.no (AT) sib (DOT) spam.se> wrote:
Quote:
Hi!

Are there any recommended guides I could read to learn best practices in
graphics programming with maps.

I want to add a map module to my application.

The module should:
1. Be able to open maps in jpeg formats with .tfw coordinate file
2. I want to be able to paint bitmaps or simple shapes ontop (not in the
actual file) of the map, based on coordinates, and indicating certain
objects throughout the terrain.
3. Allow the user to click on these painted objects
4. Use the mousescroll to zoom
5. Load parts of the map-file as it could be really large. Possibly using
the screen resolution as tile-size and cache the map-tiles closest to the
active tile

Mainly I am interested in common techniques to prevent flickering when
loading large maps.

What component(s) should I use when loading the map(s). Should I use a
transparent componentontop of the base component displaying the map?

How easy/hard would it be to implement support for dxf (and various autocad
formats)?

Thanks in advance!

/ Peter

Back to top
fei hongbin
Guest





PostPosted: Thu Apr 12, 2007 4:47 pm    Post subject: Re: New to graphics programming Reply with quote

Please try TCAD package.
visit it at http://www.codeidea.com to get more information.

hongbin.fei


"Loren Pechtel" <lorenpechtel (AT) hotmail (DOT) invalid.com>
??????:45c0f5fc (AT) newsgroups (DOT) borland.com...
Quote:
On Tue, 30 Jan 2007 18:18:14 +0100, Lord Crc <lordcrc (AT) hotmail (DOT) com
wrote:

On Tue, 30 Jan 2007 10:49:08 +0100, "Nils Haeck" <bla (AT) bla (DOT) com> wrote:

If they are larger than.. say 4000x4000 pixels you
will need a special tiled class reading them.

I guess that's driver dependent then (I'm not considering 9x here).
I've successfully opened a 8192x6000 bitmap in TImage, and manipulated
it without problem. But I agree with your general idea, it's not
something I would count on working ;)

Yeah, that's the bugaboo--it is driver dependant. Just because it
works on your box doesn't mean it works on someone else's.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Graphics All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.