2
0
Mark Sibly 9 жил өмнө
parent
commit
4bf7a1b3bc

+ 11 - 0
modules/mojo/graphics/device.monkey2

@@ -209,6 +209,17 @@ Class GraphicsDevice
 		
 		_modified=True
 	End
+	
+	Method CopyPixmap:Pixmap( rect:Recti )
+	
+		Validate()
+
+		Local pixmap:=New Pixmap( rect.Width,rect.Height,PixelFormat.RGBA32 )
+		
+		glReadPixels( rect.X,rect.Y,rect.Width,rect.Height,GL_RGBA,GL_UNSIGNED_BYTE,pixmap.Data )
+		
+		Return pixmap
+	End
 
 	Private