Windows form application - Icon image location? - icons

I think this should be a relatively easy one to answer, I hope, but is proving to be a bit of a stress!
I have used an Icon on an old application developed some years ago and I would now like to use the icon for a current project.. however..
I added the icon using the upload/import icon-image in the properties window, and did not add it in the project resources file, nor specify its location anywhere in my code, using only the icon tool in the properties window.
Now wanting to find the icon image file to use again, I cannot find it anywhere! I have trawled through all the project files looking for the image file or a ref to its location, but have found nothing; except for:
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
When running the application the icon is still clearly visible in the applications taskbar tile.
Does anyone know where the icon file is stored / how I can retrieve it?
Thank you in advance.

It is stored in "{Your_project_name}.{Form_name}.resources" file. Search inside the "obj" folder which is in your project folder.
Now open the command prompt of Visual Studio. We will convert this ".resources" file into a ".resx" file. We use "resgen" command here.
resgen foo.resources bar.resx
The .resx can then be added to a C# project. You can find your icon file there.

Related

Is there any way to send a picture WITH the code in Windows Forms?

I designed a windows forms, in which to insert a picture, I placed a PictureBox. To insert the picture in the pictureBox, I have to give the path of the image file in the code. But if I run this code in another computer, it does not work; since the path of the picture is saved in my computer.
So is there any way to export the picture along with the code?? Like we do in Android Studio, where we save the files to be used in the code project.
I think you need to place your pictures in Debug folder of your project solution. If you are using Image.FromFile() method so you can just write the name (relative path) of your pictures with extention. Let suppose I have a picture named dice1.png residing in my solution's Debug folder (C:\mySolutionName\myProjectName\bin\Debug) so I can getdice1.png in the program by writing follwing code,
Image dicePicture = Image.FromFile("dice1.png")
pictureBox1.Image = dicePicture;
Hope this helps!

Chromium based Browser "slimjet" toolbar grafical resources (icons)

I want to modifiy slimjet for personal use and searched through gits, reshacked all dll files and the app exe but I can't seem to find the resources I want to change. Does anybody know, where the grafical resoucres - icons or buttons for the toolbar - are stored in chromium derivatives general, but especially slimjet? I am not talking about the extension buttons. I mean those for "home" and navigation.
Are they inside the compiled binary file inside the exe or inside the .pak file I can not reshack or unpack?
Any clue or hint or help is appreciated.

How to change JavaFx native Bundle exe icon

I am trying to chance the icon of the exe file created native bundling of javafx packaging but it still contains the default icon. Please suggest
primaryStage.getIcons().add(FileUtility.loadImage("icon.png"));
did not help, it only changes the title bar and task bar icon.
The ico file still gets generated and icon of the exe files remains the default one
I also tried to assign an icon in the project properties-> Deployment-> icon but did not help
I believe I have encountered the same issue and the solution is described in the following thread.
As a side note - neither specifying your icon in the build.xml file or via the project's options in the deployment section is going to work thus far, but it seems to be fixed in the upcoming release of 7u10.
I added response here How to set custom icon for javafx native package icon on Windows and thinks it is the same issue you started out with. However you seem to have moved on, but others might find it interesting...
I added src/main/deploy/package/windows/myapp.ico there and it finally worked :)
For you:
Create src/main/deploy/package/windows/ folder
Add icon with name ${project.build.finalName}.ico
Run mvn jfx:build-native
I haven't played with it extensively - just got it to work and wanted to share. So if you want to use icon with different name, I don't know how. Not yet at least. The ... section in the config section seems to be for webstart, so I haven't been using it. Hope you get it to work!
Answered at How to set custom icon for javafx native package icon on Windows

Is it possible to add custom icon to hta

Is it possible to add custom icon to hta? What I mean is change the default hta file icon, which is "System Application Icon". Can it be done without assigning new icon to the extension, and not using shortcuts to the file ?
Like this
WinRAR can help you do that.
Package your hta & icon file to exe;
In options,
a. select "silent" extract;
b. set extract path;
c. create extract path and then put that icon file there, select icon in this path.
d. set run your hta(c:\your_path\your.hta) after exe file extracted.
(i could not provide more detail because i don't have WinRAR installed right now, it's a common way to add icon for hta.)
Every time user run the exe you created, it will just extract hta, icon to the path you specified, and then run your hta. the exe file will have the icon display, even copy to another computer.
If you get all work done correctly, you will get a exe file with the icon you defined.
BTW, you can also try google: hta exe icon
Good luck!
Yup, you sure can: this. You embed the icon in the hta file
Better You use Exescript Software
It's Good because ease of its use and add icon to resource file (which appears on top border of hta)
After that add icon in settings menu to Exe File and build the project
U will get a exe file with custom icon.

WindowIcon not showing up despite being valid in resource (and used elsewhere)

In my last question (Qt/C++: Icons not showing up when program is run) I asked how to get an icon to show up on a toolbar and was told I needed a Qt Resource, which I added and that fixed my problem, the icon did show up on the toolbar.
Now I'm trying to set the title icon of a window, using the same resource file, and it shows up fine in the Qt preview viewer but blank in the actual program. I am using a MainWindow which has an MDIArea and the children are MainWindows as well; neither the parent MDI nor child MDI windows icons will show properly. On the parent, I see the regular "Windows Application icon" and on the child, the icon is completely blank.
How can I solve this?
You will have to go through a standard resource file for windows. (That is, a .rc)
The process (as described in the documentation) is:
Store the ICO file in your application's source code directory, for
example, with the name myappico.ico. Then, create a text file called,
say, myapp.rc in which you put a single line of text:
IDI_ICON1 ICON DISCARDABLE "myappico.ico"
Finally, assuming you are using qmake to generate your makefiles, add this line to your myapp.pro
file: RC_FILE = myapp.rc
Regenerate your makefile and your application. The .exe file will now be represented with your icon in Explorer.
In the Visual Studio case you're simply able to add a resource to your project.

Resources