Sub Button1_Click
Dim noMe As NativeObject=Me
Log("getScrhotImage")
' remove it
ImageView1.Bitmap= noMe.runMethod("getScrhotImage",Null)
End Sub
#If OBJC
-(UIImage *)getScrhotImage
{
CGRect scrRect = [[UIScreen mainScreen] bounds];
UIGraphicsBeginImageContext(scrRect .size);
CGContextRef ctx = UIGraphicsGetCurrentContext();
[[UIColor blackColor] set];
CGContextFillRect(ctx, scrRect );
UIWindow *veiw= [UIApplication sharedApplication].keyWindow;
[veiw.layer renderInContext:ctx];
UIImage *image= UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
UIGraphicsEndImageContext();
return image;
}
#end if