Exemplo n.º 1
0
        public void VGSwapBuffers()
        {
            Dispatcher.BeginInvoke(DispatcherPriority.Normal,
                                   new Action(
                                       delegate
            {
                var image = new byte[kWidth * kHeight * 4];

                // Copy the array to unmanaged memory.
                Marshal.Copy(VgContext.vgGetSurfacePixelsAM(), image, 0, image.Length);
                var wbi = new WriteableBitmap(kWidth, kHeight, 96.0f, 96.0f, PixelFormats.Bgra32, null);
                wbi.WritePixels(new Int32Rect(0, 0, wbi.PixelWidth, wbi.PixelHeight), image, (wbi.PixelWidth * wbi.Format.BitsPerPixel) / 8, 0);
                mImage.Source = wbi;
            }
                                       ));
        }
Exemplo n.º 2
0
 static void VGDestroy()
 {
     VgContext.vgDestroyContextAM();
 }
Exemplo n.º 3
0
 static uint VGInit()
 {
     return((uint)VgContext.vgInitContextAM(kWidth, kHeight, VGboolean.VG_TRUE));
 }