mac iphone ipad 截图六方法汇总

方法一:

原生态,Command-Shift-3 直接把整个桌面作为 PNG 格式保存

 Command-Shift-4功能类似,但可以自由圈定范围了 。Ctrl+Command-Shift-3. 可以控制文件保存的位置,但格式变化不了


方法二:

grab,自带一个程序,较灵活,支持4个方式选择图形,文件自由保存到任何位置。

grab-menu.png

方法三:

Xcode’s Organizer 工具提供一个简单的接口可以抓取真机上的截图,类似Android的那个插件一样, 打开方式如下:打开Xcode’s Window 菜单 ,选择 Organizer或则用快捷键Ctrl-Command-O. 然后选择device tab,就可以看到链接到mac的 真机上的画面,iphone 或ipad。

方法四:

iphone

这个方法有些tricky,长按home按钮,同时按下上方的sleep按钮,最大程度组合了两个hard keys.

方法五:

用程序来抓取,特定的 view

The second method, saveScreenshottoPhotosAlbum,takes it a step further and saves an image that contains a render of any UIView to your iPhone’s photo album.

#import 
 
- (UIImage*)captureView:(UIView )view {
	CGRect rect = [[UIScreen mainScreen] bounds];
	UIGraphicsBeginImageContext(rect.size);
	CGContextRef context = UIGraphicsGetCurrentContext();
	[view.layer renderInContext:context];
	UIImage *img = UIGraphicsGetimageFromCurrentimageContext);
	UIGraphicsEndImageContext);
	return img;
}
 
(void)saveScreenshottoPhotosAlbum{
	UIImageWritetoSavedPhotosAlbum[self captureView:view],nil,144)">nil);
}
- (UIImage*) getGLScreenshot {
    NSInteger myDataLength = 320 * 480 * 4;
 
    // allocate array and read pixels into it.
    glubyte *buffer = (glubyte *) malloc(myDataLength);
    glreadPixels(0,320,480,GL_RGBA,GL_UNSIGNED_BYTE,buffer);
 
    // gl renders "upside down" so swap top to bottom into new array.
    // there's gotta be a better way,but this works.
    glubyte *buffer2 = (glubyte *) malloc(myDataLength);
    for(int y = 0; y <480; y++)
    {
        for(int x = 0; x <320 * 4; x++)
        {
            buffer2[(479 - y) * 320 * 4 + x] = buffer[y * 4 * 320 + x];
        }
    }
 
    // make data provider with data.
    CGDataProviderRef provider = CGDataProviderCreateWithData(NULL,buffer2,myDataLength,NULL);
 
    // prep the ingredients
    int bitsPerComponent = 8;
    int bitsPerPixel = 32;
    int bytesPerRow = 4 * 320;
    CGColorSpaceRef colorSpaceRef = CGColorSpaceCreateDeviceRGB();
    CGBitmapInfo bitmapInfo = kCGBitmapByteOrderDefault;
    CGColorRenderingIntent renderingIntent = kCGRenderingIntentDefault;
 
    // make the cgimage
    CGImageRef imageRef = CGImageCreate(320,bitsPerComponent,bitsPerPixel,bytesPerRow,colorSpaceRef,bitmapInfo,provider,NULL,NO,renderingIntent);
 
    // then make the uiimage from that
    UIImage *myImage = [UIImage imageWithCGImage:imageRef];
    return myImage;
}
 
- (void)saveGLScreenshottoPhotosAlbum {
	UIImageWritetoSavedPhotosAlbum([self getGLScreenshot],nil,nil);
}

上面的第二段代码支持eagalview了。

可以通过程序来控制什么时候保留一个操作画面截图,在某些软件中说不定会有用的 。。。。。。

方法六:


iPhone-Simulator Cropper.

iPhone-Simulator Cropper

This tool works by capturing the screen of the simulator runnning on your system. One really slick feature is the option to create captured images in two primary formats – first,a format suitable for upload to iTunes for your application screenshots – second,capturing a screenshot that is suitable for display on a website.

The following images show the iPhone-Simulator Cropper application,as well as two sample images captured:

iTunes Connect / App Store:

Website (iPhone Device from Apple Marketing):

相关文章

UITabBarController 是 iOS 中用于管理和显示选项卡界面的一...
UITableView的重用机制避免了频繁创建和销毁单元格的开销,使...
Objective-C中,类的实例变量(instance variables)和属性(...
从内存管理的角度来看,block可以作为方法的传入参数是因为b...
WKWebView 是 iOS 开发中用于显示网页内容的组件,它是在 iO...
OC中常用的多线程编程技术: 1. NSThread NSThread是Objecti...