Ejemplo n.º 1
0
        public PixcelImage(Bitmap bitmap)
        {
            LayerType = ImageTypes.Pixel;

            BitmapData data = bitmap.LockBits(
                new Rectangle(0, 0, bitmap.Width, bitmap.Height),
                ImageLockMode.ReadWrite,
                PixelFormat.Format32bppArgb);

            imageData = new BGRA32FormattedImage(data.Width, data.Height);
            Rect      = new IBRectangle(data.Width, data.Height);
            unsafe
            {
                byte *ptr = (byte *)data.Scan0;
                for (int i = 0; i < data.Stride * data.Height; i++)
                {
                    imageData.data[i] = ptr[i];
                }
            }
            imageData.TextureUpdate();
        }
Ejemplo n.º 2
0
 public PixcelImage(int w, int h, int offsetX, int offsetY)
 {
     imageData = new BGRA32FormattedImage(w, h);
     Rect      = new IBRectangle(w, h, offsetX, offsetY);
 }
Ejemplo n.º 3
0
 private void Current_Exit(object sender, ExitEventArgs e)
 {
     // GLコントロールがDisposeされる前にコールしないとだめらしい
     BGRA32FormattedImage.FinalizeBGRA32FormattedImage();
 }