LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Feature request and how-to info for EXE icons

I would like to request for future versions of LabVIEW, support for higher resolution, and higher color resolution, icons imported into the compiled application.

Currently it is possible to use an icon editor to create an icon with several images of different size and color resolution that can be imported as an independent icon in the VI application building process, by selecting the Application Settings tab and loading a custom icon. Currently however the LabVIEW application builder will only import 4 of the images into the executable. These are:

32x32, 16 color & black/white
16x16, 16 color & black/white

Windows however (newer versions anyway) will support higher resolution 48x48 true color icons, which definitely have a more realistic appearance, especially when using shrunken pictures as part or all of the icon.

As a workaround, using a resource editor these higher resolution icons may be 'hacked' into the compiled executable, but cannot be imported during the build process using a pre-constructed icon (*.ico) file. This is great if you're into doing things manually just to get the job done, but it requires time and effort for each build, and also makes it an out-of-the-question option when building applications from controlled source code. For those reasons, I would like to request this be changed in future versions of the application builder.


For those interested in icon modification, here are some freeware utilities to try:

google: "IconEdit32" -- "iedit32.zip" -- Icon editor capable of saving multiple icon variations to a file... easy to use for changing the icons of a LabVIEW app that is going to be compiled.

google: "peresourceexplorer" -- "PE Resource Explorer" -- Utility to 'hack' into an executable and modify icons so they are higher resolution and higher color resolution than LabVIEW will allow by default.

google: "Irfanview" -- Highly functional image browsing program -- good in this particular case for resizing jpgs down to icon size so they can be cut and pasted into an icon editor.
0 Kudos
Message 1 of 8
(4,136 Views)
I took a look at this. The actual functions doing the icon work in the application builder seem to be called by reference from vi.lib\platform\icon.llb\Read Icons From ICO File.vi and Write Icons To Application.vi.
One problem is that even though the read VI does read all types of icon formats, the write does only overwrite existing icon formats in the resource fork of the executable and that contains currently only those four images.
So I would believe by adding the other resource types you would like to the applibs/lvapp.lib file (which really is an executable to startup the LabVIEW runtime engine and is used to create the actual exectuable file) you could get the Application Builder to replace those resources with the ones from your icon file.
There is a proble
m though and it is not very simple. If your icon file does not contain certain icon types the old ones will stay in and might be picked up. Removing them or adding new icon types not in the original file requiures to resize the entire executable and fixup quite some offsets in the resource table for this. There are some Win API functions which are supposed to help with that, but I'm not really familiar with them.

Rolf K
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 2 of 8
(4,135 Views)
I always thought it was bizarre that LabVIEW's own icon editor can't be used to create an icon for a built application...
0 Kudos
Message 3 of 8
(4,135 Views)
This is not so bizarre. LabVIEW icons are internally really Macintosh resources and there is some translation necessary to get them into Windows format. Also by being able to convert the icon alone you are still not there. Putting them into the target executable is a little tricky at best.

Rolf K
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 4 of 8
(4,135 Views)
The Application Builder will happily take a .ico file and use it for the icon of my built application, the missing step is only to convert the LabVIEW icon to the .ico file, and that can't be so hard if someone is giving away freeware to do it 😉 It does seem bizarre to me that this tiny feature couldn't be included in the LabVIEW + app builder that we pay a couple of thousand pounds/dollars/Euros for.
0 Kudos
Message 5 of 8
(4,135 Views)
tmh wrote:
> The Application Builder will happily take a .ico file and use it for
> the icon of my built application, the missing step is only to convert
> the LabVIEW icon to the .ico file, and that can't be so hard if
> someone is giving away freeware to do it 😉 It does seem bizarre to
> me that this tiny feature couldn't be included in the LabVIEW + app
> builder that we pay a couple of thousand pounds/dollars/Euros for.

Sure and the functions which do that are available, with accessible
diagram so you can see what is happening there and you could easily
adapt them to do what you want them to do. Well it won't be so easily
but anyhow.

As to getting the VI icons into an ICO file, you could do that already
in LabVIEW 7.0 without a
ny magic. Using the "Get Icon as Image Data"
method for VIs you can retrieve the three icons and then you "only" have
to create a Write Icons to ICO File.vi based on the information from the
according Read function or you can lookup the ICO file format on internet.

And yes it is a tiny feature, a hassle to do, single platform only and
that are all reasons why it is not in the Application builder yet,
eventhough the app builder didn't cost a "couple" of thousend bucks last
time I checked 😉

As to the freeware: if you refer to the LabVIEW Library Viewer shell
extension I once wrote, well it took me days of debugging, crashing, and
disturbed icon images with weird colors, to figure out how to get the
icon information in LabVIEW format into something Windows can understand 😞

Rolf Kalbermatter
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 6 of 8
(4,135 Views)
Is your code posted somewhere? I couldn't find it in the Code Library.

And whether or not it's a "couple" thousand dollars or just "a thousand"... I think it's worth noting that you've already paid a thousand dollars for your development enviornment, as compared to a couple hundred for most regular programming languages which already COME WITH the compiler, and then you're paying an EXTRA thousand dollars for ONE LITTLE APP that can't even automatically export and use your VI icon in the build process. Now perhaps you work at a nice large company that can afford this for you, but if I was NI and charging that much for a single program, I would at least ensure it was completely feature packed, which it is most definitely not. And
you are also exactly right to say that the problem is single platform only--so what? Isn't that what you pay for when you buy Application Builder for Windows? If Application Builder was $995 for Windows, Linux and Mac altogether, that might be an acceptable excuse for some generic compiler, but it's not. The compiler you buy is for the platform you run it on. If you want all three you will pay $3000. There is no excuse for NI not to feature pack a compiler targeted to a specific OS, that they charge so much money for, especially when it does nothing else. LabVIEW--fine, charge a thousand dollars--it does nearly everything, but Application Builder? At least make it user friendly and convenient. I still encounter cryptic errors when building apps, long wait times when it loads scripts where the mouse never goes to an hourglass--just stuff like that you know--it definitely could use some improvements.

Anyway... my $.02. 🙂
0 Kudos
Message 7 of 8
(4,135 Views)
m3nth wrote:
> Is your code posted somewhere? I couldn't find it in the Code Library.

You mean the LabVIEW VI Library shell extension? No, and it won't be
posted. To many low level details are in that code I feel are either to
hackish or to work intense and revealing, that I would feel happy
posting the source code for it.

I only put the compiled dll and install script on our server a few years
ago but since LabVIEW 7.0 has now this shell extension already included
we didn't bother to get it over to our new site.

Of course you can compare LabVIEW to the Student Edition of Visual Basic
or Visual C and then the price difference looks bad. But once you start
to look into Visual Studio Universal Subscription there is
not much of a
difference, and for me C programming is a lot more work in many aspects
than LabVIEW. And Visual Studio won't even attempt to allow you to
develop on one platform and deploy for another (ok Java excluded but you
don't need Visual Studio for that).

And yes there is Borland C, Symantec C and Watcom C and even CygWin and
others, from which most are certainly cheaper than Visual Studio and
some of them even free but they also have their limitations in many ways
.. Talking about perfect user friendly and convenient operation in any of
them including Visual Studio is also not true in my experience. They all
have their strong and weak points and most rely for packaging and
installer creation on external components such as InstallShield to give
the developer the ultimate control in how the application should install.

I'll try to take a look at this when I have some more time, but don't
keep your breath just now.

Rolf Kalbermatter
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 8 of 8
(4,135 Views)