How to change default images in Windows Phone 8.1 app? - c#

I'm trying to pass certification using the Windows app cert kit but I'm getting an error due to using the default images for tiles, splash screen and logo.
I know this is because I need to replace these default images with my own but when I try to change the images in the Package.appxmanifest the is no option in the Application to change these images.
I've looked in the WMAppmanifest also but there is no option to change.
Does anyone know how I can get access to where the images are being set?

Looks like you're using WP 8.1 Silverlight.
To edit those settings using the GUI, you need to double click on the WMAppManifest.xaml in the Properties folder under the solution.

Found a quick fix for this by right clicking on the Package.appxmanifest file and selecting view in code.
I then manually changed the paths of the images from the default images to the ones I created.
<m3:VisualElements DisplayName="TotalTabata" Square150x150Logo="Assets\timer_icon_medium.png" Square44x44Logo="Assets\timer_icon_44.png" Description="Total Tabata is a total solution for all your interval and HIT training needs." ForegroundText="light" BackgroundColor="#464646">
Still not sure why the option to change them doesn't show up in the manifest designer. If anyone has a solution please post it as an answer.

Related

Add SVG images to resource file

I think this issue transcends Dev Express, which is why I haven't gone to the vendor's forum just yet (although I could be wrong). In the latest release of Dev Express Winforms (17.2), there is support for SVG images on the ribbon bar items. When you use the Dev Express picker and add them to project resources, it looks like this:
I have some SVG images of my own I'd like to add. Dragging and dropping them adds them as files. Doing an import through the designer adds them to the form resources, and I want them as project resources (we reuse icons across multiple forms).
Is there an easy way to add local SVG images to my Resources File and have them visible to all controls within the project, the way the Dev Express gallery images are?
If not, is there a hard way?
Consider using the SvgImageCollection component which specially designed to store vector images for DevExpress controls.
You can invoke the SvgImageCollection's smart tag and click "Edit Collection" to invoke the Collection Editor dialog. Use the "Add" selector to choose where to import SVG images from:
Don't know if something has changed or if something has happened in the last three years, but this is now super easy -- barely an inconvenience.
To add an SVG to the resources, go to the ImageOptions.SvgImage property of any control, Click on the properties (ellipsis) button, and it will bring up this familiar form:
The "import" button will allow you to add local SVGs into the resource file, which can then be accessed by the entire project.

How can I make Visual Studio use my updated icon for my NotifyIcon?

