What are good places to find free XAML images? - wpf

As I started using WPF at higher DPI resolutions, I got into troubles with scaling of toolbar images. XAML images solve that problem.
However I find it very hard to find free toolbar/ribbon XAML images that you can use in your own projects. What I found is usually not free and one probably needs more than few collections to get all needed images.
Where do you find your toolbar/ribbon .xaml images?

Check out the following link
Hidden features of WPF and XAML?
There is a list of converters that can take many formats of images and convert them to xaml for you.

Personally, I wind up using InkScape to create my XAML a lot. Even with my meager drawing skills, it's fairly easy to use and very effective.
As a note, though, I tend to work with the image in the native format and then save as XAML. Working with a file in XAML format seems to be somewhat unstable.

Related

Icons in WPF when to use image and when to use Xaml?

I am Working on a WPF based project where the design team have created the design in blend with some images like Edit, delete, checkbox etc. where i am prefring to use xaml insteed of images
Although i am sure that if the images are prety complex they should be used as images. but the simple im icon images can be used as xaml path designs. So i am looking for the recomandations. When to use Images in WPF design and When to use xaml for design.
If your application is going to be used in different screen resolutions then using Vector Graphics is recommended as they will scale nicely and all your images will look sharp regardless of the resolution of the screen. (There is a downside as well because your application needs to do the extra rendering of the xaml images to display them)
If you are using the images just to display the toolbar images (which are pretty much small and fixed size then you can get away by using png files as they will take less resources and easy to manage)

Preferred Vector Image format for use in WPF?

As per the title, what's the preferred image format (or formats) for use in WPF?
My company will hire a designer to design some logos, images, toolbar icons, etc. for use in a WPF application. I was going to ask for Vector Graphics as they are supposed to stretch, shrink, etc without loosing clarity;
However, reading this post
Does WPF support reading/writing WMF/EMF files natively?
and others has got me worried; IT DOES NOT SEEM LIKE A SIMPLE TASK?! isn't this what WPF is supposed to handle natively in its sleep ?! stretch, rotate, throw flames, make toast, etc...
The preferred vector image format is XAML. There are a lot of ways for a designer to generate those graphics. Adoble Illustrator for example can use the XAML exporter. The open source tool Inkscape can export to XAML directly, a designer can also draw XAML using Microsoft Expression Design and Microsoft Expression Blend. Literally all vector graphics tool support SVG and there are a lot of ways to convert SVG to XAML.
Don't bother with WMF/EMF it will just look ugly since windows can not render them antialiased.

How do you manage huge and barely maintainable XAML files?

I'm having real difficulties with XAML files in Silverlight since they get very big very fast when using Blend. It just becomes a wall of text after only a handful of controls are added and animated.
I'm hoping a better vesion of Blend will come out soon, so that our designers will never even have to see XAML. For now, though, that is not a solution - XAML still needs to be managed manually and it is a depressing task.
Has anyone found a solution to this? How do you keep your XAML files in order? How do you understand them when they get big?
Edit: I am especially interested in Silverlight solutions, since the most obvious WPF solution - splitting things up into resource dictionaries - is not supported in Silverlight.
It does require a little bit of work to maintain XAML files, but basically, what you need to do is split them up in resource files (XAML Resource Dictionaries) using a scheme that makes sense to you.
For example we use a scheme where we have a folder structure like this:
Resources (contains XAML Files that represent the user controls and pages)
Stencils (XAML files with Shapes)
Styles ( XAML Files with styles)
Brushes ( ... )
Shared
Templates ( ... )
Your structure might vary but, separating all resources in different files really makes maintenance more easy in the long run.
I have been using Silverlight 2 since January when it was in private release, and we ran into this problem, all our XAML was in one big file. What we did as best practices was to break up the user interface into separate user controls based on visual categorization (header, footer, navigation controls etc..) Originally we tried to use nested canvases (grids had not been added to the framework yet) and this turned into a maintenance nightmare later.
In Blend you can actually select a Canvas/grid etc... from the Objects and Timeline window, right click on it, and you are given the option "Make Control.." This made for speedy re factoring and modularizing our main XAML file. We then used Events to allow the user controls to communicate between each other.
Hope this helps, and good luck!
I'm a Creative Developer and work in Blend extensively.
I published a few thoughts last year on keeping XAML clean.
Silverlight currently does not support MergedResourceDictionaries so it's hard to break out the XAML into separate ResourceDictionary files as I suggested in another post.
Paul Stovell also has some interesting guidelines for XAML.

Sprite / Character animation in Silverlight (v2)

We have a Silverlight 2 project (game) that will require a lot of character animation. Can anyone suggest a good way to do this. Currently we plan to build the art in Illustrator, imported to Silverlight via Mike Snow's plug-in as this matches the skills our artists have.
Is key framing the animations our only option here? And if it is, what's the best way to do it? Hundreds of individual png's or is there some way in Silverlight to draw just a portion of a larger image?
You can use the Clip property on the image itself or on a container for the image to display a specific piece of a larger image, like a sprite sheet. This may or may not be more performant than swapping pngs. Also you could use the ImageBrush on a Rectangle to show just what you want, this would probably be a bit more efficient than the Clip property.
I just posted some code using Bill's suggestion regarding the Rectange and ImageBrush.
Silverlight at this time does not support bitmap effects nor has any libraries to manipulate the images. Your option now is to use keyframe animations from one png to another.
Now you can get at the raw bytes of an image. If you have your own image processing libraries you can compile them with the Silverlight dlls and then use the library in your Silverlight app.

HTML layout for winforms

Instead of arranging controls on a winform form by specifying pixel locations, I'd like to lay it out similar to the way you'd layout a form in html. This would make it scale better (for larger fonts etc).
Does anyone know of a layout library that allows you to define the form in xml and lay it out similar to html?
Have you checked out the TableLayoutPanel and FlowLayoutPanel in the .NET framework? It might be what you are looking for.
Yeah, it's called WPF :)
Seriously, there are some newer panel types in WinForms 2.0 that will let you place controls without setting Location and Size. They are FlowLayoutPanel and TableLayoutPanel.
You should also look into the AutoSize property. It takes care of sizing when the value of the label, say, changes. Also, don't forget about Docking and Anchoring.
Once you master those concepts, writing a little parser that converts from XML to controls shouldn't be that hard if you feel you really need it.
Not sure there is anything perfect for this.
MyXAML was kicking about a few years ago that enabled you to add forms in XML as opposed to embedding them into the binary. Not sure if that project is dead or not.
WinForm does have the flow layout control already
However if you want to do this kind of thing properly I think the only answer is to move to WPF.
You may also want to consider using Windows Presentation Foundation (WPF) instead of WinForms - WPF has an XML declarative markup language (XAML) that works well for defining scalable UI.
I've already got something like MyXAML - my screens are loaded from xml files already. It suffers the same problem as MyXAML which is that you still have to position the controls with pixel positions whereas I want something like html with the automatic flow and tables and such.
I think TableLayoutPanel might be what I'm looking for.
The only one I know of is a 3rd party from DevExpress called the LayoutControl..

Resources