Getting png file from DLL resource for New URI

25 views
Skip to first unread message

ICW Keith

unread,
Dec 21, 2020, 4:32:27 PM12/21/20
to MapInfo-L
I have spent more time on this DLL Resource image for a button than it should ever take.  For some reason the image is not displaying on the About button.  Currently I have 62 images that need to be displayed for our 64 bit version of GeoAuthor for MapInfo 2019.   Perhaps another set of eyes could explain what I have wrong here.  I have successfully been able to use this New URI() command with one of the MapInfo Images and it does work with MapInfo's 32x32 png images.  However all of the images I have are custom artwork that does not come from the MapInfo Application.  I have included:

1) the original syntax from the MapInfo 2019 documentation
2) the syntax or actual code that I am attempting to use
3) the VS 2017 Project location of the 62 images
4) the properties set on the resource png files.

Any insight is greatly appreciated.  If more info is required, I will provide it.

I know Peter Horsbøll Møller can do this in his sleep.

"pack://addinorigin:,,,/{absolute path to resource assembly};component/{location of image in assembly with image name}"

Call SetRbnSplitCtrlLargeIcon(AboutsplitButton, New_Uri("pack://application:,,,/ApplicationDirectory()+GeoAuthor64.dll;component/Properties/Resources/GAAbout_32x32.png", 0))

VS2017 Project image pathing.

GeoAuthor64_Resource_png1.jpg

VS2017 Project image Properties:
GeoAuthor64_Resource_png_Properties1.jpg
Thank you in advance for assistance.

 

 

Keith Tozier, GISP

International Computer Works, Inc.

         

Peter Horsbøll Møller

unread,
Dec 22, 2020, 3:40:48 AM12/22/20
to mapi...@googlegroups.com

There’s no way I can do this in my sleet, Keith 😊

In fact I had to look up the post I wrote some time back on how I made this work.

 

Here’s my statement for assigning an icon to a control:

Call SetRbnBtnCtrlLargeIcon(mtsBtn, New_Uri("pack://addinorigin:,,,/" + ApplicationDirectory$() + "ImageResource.dll;component/Resources/First32x32.png", 0))

 

Try changing your statement from:

Call SetRbnSplitCtrlLargeIcon(AboutsplitButton,

New_Uri("pack://application:,,,/ApplicationDirectory()+GeoAuthor64.dll;component/Properties/Resources/GAAbout_32x32.png", 0))

 

To this:

Call SetRbnSplitCtrlLargeIcon(AboutsplitButton,

New_Uri("pack://addinorigin:,,,/" + ApplicationDirectory() + "GeoAuthor64.dll;component/Properties/Resources/GAAbout_32x32.png", 0))

 

The type needs to be changed from application to addinorigin.

And the function ApplicationDirectory$() needs to get evaluated.

 

I hope this helps

 

Peter Horsbøll Møller

www.precisely.com

 

Peter Horsbøll Møller
Principal Sales Engineer - Distinguished Engineer

 

From: mapi...@googlegroups.com <mapi...@googlegroups.com> On Behalf Of ICW Keith
Sent: 21. december 2020 22:32
To: MapInfo-L <mapi...@googlegroups.com>
Subject: [MI-L] Getting png file from DLL resource for New URI

 

This message originated Externally. Use proper judgement and caution with attachments, links, or responses.

 

--
--
You received this message because you are subscribed to the
Google Groups "MapInfo-L" group.To post a message to this group, send
email to mapi...@googlegroups.com
To unsubscribe from this group, go to:
http://groups.google.com/group/mapinfo-l/subscribe?hl=en
For more options, information and links to MapInfo resources (searching
archives, feature requests, to visit our Wiki, visit the Welcome page at
http://groups.google.com/group/mapinfo-l?hl=en

---
You received this message because you are subscribed to the Google Groups "MapInfo-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapinfo-l+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mapinfo-l/4e20056e-8e4e-4558-a826-b0bd9dbfee08n%40googlegroups.com.

ICW Keith

unread,
Dec 22, 2020, 11:41:09 AM12/22/20
to MapInfo-L
Peter you have been a tremendous help in the past and for that I am grateful.

I will try your recommendation. 

We have been using the MapInfo 15.03 32 bit version of the software with our clients and it works very efficiently.

Perhaps MapInfo 2019 will prove to be just as efficient after learning the interface.

Running under what is called the Legacy Tab is not an option.

MapInfo 2019 seems to be the only MapInfo Pro product that Precisely offers.

Has Precisely made any statement as to the discontinuation of all previous MapInfo offerings?

If they have where would I find this?

Thank you,

Keith Tozier
International Computer Works, Inc.

ICW Keith

unread,
Dec 22, 2020, 3:16:51 PM12/22/20
to MapInfo-L
Peter,

It seems I have been able to get it to work with the ApplicationDirectory$() function within the New_Uri() function.

I am not sure why I used the word application instead of addinorigin within the New_Uri() function.

I can assure you this is the first time I have ever used the New_Uri() function.

Thank you, once again, you are the man!

Keith Tozier
International Computer Works, Inc.



Peter Horsbøll Møller

unread,
Dec 23, 2020, 4:58:56 AM12/23/20
to mapi...@googlegroups.com

Good to hear that you managed to get it working, Keith.

 

Also in case you aren’t aware, the Create and Alter Buttonpad statements have been modified to support the Ribbon interface too.

That means you can create simple buttons and places these on an existing or new tab in an existing or new tab group.

 

For simple MapBasic applications this makes it a lot easier to port existing 32 bit applications to the 64 bit interface.

 

It has been discussed in a couple of post in the Knowledge Community so maybe you are aware of this option already.

ICW Keith

unread,
Dec 23, 2020, 4:26:57 PM12/23/20
to MapInfo-L
Peter,

Thank you for the update.  I hope you have a safe and Happy Holidays or as I prefer to say Merry Christmas.

I am sure I will probably have a lot of questions in 2021.

Cheers!

Keith Tozier
International Computer Works, Inc.


Reply all
Reply to author
Forward
0 new messages