I am totally stumped by this issue and I do not know what to do.
I have created a simple C# Windows Form application using Visual Studio 2012 Premium. I have a small program that starts up and creates a NotifyIcon in the system tray. On click of the tray icon, a context menu is displayed and it shows a few menu options (Options, About, etc.), where each option displays a form. I have added two icon files (.ico) via the Resources by right clicking on my Project item, Properties, Resources. I programmatically change the Icon of my NotifyIcon, alternating between the two different icons. My problem is that my old icons keep displaying, instead of my new ones that I've added to the project. To be clear, my issue is that OLD icons keep displaying--everything is working and there are no errors, it just doesn't show my latest icons.
The way I'm changing the icons in code is using:
notifyIcon.Icon = Resources.IconA03312014; //or the other one; the numbers are the date
I initially made my icons and used those and later decided to change them a little bit--I changed some colors, etc. So then I removed the old icons from my project by clicking the Exclude from Project option. Then I added my new icons, which had different names. Then I updated my two code references that load the icons to use the new names. No matter what I do, my new/updated icons are not displayed!
Whether I run the program in Visual Studio in Debug or Release mode, it does not matter. I can clean the solution, rebuild, and then run the executable directly by clicking on it in Windows, and no difference. Old icons are shown.
I have followed different sets of instructions online that explain how to clear the Windows 8 icon cache (three different methods). I have cleared the cached Notification tray icons as well, using two different methods.
Basically, I cleaned my solution and then closed Visual Studio. I kill all explorer processes, run ie4uinit.exe -ClearIconCache from the command line and delete the IconCache.db file. Then I delete the notification icon cache by editing the registry following instructions similar to these (http://www.sevenforums.com/tutorials/13102-notification-area-icons-reset.html). Then I shutdown the computer. Upon starting backup and rebuilding my solution and running, the old icons are still there somehow. The physical .ico files for the old icons were deleted long ago. Each time I've added new icons to my Resources, I've created new icon files from scratch (using icobundl.exe) and named them uniquely by including the date in the name. I am aware that Windows, and apparently Visual Studio also, like to cache icons and if you delete some icon file A.ico in Windows and then rename another icon file B.ico to A.ico, the B.ico file's actual icon will change to A's. Anyway, I don't the name of the icon file is the issue.
Now, in code, if I use the same strategy and set one of my form's icons, it works correctly and the form displays my latest icon, while my notify icon still shows the old (and now nonexistent, except in Visual Studio la la land) icon.
So, I have:
...
if(firstState){
notifyIcon.Icon = Resources.IconA03312014;
optionsForm.Icon = Resources.IconA03312014;
}
else{
notifyIcon.Icon = Resources.IconB03312014;
optionsForm.Icon = Resources.IconB03312014;
}
firstState = !firstState;
...
There are no errors and both the notifyIcon and optionsForm's changes, but the notify icon displays my OLD icon that no longer exists anywhere (except somewhere/somehow in VS). The form's icon changes to my updated/latest icon.
If I copy my app's .exe file to another computer and run it, it too displays the old icons for the notify icon, so the old icons are somehow still embedded in my exe generated by Visual Studio. If I just directly load the .ico file, instead of referencing my project resources, the new icons ARE shown. This have to be some sort of strange Resources caching issue in Visual Studio?
Can anyone please help me with this issue? I just don't understand how my old icons are still existing somewhere, and how Visual Studio somehow knows how to switch them! That's right, the above icon swapout works perfectly for the form. But for the notifyIcon, the icon does switch from "A" to "B", but it uses the old A icon and the old B icon--icons that do not exist anywhere anymore!
I hope I have explained my issue. I greatly appreciate any help that anyone can provide.
I had this same problem a few months ago and it drove me crazy for a couple of hours. I was so focused on clearing on the icon cache and thinking that it was just some sort of caching issue that it didn't immediately occur to me what the real problem was.
The answer, for me at least: Even though you have a 16x16 version of your image in your .ico file, Visual Studio will instead use the 32x32 image and scale it down to 16x16, causing it to look distorted. I say VS did it because when I ran the executable on other machines (different Windows OS's), I saw the same behavior so it wasn't a Windows 8 issue, for me. (It might very well be a Windows issue in general though, I don't know. I did not take the time to verify what was actually inside of the generated .exe--did it contain MY 16x16 version, or 16x16 version generated by scaling down my 32px version? That would have confirmed it, I guess...)
My "aha" moment came when I added a few rows of red pixels to each size of my icon image, in a different section of my icon. So I put the red rows in my 16x16 at the bottom. My 32x32 had the red rows in the center, etc. So then I added this .ico to my project and started the project up and BAM, there was a distorted version of my 32x32 icon being used in the system tray as my notify icon. There was no doubt about it.
If you notice that your notify icon (at 16x16) looks more distorted than you would expect, you might use a similar strategy to see if this same automatic scaling is happening. When I figured this out, my quick solution was to add a .ico to my project that contained ONLY the 16x16 version of my icon image. I then use that resource image only for my notify icon. Obviously, if you did this (have a 16x16 only image) for forms, for example, you would see a very distorted icon in your taskbar, Alt-Tab list, etc., because Windows has no choice in that situation but to create the different icon image sizes by scaling your 16x16 because that's all that you supplied. Anyway, in my particular case, as I believe is yours as well, there was no issue using the .ico for forms--they show the actual embedded 16x16 version of the image and there is no "automatic downsizing" of the 32px version.
That's all I know. I did not spend anymore time on this issue because I had to move on. I hope this helps someone avoid some icon frustration. Why, oh why, VS would you do this to us!?
i had the same problem with a splash screen.
some how it did not change after replacing the picture.
what i did is i remove the images then save the form.
run the app and there was no image.
then i replaced them and the problem was fixed for me.
so maybe you can try the same with you're icons.
hope it will fix you're problem .
Open the file Resources.resx of your project with the editor. There you have to change name="Icon1" into name="YourIconName".

Open PathListBoxScrollBehavior WPF

I'm using blend 4 and vs 2010 to develop a port of an app from iPad to Windows Desktop.
I have a pathlistbox with PathListBoxScrollBehavior attached like in the carousel tutorial showed by Microsoft in the presentation of PathListBoxUtils.
My path is a open path (a line) and I don't want a infinite carousel but a path list box that go through the items but stops when comes in the last or first item. Am I being clear?
Something similar to what exist is on ios (similar to the cover flow effect too)
http://www.youtube.com/watch?v=YIWDlnvHRLw&feature=related
I know there are ways to do that but I can't find it.
There are a check box called WrapItems. When unchecked your Path List Box won't spin infinitely.
There are some bugs to solve yet but are specific to my project.
Hope this solution helps you too.

move desktop icons onto windows form when drag and drop?

im kind of confused, i used codes that enable you to drag and drop desktop icons/files/folders on windows forms, but how to show it inside the windows forms and the icon is still executable?
Most of the time GridControl is used to display the files.Its easy to display information about files in that way.But the best way to shows files depends on what do you want to do with the files.If you elaborate your problem then we can suggest.

How to know selected file in C#

I want to build a software.
This software will just get the path of currently selected file.
Suppose I click a file on my desktop.
Now I want to get the path of this file.
So whenever a new selection is made just get the path of newly selected file.
Any ideas?
The windows Desktop window is a ListView Control like in the end (at least it was in Windows XP...) so if you need to know selected item of a ListView you basically need to get the handle of the desktop and check what has been selected.
Not sure about windows Vista and 7 bit I guess it's not too different, as David has commented, if you want this for every single explorer window could be more difficult but should still be possible, have a look here for a start:
How do I get the window handle of the desktop?
Maybe you should look at the OpenFileDialog class
I think you can use what Shaun had said about looking at OpenFileDialog.
You can also refer to this link below:
How to use OpenFileDialog
That link also teaches you how to change the title, filtering files of type and 1 or 2 others regarding OpenFileDialog.
Hope this helps.

Categories

Resources