Imageview over imageview (png over jpg) - c#

Many topics about his, but still haven't found my solution:
I'm working with Xamarin Studio: Within my launch screen I have one view with two ImageViews. The first image .jpg is being set to fill parent vertically and horizontally. The image that should go on top of the background image is a .png (transparent background with white lettering).
I have my BuildAction set to BundleResource and the image source of .png does not show the extension, just the image name. The problem is that the .png image is not showing up. Tried deleting the bin and obj folders and rebuilding, but without succes.

In your Info.plist make sure the value for Launch Screen is set to your LanchScreen.storyboard (might be different name for yours). Open that storyboard and place your UIImageViews in the desired order.
If you work with LaunchImages instead you need to compose your image beforehand in a picture editor.

Related

RibbonToggleButton displays image badly

I'm using Ribbon from RibbonControlsLibrary.dll 4.0.0.11019, .NET 4.0, C#, WPF.
It can be downloaded with a free samples here: http://www.microsoft.com/en-us/download/details.aspx?id=11877
The problem comes when a RibbonToggleButton is displayed. Then it's image seems to be a little bit broken, like a part of image is shifted for a few pixels.
EDIT: Thanks to kind people I can post and image now:
Here are some details:
Image is displayed in it's large variant
Image size is 32x32
I set image scaling to none for all the images of Ribbon
Image is broken only when the text in RibbonToggleButton has 1 line
Same image displays correctly in any other kind of button (RibbonButton, RibbonSplitButton etc.)
The image is displayed correctly when I set the font size in Windows to Medium (125%)
My OS is Windows 8
When I set the VerticalContentAlignment for the toggle button to "Bottom", the Image starts to display correctly, but the whole Ribbon starts to look ugly.
I experience this problem for all the toggle buttons, including those which are in a Microsoft's free samples.
I guess that probably the Image doesn't have enough space, so it's compressed from 32x32 to some smaller size.
I use the theme that is made of Microsoft's Generic theme, that is included in the RibbonControlsLibrary.dll. I guess I could fix the RibbonToggleButton template somehow, but I have no idea what to fix there.
Any ideas?
In the xaml declaration of your UserControl / Window put that line:
RenderOptions.BitmapScalingMode="HighQuality"

Display icon from the local resources in a form window with C#

I'm not sure if I'm missing something. I need to display a simple .ico file on my Windows Form in VS2010. I created a PictureBox on the form but when I go to its properties and select the .ico file in the InitialImage it tells me that I can't use it. It used to be so simple to do this with C++ ...
So how do I do this in a .NET C# project?
InitialImage is display while main image is loading. And if you need to set the main image you have to set Image property of the picture box.
but Icon can't set as InitialImage or Image directly so you can convert Icon to Bitmap by code as below
pictureBox1.Image = Resources.Icon1.ToBitmap();
Have you tried using the ToBitmap function of the Icon object? Load up the ICO file into the Icon class and then just invoke this method - and you'll have a bitmap that is usable on the PictureBox.

WPF and thumbnail

I'm new to this concept but I'm sure there should be solution to it. I'm storing a design (a series of lines and shapes) as XML, also can save/load the drawing into/from XML file.
Now, new idea is:
1) How to show a thumbnail of the drawing such could be placed on a toolbar or panel (as toolbox)
2) By dragging/dropping of this thumbnail on a canvas it will open and show the drawing.
You should know more about "ViewBox" that is made for thumbnail things and it has many other usages. You can give it any WPF contents and it will do the thumbnail thing by some specific options.
Cheers

How to crop and resize an image for a LiveTile

I would like to be able to add an image to a live tile so that there is no stretching and the image looks normal. I am getting my images from the PhotoChooserTask, which contain images from the medialibrary. As of now I can successfully place an image on a live tile, but it is stretched and the aspect ratio is not correct. How would I be able to find the aspect ratio of the image and crop the image so that it ends up being a square with dimensions 173x173 with no streching? I have followed a couple tutorials found online but nothing seems to accomplish this the way I need it to.
I accomplished this by referencing Resize image for Live Tile - WriteableBitmapEx which proved to have the correct implementation.

Listview icons show up blurry (C#)

I'm attempting to display a "LargeIcon" view in a listview control, however the images I specify are blurry. This is what I have so far:
alt text http://img220.imageshack.us/img220/1005/blurryiconsql3.jpg
The .png files are 48x48 and that's what I have it set to display at in the ImageList properties. There's one thing that I've noticed (which is probably the cause) but I don't know how to change it. Inside the "Images Collection Editor" where you choose what images you want for the ImageList control, it looks like it's setting the wrong size for each image.
alt text http://img83.imageshack.us/img83/5218/imagepropertiesmf9.jpg
As you can see the "PhysicalDimension" and the "Size" is set to 16x16 and not abled to be manipulated. Does anyone have any ideas? Many thanks!
Be sure to set ImageList.ImageSize to 48 x 48 too.
When adding a .PNG Icon format size the editor tends to pick the first entry size in that file, so it picks up the 16x16 entry and it's stretching that out. That's why you see the 16x16 in the properties there. As suggested, the support for PNG is poor, I'm often found myself rolling over to another format as well to avoid this.
You can open the file in Paint.Net if you need a free editor or something more fully featured like Photoshop or Fireworks and extract the exact size you want.
I'm not sure if its the problem in this specific case, but Microsoft support for the PNG format is generally poor. Try adding the images in .bmp format and they should display fine.
Check also the ColorDepth setting on your ImageList. I had a similar issue with a TreeView control, but after reading the previous posting regarding the size I found this setting, played around with it a bit and found that it greatly affects the way images from an ImageList are rendered. The higher the depth the better the quality.
Be sure to set the ImageList size to 48x48 px BEFORE you add the images.
If the ImageList is set to 32x32 and you add a 48x48 image, the icon is resized to 32x32. When you change the ImageList to 48x48 afterwards, the image is just resized again, thus losing quality and going blurry.
Also, Paint.NET (or Photoshop) can't open .ico files.
Visual Studio/.NET can handle 32-bit PNG images fine, the built-in image editor in VS is a bit lack-lustre though.

Categories

Resources