Re: Looking for speed performance to draw line.
From: Mike D Sutton (EDais_at_mvps.org)
Date: 11/02/04
- Previous message: Amrit: "Re: Maps in VB6"
- In reply to: Amrit: "Re: Looking for speed performance to draw line."
- Next in thread: Amrit: "Re: Looking for speed performance to draw line."
- Reply: Amrit: "Re: Looking for speed performance to draw line."
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 2 Nov 2004 20:52:16 -0000
> The sound is perfect for me. but i don't know how to do link list in VB.
> Even i don't need if i use type array.
A linked list is simply one (for a single-direction list) or two (for a bi-directional list) additional piece(s) of information for
each item in an array, that being the next and/or previous indexes. When you need to insert an item in the array you use the first
available array entry and simply adjust the 'next' pointer from the item before where you wish to insert the new element to point at
your new array index, and it's next pointer to the previous item's original next pointer.
I.e:
Original list (Order: 2, 0, 1):
0) Next 1, Prev 2
1) Next -1, Prev 0
2) Next 0, Prev -1
(Assuming -1 means a null pointer i.e. the list ends)
Add new item:
3) Next ?, Prev ?
Break link between 2 and 0 and insert new item (Order: 2, 3, 0, 1)
0) Next 1, Prev 3
1) Next -1, Prev 0
2) Next 3, Prev -1
3) Next 0, Prev 2
> Yes, it should be Add, delete and modify same commands like in AutoCAD i
> have develop. for EG. Trim, offset, fillet, array, Mirror etc.
It's unlikely you need to implement a linked list for this, however for a full CAD application it may be best to wrap the individual
shapes up into shape classes that implemented the required commands
> if possible please add tutorial in your site "implement a linked list in VB"
Hopefully the above helped with that one.
> and for speed performance "using GDI with ..... (C++ and VB)",
The C++ DLL tutorial details using GDI in C++, as for performance it's negligible since you're calling the same code in either
language..
> "collection and array C++ vs VB"
If you need to work with objects then Collections are the way to go, otherwise use arrays.
Hope this helps,
Mike
- Microsoft Visual Basic MVP -
E-Mail: EDais@mvps.org
WWW: http://EDais.mvps.org/
- Previous message: Amrit: "Re: Maps in VB6"
- In reply to: Amrit: "Re: Looking for speed performance to draw line."
- Next in thread: Amrit: "Re: Looking for speed performance to draw line."
- Reply: Amrit: "Re: Looking for speed performance to draw line."
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|