Esempio n. 1
0
 private static Brush ConvertBrush(M.Brush b)
 {
     M.SolidColorBrush b2 = b as M.SolidColorBrush;
     if (b2 == null)
         return Brushes.White;
     return new SolidBrush(Color.FromArgb(b2.Color.A, b2.Color.R, b2.Color.G, b2.Color.B));
 }
Esempio n. 2
0
		Color ConvertToSystemDrawingColor(Wpf.Color? color, Wpf.Color defaultColor)
		{
			Wpf.Color colorValue = defaultColor;
			if (color.HasValue) {
				colorValue = color.Value;
			}
			return Color.FromArgb(colorValue.A, colorValue.R, colorValue.G, colorValue.B);
		}
Esempio n. 3
0
 public static Icon Generate(double percent, M.Brush c0a, M.Brush c1a)
 {
     Bitmap bmp = new Bitmap(16, 16, PixelFormat.Format24bppRgb);
     using (Graphics g = Graphics.FromImage(bmp))
     {
         //g.FillEllipse(Brushes.Red, 0, 0, 16, 16);
         // Greenscreen effect - set everything to a transparent colour
         // determined by what is at 0,15.
         g.FillRectangle(Brushes.LawnGreen, 0, 0, 16, 16);
         g.FillPie(ConvertBrush(c1a), 1.0f, 1.0f, 14.0f, 14.0f, 0.0f, 360.0f);
         g.FillPie(ConvertBrush(c0a), 1.0f, 1.0f, 14.0f, 14.0f, -90.0f, (float)(360.0f * percent));
     }
     return Converter.BitmapToIcon(bmp);
 }
Esempio n. 4
0
		UInt32 GetOleColor(Wpf.Color? color, Wpf.Color defaultColor)
		{
			var convertedColor = ConvertToSystemDrawingColor(color, defaultColor);
			return (UInt32)ColorTranslator.ToOle(convertedColor);
		}
Esempio n. 5
0
		public MatrixHandler (swm.Matrix matrix)
		{
			control = matrix;
		}
Esempio n. 6
0
 public static Gdi.Color WpfColorToGdiColour(Wpf.Color wpfC)
 {
     return Gdi.Color.FromArgb(wpfC.A, wpfC.R, wpfC.G, wpfC.B);
 }
Esempio n. 7
0
 public static void Deallocate(WIC.DrawingVisual jpg)
 {
     jpg = null;
 }
Esempio n. 8
0
 public static void Deallocate(WIC.DrawingGroup jpg)
 {
     jpg = null;
 }
Esempio n. 9
0
 public static void Deallocate(WIC.RectangleGeometry rect)
 {
     rect = null;
 }
Esempio n. 10
0
 public static void Deallocate(WIC.GeometryDrawing geo)
 {
     geo = null;
 }
Esempio n. 11
0
 public static void Deallocate(WIC.DrawingImage gImg)
 {
     gImg = null;
 }
Esempio n. 12
0
 public static void Deallocate(WIC.DrawingBrush dBrush)
 {
     dBrush = null;
 }
Esempio n. 13
0
 public static void Deallocate(WIC.ImageBrush iBrush)
 {
     iBrush = null;
 }