With thanks to http://writeablebitmapex.codeplex.com/
Exemplo n.º 1
0
 private static void PopulateSurface(ColorSurface surface, WriteableBitmapWrapper writeableBitmap)
 {
     for (int y = 0; y < surface.Height; ++y)
         for (int x = 0; x < surface.Width; ++x)
         {
             var c = writeableBitmap.GetPixel(x, y);
             surface[x, y, 0] = (ColorF) c;
         }
 }
Exemplo n.º 2
0
        public static ColorSurface LoadFromFile(string uri)
        {
            BitmapImage bitmapImage = new BitmapImage(new Uri(uri));
            WriteableBitmapWrapper writeableBitmap = new WriteableBitmapWrapper(new WriteableBitmap(bitmapImage));

            ColorSurface surface = new ColorSurface(writeableBitmap.Width, writeableBitmap.Height, 1);
            PopulateSurface(surface, writeableBitmap);
            return surface;
        }
Exemplo n.º 3
0
		public static ColorSurface LoadFromFile(string uri)
		{
			BitmapImage bitmapImage = new BitmapImage(new Uri(uri));
			WriteableBitmapWrapper writeableBitmap = new WriteableBitmapWrapper(new WriteableBitmap(bitmapImage));

			ColorSurface surface = new ColorSurface(writeableBitmap.Width, writeableBitmap.Height, 1);
			PopulateSurface(surface, writeableBitmap);
			return surface;
		}
Exemplo n.º 4
0
		private static void PopulateSurface(ColorSurface surface, WriteableBitmapWrapper writeableBitmap)
		{
			for (int y = 0; y < surface.Height; ++y)
				for (int x = 0; x < surface.Width; ++x)
				{
					var c = writeableBitmap.GetPixel(x, y);
					surface[x, y, 0] = (ColorF) c;
				}
		}
Exemplo n.º 5
0
 public WriteableBitmapBuffer(WriteableBitmapWrapper writeableBitmap)
 {
     _writeableBitmap = writeableBitmap;
 }
Exemplo n.º 6
0
 public WriteableBitmapBuffer(WriteableBitmapWrapper writeableBitmap)
 {
     _writeableBitmap = writeableBitmap;
 }