Re: Graphing Geographic Data

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Bob Powell [MVP] (bob_at__spamkiller_bobpowell.net)
Date: 06/20/04


Date: Sun, 20 Jun 2004 13:42:53 +0200

Hello John,

I think you're doing all the right things to maintain the image size with
respect to the original. I'm assuming this is in an ASP.NET application.
It's possible that the HTML that places the image is changing the size but
without seeing it I couldn't say. As for the ability to detect a point under
the mouse if it were a windows forms application I would suggest using a
retained mode system to store the points but as this is a web application
you should probably look at the possibility of generating an image-map on
the fly.

Sorry but I don't know how to do this. Perhaps if you ask on an ASP+
forum...

-- 
Bob Powell [MVP]
Visual C#, System.Drawing
Image transition effects, snap-to-grid and Layered Windows are
all discussed in May's edition of Well Formed for C# or VB programmers
http://www.bobpowell.net/currentissue.htm
Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm
The GDI+ FAQ RSS feed: http://www.bobpowell.net/faqfeed.xml
Windows Forms Tips and Tricks RSS: http://www.bobpowell.net/tipstricks.xml
Bob's Blog: http://bobpowelldotnet.blogspot.com/atom.xml
"John Wright" <rileyx_wright@hotmail.com> wrote in message
news:e$VkhZ%23UEHA.712@TK2MSFTNGP11.phx.gbl...
> Here is the code I have so far:
> Dim objBitMap As Bitmap
>
> Dim finalBitMap As Bitmap
>
> Dim objImgPhoto As Image
>
> Dim intHeight As Integer
>
> Dim intWidth As Integer
>
> Dim objGraphics As Graphics
>
> objImgPhoto = Image.FromFile("[Image on Disk]")
>
> intHeight = objImgPhoto.Height
>
> intWidth = objImgPhoto.Width
>
> objBitMap = New Bitmap(intWidth, intHeight)
>
> objBitMap.SetResolution(objImgPhoto.HorizontalResolution,
> objImgPhoto.VerticalResolution)
>
> objGraphics = Graphics.FromImage(objBitMap)
>
> objGraphics.DrawImage(objImgPhoto, New Rectangle(0, 0, intWidth,
intHeight),
> 0, 0, intWidth, intHeight, GraphicsUnit.Pixel)
>
> objGraphics.FillEllipse(New SolidBrush(Color.Red),
CInt(FinalMouseX.Text) -
> 17, CInt(FinalMouseY.Text) - 19, 10, 10)
>
> finalBitMap = New Bitmap(objBitMap, intWidth, intHeight)
>
> finalBitMap.Save(Response.OutputStream, ImageFormat.Jpeg)
>
> objBitMap.Dispose()
>
> objGraphics.Dispose()
>
> The problem I have is when I draw the finalBitMap it is smaller than the
> original image and so the elipse is off that is why I do the offset of -17
> and -19 in the objGraphics.FillEllipse.  I can draw the image on the map
now
> and when I retrieve the coordinates from the database I will put the
> FillEllipse in a loop drawing all the ellipses on the image.  What I need
> now is two things:
>
> 1.  How can I draw the finalBitMap the same size as the original
>
> 2.  How can I detect when I am over a dot drawn on the image and either
> raise a message box, or give a link to a form with the information.
>
>
>
> Thanks.
>
>
>
> john
>
> "John Wright" <rileyx_wright@hotmail.com> wrote in message
> news:uJw1SN8UEHA.3988@tk2msftngp13.phx.gbl...
> > I have a map of my local state and I have a feed I receive on a regular
> > basis (the feed consists of XML data that gives me geographic
coordinates
> > that I store in my database).  We are switching to .NET and we want to
> make
> > this real time and available on the web for our remote people to view.
I
> > can draw the map without a problem (I put an image into an image
control),
> > but when I retrieve the feed, I the map disappears and I get a display
of
> > all the dots.  I have two frames, on the left is the menu where people
can
> > select a person's route to view from a dropdown.  I pass the info the
next
> > frame where the map is.  When the frame that gets the data reads the
data,
> > it replaces the map with dots representing the route, but the underlying
> map
> > is gone.  I want the map to stay and the dots to update as a new person
is
> > selected from the dropdown list in the left frame.  Also, it would be
nice
> > to have them put the mouse over the dot and have a popup window or tool
> tip
> > window appear with some basic data.  Any help would be great.  I have
> tried
> > some GDI and SVG without much luck, I will do either one.
> >
> > John
> >
> >
>
>


Relevant Pages

  • Re: Graphing Geographic Data
    ... Dim finalBitMap As Bitmap ... Dim intHeight As Integer ... Dim intWidth As Integer ... I can draw the image on the map now ...
    (microsoft.public.dotnet.framework.drawing)
  • Re: S.F. tech jobs climb near level of dot-com peak (but Keith wont believe this)
    ... a map hanging in one of the classrooms in Dwinelle ... there's another big pink splotch in the Midwest around ... even three little pink dots of Algonkian. ... djheydt at gmail dot com ...
    (rec.arts.sf.fandom)
  • Default password for Active Directory User Script
    ... 'Messages recieved when trying to map a drive ... Dim strUser, strPassword, strDriveLetter, strHomeServer, strProfile ... Dim objDomain, objUser, objGroup ... ' *EnumerateUsers is then called and the AD objects are passed along ...
    (microsoft.public.windows.server.scripting)
  • Re: Putting dots on a map
    ... and draw the dots on there however you please. ... give credit to the authors of the map and/or license your map under ... If you want to be precise about it, go get a copy of QGIS (http://www.qgis.org ... Hawaii Highways: http://www.hawaiihighways.com/ ...
    (misc.transport.road)
  • WEB Query + IMAGES
    ... Part of the project needs to get a map from multimap and return ... I have written some code that uses a web query to ... obtain a link to the exact postcode location within multi map where the ... Dim postcode ...
    (microsoft.public.excel.programming)