惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
Visual Studio Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
T
The Blog of Author Tim Ferriss
宝玉的分享
宝玉的分享
The Register - Security
The Register - Security
D
Docker
The Cloudflare Blog
A
About on SuperTechFans
Microsoft Security Blog
Microsoft Security Blog
Recent Announcements
Recent Announcements
月光博客
月光博客
B
Blog RSS Feed
博客园 - 【当耐特】
The GitHub Blog
The GitHub Blog
B
Blog
IT之家
IT之家
美团技术团队
Engineering at Meta
Engineering at Meta
C
Check Point Blog
云风的 BLOG
云风的 BLOG
Last Week in AI
Last Week in AI
G
Google Developers Blog
MongoDB | Blog
MongoDB | Blog
Microsoft Azure Blog
Microsoft Azure Blog
S
SegmentFault 最新的问题
V
V2EX
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Apple Machine Learning Research
Apple Machine Learning Research
U
Unit 42
H
Help Net Security
雷峰网
雷峰网
人人都是产品经理
人人都是产品经理
博客园 - 司徒正美
Stack Overflow Blog
Stack Overflow Blog
博客园 - Franky
PCI Perspectives
PCI Perspectives
J
Java Code Geeks
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
M
MIT News - Artificial intelligence
腾讯CDC
A
Arctic Wolf
C
CERT Recently Published Vulnerability Notes
量子位
C
CXSECURITY Database RSS Feed - CXSecurity.com
Latest news
Latest news
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
The Hacker News
The Hacker News
有赞技术团队
有赞技术团队
Schneier on Security
Schneier on Security
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻

博客园 - Bruce Lee

Android的界面设计规范-7 Android的界面设计规范-6 Android的界面设计规范-5 Android的界面设计规范-4 Android的界面设计规范-3 Android的界面设计规范-2 Android的界面设计规范-1 Monotouch 移动位于键盘下的内容,自动滚动被键盘遮住的内容 RESTful Web Services,客户端Silverlight提交POST数据报错 Monotouch Copy item from album(从相册拷贝文件出来) Monotouch中使用UINavigationController Monotouch 项目选择Storyborads还是XIBs Montouch 定义一个定制的 View Control类 Monotouch 视图管理周期 Montouch多视图的创建与销毁 Monotouch 常用例子代码 Monotouch在IPAD与IPhone使用UIImagePickerController的图片选择不同的代码 Montouch 增加图片到模拟器(Simulator)的相册中 Monotouch Table View 里面动态增加Table View Cell Switch 触发Switch事件 程序崩溃
Monotouch Save Image To Application(保存相册图片到你的应用程序)
Bruce Lee · 2012-10-20 · via 博客园 - Bruce Lee

直接贴代码了

   1: public override void FinishedPickingMedia(UIImagePickerController picker, NSDictionary info)
   2: {
   3:     //使用下面方式保存图片到你的应用程序中
   4:     UIImage image = (UIImage)info.ObjectForKey(new NSString("UIImagePickerControllerOriginalImage"));
   5:     NSData imageData = image.AsJPEG();
   6:     byte[] imageBytes = new byte[imageData.Length];
   7:     int length = (int)imageData.Length;
   8:     Marshal.Copy(imageData.Bytes, imageBytes, 0, length);
   9:     string destPath = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
  10:     string fileName = "picture.jpg";
  11:     string filePath = Path.Combine(destPath, fileName);
  12:     File.WriteAllBytes(filePath, imageBytes);          
  13:     picker.DismissModalViewControllerAnimated(true);
  14: }

作者:Bruce Lee
出处:http://www.cnblogs.com/BruceLee521
本博原创文章版权归博客园和本人共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出作者名称和原文连接,否则保留追究法律责任的权利。