I built a game, and I wanted to change the icon (this is a windows game.) I tried removing the Game.ico that it came with and put in another , but now it just showed the standard exe file icon. All help would be appreciated.
When changing the .ico file, right-click on your project in Visual Studio and go to Properties. Select "Application" form the list on the left. In the "Resources" section browse to the icon file that you wish to use for your game.
Note that the .ico file is only used by XNA on Windows game projects and is ignored for Xbox 360 and Windows Phone 7 games. Also note that it's often easier to edit the existing Game.ico file and make your changes to that file when possible (easier because it's already linked and is in the correct format).
Related
I downloaded an .R file from a zoom chat on desktop to open in Rstudio later.
Well, the .R extension was not part of the name, so I changed the name to something.pdf (of course by mistake).
The icon now looks like a pdf. I replaced the .pdf with .R. But the icon still is a PDF file and Rstudio does not recognize it as an R file.
How can I can change it back to its .R format?
edit. thanks for pointing this out. I am on a windows 10 machine. and the file is on desktop.
Troubleshoot for Windows
You may be trying to add multiple file extensions, which does not allow the file to be ready correctly.
A quick google search.
How do I reveal file extensions?
For Windows 8-10
Start Windows Explorer, you can do this by opening up any folder.
Click the View menu.
Check the box next to "File name Extensions"
Then make sure you have my_file.R as opposed to my_file.R.R.pdf.
I am making a single exe application, that is linked in multiple Right-Click menus.
It is VB.Net application, using Net Framework 4.0
Each of those items needs a different icon.
How do I expose icons inside my exe, so they are available in Right-Click menu items and shortcuts without using post-build hackery?
I mention post-build as hackery, cos some anti-virus might not like the change in the signature that comes with messing about with the exe as a post-build step.
What I tried:
Adding png and ico versions of icons to My.Resources
Adding png and ico versions of icons using Project -> Add -> Existing Item -> selecting files
Using ImageMagick to combine multiple icons in to one ico file
What I want (example using explorer.exe):
What I have:
I'm having trouble with my application icon looking bad after adding it into my project, building it, and creating a shortcut to it.
Here's what I've done:
1) I started with a 256x256 PNG file that looks great.
2) I used IcoFX to generate a .ICO file with all the recommended sizes.
3) I add the icon to my project as follows:
A) Open project properties -> Resources -> Add Resource -> Add Existing File
B) Choose the .ICO file that I created in step 2.
4) Go to "Application" section of project properties.
5) In "Icon and Manifest", drop down "Icon" and choose the icon that I added in step 3.
6) Save my project and build it.
7) Go to Windows Explorer and find the newly built EXE.
8) Create a shortcut to the EXE on the desktop.
The icon looks like this:
As you can see, it doesn't look very good. The edges are jagged, etc.
At first, I thought it was an issue with my .ICO file, but here's the kicker... I then did the following:
9) Right-click on the desktop icon, and go to Properties.
10) Go to the Shortcut tab and click "Change Icon".
11) Click "Browse", and select the EXACT SAME ICON FILE that I added to my project in step 3.
Now, my desktop icon looks like this:
Now, the icon looks pretty and smooth!
Again, both icons used the exact same source .ICO file. The only difference is that the first one was imported into Visual Studio and embedded in my .EXE, and the other one was directly used via the OS.
What is Visual Studio doing to my icon to make it look so crummy, and how can I prevent it?
This could be a problem with the windows icon cache. I had the same problem that I fixed by clearing the cache.
The first version of your code that you copied to the desktop - did this have a low res icon ?
Windows will cache the icon when it first sees the EXE, and then does not refresh even when you rebuild your executable if it has the same filename. You will also see the same behavior in windows explorer.
I think by changing the icon through the OS, you've just manually refreshed the icon cache.
You can quickly test this by renaming the EXE before copying it to the desktop. This will bypass the cache and show the actual icon in your EXE.
To get rid of any old icons in the icon cache, you can clear it as described in this link
http://www.winability.com/how-to-erase-icon-thumbnail-cache-windows-8/
I have quite a large VB6 project, with many forms, classes, modules and user controls.
When I create a shortcut to the compiled executable and choose "change icon" for the shortcut there are multiple icons that I can select from. This indicates that there are multiple icon resources being compiled into the executable. The first icon is the "normal" application icon which seems to be controlled by setting the icon form in the MAKE tab of the project settings. That is fine and works as expected.
The problem I have is that I just cannot find out where the other icons that are being compiled into the executable are coming from. Is there a way I can take a VB6 project or a Complied executable and find out where in the project the icons resources are being set?
I've checked all the forms and a bunch of the image lists and none seem to be the icons in question.
Any ideas?
This link talks about using the VB6 add-in manager to use an add-in called the VB6 Resource Editor. Sounds like a good place to check for more resources.
The problem I have is that I just
cannot find out where the other icons
that are being compiled into the
executable are coming from.
I believe this is a misapprehension.
The default set of alternate icons for a shortcut are held within Shell32.dll.
I've got two branches of code. 1 has a dialog box that the other doesn't, but because of politics the dialog box wasn't moved into the newest branch. Now they want it in...
So is it possible to copy a dialog box from one project to another.
There apears to be an export and import feature however it's greyed out.
.RC files are simple text files. You can simply copy/paste the DIALOG text from one .RC file to the other. Make sure that you copy the corresponding RESOURCE.H entries as well.
Alternatively, you might be able to open both .RC files and then simply drag-and-drop the dialog from one to the other.
Update for Visual Studio 2010 - 2013:
You can still drag-drop and copy-paste, but only outside of your project / solution.
Close solution, open both RC as files without any open solution, and go. For drag, "Hold down the CTRL key and drag the resource to the second .rc file. For example, drag IDD_DIALOG1 from Source1.rc to Source2.rc."
Microsoft - How to Copy Resources
Drag and drop doesn't work in Visual Studio 2010. Editing the .RC file does work but be careful. For me the ID for the dialog showed up with *ID_etc*. I copied it and removed the *'s and it seemed to fix the problem.
I finally figure it out how to copy a Dialog from one solution to another.
Steps:
Open both solutions in separte windows.
Add a new Blank Dialog -Add Resources-> add->newDialog
Open Both Dialogs Open Binary data.
Copy the Binary data from source solution dialog to Destination Dialog
This is just to add some visual detail to the accepted answer (by Roger Lipscombe) along with its steps.
In order to copy a resource such as a Dialog from one project another project, below steps can be followed.
Start a new instance of Visual Studio.
Open both source and destination .RC file as files, as shown in the picture.
From the source RC file, copy required dialog.
Switch to the destination RC file tab and simply paste it.
Please note that this operation would have updated the resource.h file. That is an excellent help by Visual Studio.
One will have to make sure that no duplicate resource IDs are present in the resource.h file. When working with some legacy projects, it is found that there came some duplicate resource Ids that had to be manually corrected. It looks like such an effort is worth considering the mammoth task required otherwise.