Re: Simple Graphics Coding



"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


.



Relevant Pages

  • Re: Unix I/O and C library I/O, why there are two sets of I/O functions?
    ... POSIX does not differentiate between library functions and system ... there are several partial or complete implementations of POSIX ... on top of the Windows API, and most of what you think of as system ... there is no standardized API to manipulate the buffer). ...
    (comp.lang.c)
  • Re: DLL Creation
    ... Cloning all math library functions to create a dll,but fortunately ... windows has created that:MSVCRT.DLL ...
    (microsoft.public.vc.mfc)