美文网首页
UIGraphics.h

UIGraphics.h

作者: ShenYj | 来源:发表于2016-09-02 21:07 被阅读324次
    
    #import <Foundation/Foundation.h>
    #import <CoreGraphics/CoreGraphics.h>
    #import <UIKit/UIKitDefines.h>
    
    @class UIImage;
    
    UIKIT_EXTERN CGContextRef UIGraphicsGetCurrentContext(void);   // 获得当前的图形上下文
    
    UIKIT_EXTERN void UIGraphicsPushContext(CGContextRef context);
    UIKIT_EXTERN void UIGraphicsPopContext(void);
    
    UIKIT_EXTERN void UIRectFillUsingBlendMode(CGRect rect, CGBlendMode blendMode);
    UIKIT_EXTERN void UIRectFill(CGRect rect);
    
    UIKIT_EXTERN void UIRectFrameUsingBlendMode(CGRect rect, CGBlendMode blendMode);
    UIKIT_EXTERN void UIRectFrame(CGRect rect);
    
    UIKIT_EXTERN void UIRectClip(CGRect rect);
    
    #pragma - mark 这个方法生成的图片没有下面的清晰
    UIKIT_EXTERN void     UIGraphicsBeginImageContext(CGSize size);
    /**
     *  @param size         图片尺寸,使用像素
     *  @param opaque       不透明度,使用NO图片更清晰
     *  @param scale        伸缩尺寸 0.0则是根据屏幕尺寸进行伸缩
     */
    UIKIT_EXTERN void     UIGraphicsBeginImageContextWithOptions(CGSize size, BOOL opaque, CGFloat scale) NS_AVAILABLE_IOS(4_0);
    #pragma - mark 获取上下文中绘制的图片
    UIKIT_EXTERN UIImage* UIGraphicsGetImageFromCurrentImageContext(void);
    #pragma - mark 结束绘制图片
    UIKIT_EXTERN void     UIGraphicsEndImageContext(void); 
    
    #pragma - mark PDF
    UIKIT_EXTERN BOOL UIGraphicsBeginPDFContextToFile(NSString *path, CGRect bounds, NSDictionary *documentInfo) NS_AVAILABLE_IOS(3_2);
    UIKIT_EXTERN void UIGraphicsBeginPDFContextToData(NSMutableData *data, CGRect bounds, NSDictionary *documentInfo) NS_AVAILABLE_IOS(3_2);
    UIKIT_EXTERN void UIGraphicsEndPDFContext(void) NS_AVAILABLE_IOS(3_2);
    
    UIKIT_EXTERN void UIGraphicsBeginPDFPage(void) NS_AVAILABLE_IOS(3_2);
    UIKIT_EXTERN void UIGraphicsBeginPDFPageWithInfo(CGRect bounds, NSDictionary *pageInfo) NS_AVAILABLE_IOS(3_2);
    
    UIKIT_EXTERN CGRect UIGraphicsGetPDFContextBounds(void) NS_AVAILABLE_IOS(3_2);
    
    UIKIT_EXTERN void UIGraphicsSetPDFContextURLForRect(NSURL *url, CGRect rect) NS_AVAILABLE_IOS(3_2);
    UIKIT_EXTERN void UIGraphicsAddPDFContextDestinationAtPoint(NSString *name, CGPoint point) NS_AVAILABLE_IOS(3_2);
    UIKIT_EXTERN void UIGraphicsSetPDFContextDestinationForRect(NSString *name, CGRect rect) NS_AVAILABLE_IOS(3_2);
    
    
    

    相关文章

      网友评论

          本文标题:UIGraphics.h

          本文链接:https://www.haomeiwen.com/subject/erlkettx.html