Hi, is possible to get and image from Control.. for example for all the content on a B4XView? Like a screenshoot of the control?.
Thanks..
Thanks..
#If OBJC
- (UIImage *) getViewScreenShot : (UIView *) view
{
UIGraphicsBeginImageContextWithOptions (view.frame.size, NO, 0.0);
[view.layer renderInContext: UIGraphicsGetCurrentContext ()];
UIImage * image = UIGraphicsGetImageFromCurrentImageContext ();
UIGraphicsEndImageContext ();
return image;
}
#End If
Dim noMe As NativeObject = Me
ImageView1.Bitmap = noMe.RunMethod ("getViewScreenShot:", Array (Button1))
ImageView2.Bitmap = noMe.RunMethod ("getViewScreenShot:", Array (B4XFloatTextField1.mBase))
Dim b As B4XView = pnlRo
Dim avc As ActivityViewController
avc.Initialize("avc", Array("Shared with you.", b.Snapshot))
Dim mp As Page = B4XPages.GetNativeParent(Me)
avc.Show(mp, pnl) 'Second parameter is relevant for iPad only. The arrow will point to the view.
Dim bmp As Bitmap = b.Snapshot.Crop(0,0,pnl.Width,pnl.Height)