|
|
|||||||
This is what I'd like to do: I want to display a map/picture on a form, and then draw lines from on spot on the map, to another. as a possibility, I'd also like to be able to wipe the map and draw another set of lines? on a kixform, with image, line and circle, can this be done? I'm looking to make a visual representation of my remote sites and the connectivity between.. ping, trace, routes, etc... |
||||||||
|
|
|||||||
Basically Yes Conrad, hmmm ... what do you try to do ? An Autorouter, Street Map ? Navigation System (to visualize tragets in Iraq ? ) Ok, for the technical side : Try to make the complete form a .PictureBox (no, create the form and then create a PictureBox of the same or smaller size) Add all Graphics you need then to $PictureBox.Line() etc ... J. |
||||||||
|
|
|||||||
Oh ... its a Sitemap hmmm ... we could do this online If you like |
||||||||
|
|
|||||||
Rad, this can be handled quite nicely by placing a PictureBox on your form then drawing to it using the graphics functions. Heres an example using a BMP of map. Just make sure to note the dimensions of the BMP using pbrush.exe or the like and size your PictureBox/Form accordingly: Break On $Form = CreateObject("Kixtart.Form") $Form.Size = 640, 480 ; Create PictureBox that is same size as BMP ... $PictureBox = $Form.PictureBox $PictureBox.Size = 295, 381 $PictureBox.Picture = ".\map.bmp" $PictureBox.Center ; Set the drawing (pen) width to five pixels ... $PictureBox.DrawWidth = 5 ; Create a draw button ... $Button = $Form.ToolButton $Button.Center $Button.Top = $PictureBox.Top $Button.Left = $PictureBox.Right + 10 $Button.Text = "Draw" $Button.OnClick = "OnButtonClick()" $Form.Center $Form.Show While $Form.Visible $=Execute($Form.DoEvents) Loop Exit 1 Function OnButtonClick ; Set some randow coords for our line ... $FromX = RND($PictureBox.ClientWidth) $FromY = RND($PictureBox.ClientHeight) $ToX = RND($PictureBox.ClientWidth) $ToY = RND($PictureBox.ClientHeight) ; Draw the line ... $PictureBox.Line($FromX, $FromY, $ToX, $ToY, "Red" ) EndFunction Hope this helps ... |
||||||||
|
|
|||||||
To clear the map, try this: Function OnClearClick $PictureBox.Picture = ".\map.bmp" $PictureBox.Refresh EndFunction |
||||||||
|
|
|||||||
Rad, Did you have a look at paint? HTH, Kent |
||||||||
|
|
|||||||
aka 'The KiXAsso Painter' |
||||||||
|
|
|||||||
damn... easier that I thought... The hard part is to make an array of the coordinated of the routers this kix ass |
||||||||
|
|
|||||||
Here's another example of using the picturebox to draw lines and refresh the data: KiXforms: ProcessMon |
||||||||
|
|
|||||||
ohh this is very interesting!! anyone have any pointers on how to find the short route of a given node structure? |
||||||||
|
|
|||||||
Use linear programming methods. Hi Bryce, Long time no see. Good to see you here again. [ 31. January 2003, 20:10: Message edited by: Jack Lothian ] |
||||||||
|
|
|||||||
I have placed a listbox on top of a portion of a picturebox when I refresh the picturebox, it overwrites the listbox, when I update/add to the listbox, the text space reappears but not the edges. any way to keep it on top? |
||||||||
|
|
|||||||
this might be of some use.... http://www.wikipedia.org/wiki/Dijkstra%27s_algorithm |