コード例 #1
0
            //public Tensor GetArray()
            //{
            //    float[] r = new Tensor(new Shape(Width, Height));
            //    OpenGLControl.OpenGL.ReadPixels(0, 0, Width, Height, OpenGL.GL_R, OpenGL.GL_UNSIGNED_BYTE, r.get);
            //    self.window.flip()
            //    image_data = pyglet.image.get_buffer_manager().get_color_buffer().get_image_data()
            //    self.window.flip()
            //    arr = np.fromstring(image_data.data, dtype = np.uint8, sep = '')
            //    arr = arr.reshape(self.height, self.width, 4)
            //    return arr[::-1, :, 0:3]
            //}

            protected override void Dispose(bool disposing)
            {
                OpenGLControl.Dispose();
                base.Dispose(disposing);
            }