Re: Simple Graphics Coding
- From: "Bartc" <bc@xxxxxxxxxx>
- Date: Mon, 28 Jul 2008 09:19:51 GMT
"maud" <maud.july@xxxxxxxxx> wrote in message
news:b08133dd-c89d-414d-94a7-296e4a0a3ea0@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I would like to produce a number of maps with customized pushpins. I
do not need to embedded this into an application, however I need to
produce many more than I can manually construct. I was hoping someone
could recommend a simple application or programming environment to
work in. I have been thinking that if I get a background map image,
and then create a table of the pixel locations corresponding to map
locations, I would just need a program that given some sort of input
text file, created an image by placing a designated image on top of
the world map image at a designated pixel location.
It looks you don't need an application with a user interface, just an
utility. In that case the approach can be very simple. However you do need
some language or other with a library that can deal with images easily.
(With my poor knowledge in that area, I can only think of Python.)
I created the semi-pseudo code below as an example of this approach. The
library functions bmload/bmsave (wrappers around Intel's IJL library)
convert an image (it doesn't have to be jpeg) into internal form, in this
case a Windows format akin to BMP -- I believe something called a
'dib-section'.
The library function gxcopy (implemented at some deep level as Windows GDI)
is designed for bit-blitting between windows, but here works just as well
for copying pixels between images.
define inputimg = "bart01.jpg"
define pinimg = "pin.jpg"
define outputimg = "markedup.jpg"
define datafile = "locations.txt"
PROC START=
bmain:=bmload(inputimg)
if bmain=nil then stop fi
bpin:=bmload(pinimg)
if bpin=nil then stop fi
fin:=openfile(datafile)
if fin=0 then stop fi
while not eof(fin) do
readln #fin,x,y
gxcopy(bmain,bpin,x,y)
od
closefile(fin)
bmsave(bmain,outputimg)
END
--
Bartc
.
- References:
- Simple Graphics Coding
- From: maud
- Simple Graphics Coding
- Prev by Date: Re: core features and functions required in modern programming languages
- Next by Date: Re: Simple Graphics Coding
- Previous by thread: Re: Simple Graphics Coding
- Next by thread: Re: Simple Graphics Coding
- Index(es):
Relevant Pages
|