Re: Graphing Geographic Data
From: Bob Powell [MVP] (bob_at__spamkiller_bobpowell.net)
Date: 06/20/04
- Next message: Bert Hyman: "Re: Speed of drawing to bitmap varies with bitmap size"
- Previous message: Bob Powell [MVP]: "Re: Speed of drawing to bitmap varies with bitmap size"
- In reply to: John Wright: "Re: Graphing Geographic Data"
- Next in thread: John Wright: "Re: Graphing Geographic Data"
- Reply: John Wright: "Re: Graphing Geographic Data"
- Messages sorted by: [ date ] [ thread ]
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 > > > > > >
- Next message: Bert Hyman: "Re: Speed of drawing to bitmap varies with bitmap size"
- Previous message: Bob Powell [MVP]: "Re: Speed of drawing to bitmap varies with bitmap size"
- In reply to: John Wright: "Re: Graphing Geographic Data"
- Next in thread: John Wright: "Re: Graphing Geographic Data"
- Reply: John Wright: "Re: Graphing Geographic Data"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|