[library writeImageToSavedPhotosAlbum:[image CGImage]
                                                                                           orientation:(ALAssetOrientation)[image imageOrientation]

                                                                                       completionBlock:completionBlock];

戮克 發表在 痞客邦 留言(0) 人氣()

UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"結果"                                                                                                          message:@"腳長"                                                                                                              delegate:self                                                                                                 cancelButtonTitle:@"OK"                                                                                                    otherButtonTitles: nil]; 
 [alert show];

戮克 發表在 痞客邦 留言(0) 人氣()

設定路徑
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask, YES);
                                                                 
NSString *documentsDirectory = [paths objectAtIndex:0];
                                                                 
NSString* path = [documentsDirectory stringByAppendingPathComponent:

                                                                                   
[NSString stringWithString: @"test.jpg"] ];

戮克 發表在 痞客邦 留言(0) 人氣()



未解決之前問題可能的方法
在<application>裡面
加上android:largeHeap="true"
有圖檔處理過大或其他原因發生OOM的朋友試試看吧

缺點:系統所沛羽的空間越大,在GC(資源回收)上會越慢。

說明___________________________________________________________________________
android:largeHeap
Whether your application's processes should be created with a large Dalvik heap. This applies to all processes created for the application. It only applies to the first application loaded into a process; if you're using a shared user ID to allow multiple applications to use a process, they all must use this option consistently or they will have unpredictable results.
Most apps should not need this and should instead focus on reducing their overall memory usage for improved performance. Enabling this also does not guarantee a fixed increase in available memory, because some devices are constrained by their total available memory.
To query the available memory size at runtime, use the methods getMemoryClass() orgetLargeMemoryClass().

戮克 發表在 痞客邦 留言(0) 人氣()

import dalvik.system.VMRuntime;
這方法可以直接設定ANDROID
但在"android SDK API 9"之後版本就刪掉了"無法使用"...
之後的版本要使用需引用額外的JAR
至於要引入哪了還在測試


最後發現可以試試這個android:largeHeap="true"

戮克 發表在 痞客邦 留言(0) 人氣()

發生原因是照片的解析度太好檔案太大,導致記憶體不足。壓縮圖檔就可以解決...但我目前正在嘗試不壓縮的方法還在研究。


錯誤訊息----------------------------------------------------------------
FATAL EXCEPTION: main
Process: com.global_trade.iFeet01, PID: 18793
java.lang.OutOfMemoryError
at android.graphics.BitmapFactory.nativeDecodeByteArray(Native Method)

戮克 發表在 痞客邦 留言(0) 人氣()