??
Common use of Imagepickercontroller to obtain DIC after using
?
UIImage *image = [dic objectforkey:@ "Uiimagepickercontrolleroriginalimage"];
To get the original image, but I used this method to get the picture is not the original, but the size after compression, and then found a new way to get the direct sticker code
?
[CPP]? View Plaincopy
- Alassetslibrary?*library?=? [[Alassetslibrary?alloc]?init];??
- ????? [Library?assetforurl:[dic?objectforkey:uiimagepickercontrollerreferenceurl]??
- ?????????????? resultblock:^ (alasset?*asset)??
- ?????? {??
- ?????????? Alassetrepresentation?*representation?=? [Asset?defaultrepresentation];??
- ?????????? Cgimageref?imgref?=? [Representation?fullresolutionimage];??
- ?????????? Uiimage?*image?=? [Uiimage?imagewithcgimage:imgref??
- ????????????????????????????????????????????? Scale:representation.scale??
- ??????????????????????????????????????? Orientation: (uiimageorientation) representation.orientation];??
- ?????????? Nsdata?*?data?=? UIImageJPEGRepresentation (image,?0.5);??????????????????
- ??
- ??????} failureblock:^ (nserror?*error) {??
- ?????????? NSLog (@"couldn ' t?get?asset:?%@",? error);? ?
- ??????}??
- ??????];??
Get album pictures without using Uiimagepickercontrolleroriginalimage