How to take a screenshot programmatically on iOS

Considering a check for retina display use the following code snippet: #import <QuartzCore/QuartzCore.h> if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)]) { UIGraphicsBeginImageContextWithOptions(self.window.bounds.size, NO, [UIScreen mainScreen].scale); } else { UIGraphicsBeginImageContext(self.window.bounds.size); } [self.window.layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); NSData *imageData = UIImagePNGRepresentation(image); if (imageData) { [imageData writeToFile:@”screenshot.png” atomically:YES]; } else { NSLog(@”error while taking screenshot”); }

How to prevent Screen Capture in Android

I’m going to say that it is not possible to completely prevent screen/video capture of any android app through supported means. But if you only want to block it for normal android devices, the SECURE FLAG is substantial. 1) The secure flag does block both normal screenshot and video capture. Also documentation at this link … Read more

Capture screenshot of active window?

Rectangle bounds = Screen.GetBounds(Point.Empty); using(Bitmap bitmap = new Bitmap(bounds.Width, bounds.Height)) { using(Graphics g = Graphics.FromImage(bitmap)) { g.CopyFromScreen(Point.Empty, Point.Empty, bounds.Size); } bitmap.Save(“test.jpg”, ImageFormat.Jpeg); } for capturing current window use Rectangle bounds = this.Bounds; using (Bitmap bitmap = new Bitmap(bounds.Width, bounds.Height)) { using (Graphics g = Graphics.FromImage(bitmap)) { g.CopyFromScreen(new Point(bounds.Left,bounds.Top), Point.Empty, bounds.Size); } bitmap.Save(“C://test.jpg”, ImageFormat.Jpeg); }

Take a full page screenshot with Firefox on the command-line

The Developer Toolbar GCLI and Shift+F2 shortcut were removed in Firefox version 60. To take a screenshot in 60 or newer: press Ctrl+Shift+K to open the developer console (⌥ Option+⌘ Command+K on macOS) type :screenshot or :screenshot –fullpage Find out more regarding screenshots and other features For Firefox versions < 60: Press Shift+F2 or go … Read more

Website screenshots

LAST EDIT: after 7 years I’m still getting upvotes for this answer, but I guess this one is now much more accurate. Sure you can, but you’ll need to render the page with something. If you really want to only use php, I suggest you HTMLTOPS, which renders the page and outputs it in a … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)