[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
www.undertowsoftware.com • View topic - More on User Objects

More on User Objects

A forum made available for users of the MapPro OCX SDK to exchange ideas, ask each other questions, etc.

More on User Objects

Postby SamDee » Sat Sep 17, 2011 10:51 pm

O.K., so I started using the user objects and the user layers, in a way I think they were meant to be used. I have about 950 locations in town and I want to identify them on the map. I created 950 user objects in a single layer, each with its unique coordinates and a unique caption. I am using the same small bitmap to identify all of them, but doing 950 "LoadImage" seems a waste of CPU cycles and resources. Isn't there a way for me to specify/load the bitmap I want to use "once, and then use it as many times as I want?

I looked at the document, but I didn't find any information on that. If anyone has any info, I would really appreciate it.
User avatar
SamDee
Active User
Active User
 
Posts: 35
Joined: Wed Sep 29, 2010 8:33 am

Re: More on User Objects

Postby Gyrotech » Sun Sep 18, 2011 12:43 pm

SamDee wrote:O.K., so I started using the user objects and the user layers, in a way I think they were meant to be used. I have about 950 locations in town and I want to identify them on the map. I created 950 user objects in a single layer, each with its unique coordinates and a unique caption. I am using the same small bitmap to identify all of them, but doing 950 "LoadImage" seems a waste of CPU cycles and resources. Isn't there a way for me to specify/load the bitmap I want to use "once, and then use it as many times as I want?

I looked at the document, but I didn't find any information on that. If anyone has any info, I would really appreciate it.

It's real simple. Just grab the handle to the bitmap (Mappro80 gives you a function for that), and then just use the handle to assign the bitmap to all your other user object. I've used it to assign bitmaps to over 12,500 user objects in 6 different layers a single application. Works like a charm.

....
myBitmapHandle = axMapPro1.GetImageHandle("c:\\myCode\\bitmaps\\samplepic.bmp");
....
myObjects[i].Handle = myBitmapHandle;
...
User avatar
Gyrotech
Frequent User
Frequent User
 
Posts: 52
Joined: Mon May 03, 2010 11:23 pm

Re: More on User Objects

Postby SamDee » Sun Sep 18, 2011 9:59 pm

Thanks, that's what I was looking for. while reading about the user objects I saw references to a collection of SetItem functions. Are there advantages/disadvantages in using those instead of the UserObjects/UserLayers?
User avatar
SamDee
Active User
Active User
 
Posts: 35
Joined: Wed Sep 29, 2010 8:33 am


Return to MapPro OCX

Who is online

Users browsing this forum: No registered users and 1 guest

cron