How to change images and icons in the component UI? (WinForms, WPF)
Last modified:
Q:
How to change any image in the component UI?
A:
WinForms
We've implemented a new mechanism to alter AQB resources (images, strings). The easiest way is as follows:
ActiveQueryBuilder.View.WinForms.Images.Metadata.Schema.Value = new Bitmap("c:\\...\\pencil.png");
You can add several glyphs of different size to one image. The image to display at the moment will be chosen according to the current screen DPI.
ActiveQueryBuilder.View.WinForms.Images.Metadata.Schema.Items.Clear(); ActiveQueryBuilder.View.WinForms.Images.Metadata.Schema.Items.Add(new Bitmap("c:\\...\\pencil.png"));
WPF
You can define glyphs as Image (raster) and Canvas (vector) objects. You can convert your SVG images to XAML format using graphical tools like InkSpace. For vector images, you can define the default size to display.
ActiveQueryBuilder.View.WPF.Images.DataSourceControl.Menu.Value = new CImage(Resources["CanvasTaxi"] as Canvas) {DefaultSize = new Size(16, 16)};