ios - Category on UIImage to return a blank UIImage? -


how create uiimage context can return it? want have transparent pixels. have different method adds smaller uiimages larger one, need blank slate begin with.

+ (uiimage *)blankuiimageofsize:(cgsize)size {     uigraphicsbeginimagecontextwithoptions(size, no, 1);      ...?     } 

the following should work:

+ (uiimage *)blankuiimageofsize:(cgsize)size {     uigraphicsbeginimagecontextwithoptions(size, no, 1);      cgcontextref ctx = uigraphicsgetcurrentcontext();     cgcontextclearrect(ctx, cgrectmake(0, 0, area.width, area.height));      uiimage *newimage = uigraphicsgetimagefromcurrentimagecontext();      uigraphicsendimagecontext();      return newimage; } 

Comments

Popular posts from this blog

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -