Hello,
Using OCX 5.1.1, I cannot find the following methods:
AxMap1.set_UDPointImageListAdd
AxMap1.set_UDPointType
Is there a way around ?
Thanks
Hello,
Using OCX 5.1.1, I cannot find the following methods:
AxMap1.set_UDPointImageListAdd
AxMap1.set_UDPointType
Is there a way around ?
Thanks
Hello Bob.
Many of the user-defined methods have been deprecated, but have been replaced by newer methods by which you can accomplish the same things, and perhaps more. The online help file provides hints as to which methods you can use instead of the old ones.
For example, the UDPointFont… and UDPointType methods are now implemented by specifying ShapeDrawingOptions.PointType, following by other properties indicating the Font, or the Picture, etc.
And The ShapefileCategories allow for different images being drawn based on user-specified conditions.
Hope that helps.
Jerry.
Thank you Jerry for your prompt reply, in the meantime I managed to plot my PNG icon to AxMap, in fact my problem was elsewhere in my code (VB.net VS2019)
Still I feel sorry to have to load all my PNG icons from file (to distribute along with the binary), I tried from ImageList or Resource, as shown below, of course this code do not work, but is there a way to do it ?
Dim img As New Image
img.Open(“C:\Users\icons\vehicle.png”, ImageType.USE_FILE_EXTENSION, True) ’ this works
img.Open(My.Resources.vehicle.ToString, ImageType.BITMAP_FILE, True) ’ This do not work of course
I understand.
Without an enhancement to the OCX, I see there is a method Image.SetImageBitsDC, which loads an image from a Device Context. Could you possibly use this to load from a Resource, although it may take multiple steps?
Hello Jerry,
Ok I tried all day, could not find a way to cast from System.Drawing.Image to AxMap.Image, so I am always missing the file handle needed by AxMap.Image.SetImageBitsDC
Guess I will have to keep my icons as file on disk… Until next OCX version.
Thank you anyway.
Hello Bob. Sorry about your travails.
An AxMap.Image is a completely different type than System.Drawing.Image, so you would not be able to cast from one to the other. I believe the intent of the method is to do the conversion for you.
In the outside world (like .NET), you would get the hDC of a System.Drawing.Image, and pass that hDC into the OCX, and it would create an AxMap.Image using the hDC.
I admit that I have never tried this, but I believe it is the intent of this method. If I can find some time, I will try some things.
Regards,
Jerry.
Thank you
My problems is 75% solved anyway, I managed to dump all icons to a public folder when starting my real time tracking app, from My.Ressource. So I don’t need to distribute them anymore, dumping to disk only the ones I need… and delete on exit.
Stay safe,