Page 1 of 1 1
Topic Options
#91319 - 2003-02-01 12:33 AM drawing on a kixform
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
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...
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#91320 - 2003-01-31 01:09 PM Re: drawing on a kixform
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6373
Loc: Stuttgart, Germany
Basically Yes Conrad,

hmmm ... what do you try to do ? An Autorouter, Street Map ? Navigation System (to visualize tragets in Iraq ? [Eek!] )

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.
_________________________



Top
#91321 - 2003-01-31 01:10 PM Re: drawing on a kixform
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6373
Loc: Stuttgart, Germany
Oh ... its a Sitemap [Big Grin]

hmmm ... we could do this online If you like
_________________________



Top
#91322 - 2003-01-31 02:08 PM Re: drawing on a kixform
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
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 = 640480

; Create PictureBox that is same size as BMP ...

$PictureBox = $Form.PictureBox
$PictureBox.Size = 295381
$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 ...

Top
#91323 - 2003-01-31 02:19 PM Re: drawing on a kixform
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
To clear the map, try this:



Function OnClearClick

 $PictureBox.Picture = ".\map.bmp"
 $PictureBox.Refresh

EndFunction


Top
#91324 - 2003-01-31 02:23 PM Re: drawing on a kixform
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Rad,

Did you have a look at paint?

HTH,

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#91325 - 2003-01-31 02:39 PM Re: drawing on a kixform
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6373
Loc: Stuttgart, Germany
aka 'The KiXAsso Painter' [Big Grin]
_________________________



Top
#91326 - 2003-01-31 03:49 PM Re: drawing on a kixform
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
damn... easier that I thought...

The hard part is to make an array of the coordinated of the routers [Smile]

this kix ass [Big Grin]
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#91327 - 2003-01-31 05:44 PM Re: drawing on a kixform
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
Here's another example of using the picturebox to draw lines and refresh the data: KiXforms: ProcessMon
Top
#91328 - 2003-01-31 07:56 PM Re: drawing on a kixform
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3165
Loc: Houston TX
ohh this is very interesting!!

anyone have any pointers on how to find the short route of a given node structure?

Top
#91329 - 2003-01-31 08:09 PM Re: drawing on a kixform
Jack Lothian Offline
MM club member
*****

Registered: 1999-10-22
Posts: 1169
Loc: Ottawa,Ontario, Canada
Use linear programming methods. [Big Grin]

Hi Bryce,

Long time no see. Good to see you here again. [Smile]

[ 31. January 2003, 20:10: Message edited by: Jack Lothian ]
_________________________
Jack

Top
#91330 - 2003-01-31 08:20 PM Re: drawing on a kixform
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
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?
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#91331 - 2003-02-01 02:06 AM Re: drawing on a kixform
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3165
Loc: Houston TX
this might be of some use....

http://www.wikipedia.org/wiki/Dijkstra%27s_algorithm

Top
Page 1 of 1 1


Moderator:  Shawn, ShaneEP, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 156 anonymous users online.
Newest Members
diefnet, Arogya, gkustra, emnipetro, Hirze
17644 Registered Users

Generated in 0.034 seconds in which 0.01 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org