关于这个网上目前位置记录的资料比较少,记录一下这个坑 获取相册图片 1: var iPC = UIImagePickerController() 2: iPC.sourceType = UIImagePickerControllerSourceType.SavedPhotosAlbum 3: iPC.delegate = self 4: presentViewController(iPC, animated: true) { () -> Void in 5: print("complete…
修正iOS从照相机和相册中获取的图片 方向   修正iOS从照相机和相册中获取的图片 方向 使用系统相机拍照得到的图片的默认方向有时不是ImageOrientationDown,而是ImageOrientationLeft,在使用的时候会出现图片顺时针偏转90°.使用fixOrientation方法修正这个问题. - (UIImage *)fixOrientation { // No-op if the orientation is already correct if (self.imageO…
实现效果 操作步骤 绘制一个矩形框,弹出一个alertView,提示是否保存图片 点击"是",将图片保存到相册 在相册中查看保存的图片 效果图 实现思路 在控制器的view上添加一个imageView,设置图片 在控制器的view上添加一个pan手势 跟踪pan手势,绘制一个矩形框(图片的剪切区域) 在pan手势结束时,通过alertView提示"是否将图片保存至相册?" 点击"是",保存图片 点击"否",暂时什么都不做 实现…
导语: 如今的安卓应用在选择图片的处理上大多合并使用拍照和从相册中选择这两种方式 今天在写一个这样的功能时遇到一个尴尬的问题,同样是拍照获取图片功能,在不同手机上运行的效果不一样,下面是在某型手机上测试的报错结果 错误报告: 10-21 17:41:43.634: E/AndroidRuntime(32683): FATAL EXCEPTION: main 10-21 17:41:43.634: E/AndroidRuntime(32683): java.lang.RuntimeExceptio…
/// <summary> /// 获取资源图片 /// </summary> public class AssemblyHelper { #region 常量 /// <summary> /// 程序集名称 /// </summary> private static string CurrentAssemblyName = Assembly.GetExecutingAssembly().GetName().Name; #endregion #region…
//android把图片文件添加到相册 ContentResolver localContentResolver = getContentResolver(); ContentValues localContentValues = getImageContentValues(MonitorActivity.this, file, System.currentTimeMillis()); localContentResolver.insert(MediaStore.Images.Media.EXT…
- (UIImage *)fixOrientation { // No-op if the orientation is already correct if (self.imageOrientation == UIImageOrientationUp) return self; // We need to calculate the proper transformation to make the image upright. // We do it in 2 steps: Rotate i…
使用系统相机拍照得到的图片的默认方向有时不是ImageOrientationDown,而是ImageOrientationLeft,在使用的时候会出现图片顺时针偏转90°.使用fixOrientation方法修正这个问题. - (UIImage *)fixOrientation { // No-op if the orientation is already correct if (self.imageOrientation == UIImageOrientationUp) return sel…
NSURL *imageRefURL = [info valueForKey:UIImagePickerControllerReferenceURL];                                        ALAssetsLibrary* assetLibrary = [[ALAssetsLibrary alloc] init];                    void (^ALAssetsLibraryAssetForURLResultBlock)(ALAss…
在项目中有时候要添加一些配置文件然后在程序中读取相应的配置信息,以下为本人整理的获取项目配置文件(.plist)路径的方法: 1.获取沙盒路径后再APPEND配置文件 func documentsDirectory() ->String { var paths = NSSearchPathForDirectoriesInDomains(NSSearchPathDirectory.DocumentationDirectory, NSSearchPathDomainMask.UserDomainMa…