我正在iphone應用程序上工作,我需要將圖像保存爲.tiff格式。 使用UIImagePNGRepresentation方法和使用UIImageJPEGRepresentation的JPEG格式可以將圖像保存爲png格式。但我需要將通過imageview捕獲的簽名保存爲tiff格式。 我無法使用NSImage類,因此我可以調用TIFFRepresentation方法。 我該怎麼做。發送我的建議... 在此先感謝...iPhone應用程序的TIFF圖像格式
1
A
回答
0
嗯,我不開發的iPhone,所以不能告訴你,如果有一個神奇的API的方式做到這一點,但很多年前我不得不手動創建TIFF圖像。
TIFF格式是有點怪的,如果你已經習慣了只使用一個框架的CreateThisStuffAsAnImage()方法,但你可以在這裏得到規範和自己創建的文件:
http://partners.adobe.com/public/developer/tiff/index.html#spec
1
我不不知道你的意思是「被imageview捕獲」。直到iOS 4才引入保存爲TIFF的手段。下面是將任意文件保存爲TIFF的示例代碼;您可以使用任何文件格式的數據執行此操作,無論您如何獲得它。你需要鏈接到ImageIO框架並做#import <ImageIO/ImageIO.h>
:
NSURL* url = [[NSBundle mainBundle] URLForResource:@"colson" withExtension:@"jpg"];
CGImageSourceRef src = CGImageSourceCreateWithURL((CFURLRef)url, NULL);
NSFileManager* fm = [[NSFileManager alloc] init];
NSURL* suppurl = [fm URLForDirectory:NSApplicationSupportDirectory
inDomain:NSUserDomainMask
appropriateForURL:nil
create:YES error:NULL];
NSURL* tiff = [suppurl URLByAppendingPathComponent:@"mytiff.tiff"];
CGImageDestinationRef dest = CGImageDestinationCreateWithURL((CFURLRef)tiff,
(CFStringRef)@"public.tiff", 1, NULL);
CGImageDestinationAddImageFromSource(dest, src, 0, NULL);
bool ok = CGImageDestinationFinalize(dest);
NSLog(@"result %i", ok); // 1, all went well
// and don't forget memory management, release source and destination, NSFileManager
[fm release]; CFRelease(src); CFRelease(dest);
相關問題
- 1. 在Android應用程序中顯示TIFF格式圖像
- 2. TIFF圖像文件格式
- 3. iPhone/iPad應用程序圖像格式最佳做法
- 4. 在Android中顯示TIFF格式圖像
- 5. iPhone應用程序中的圖像
- 6. Like in iPhone應用程序的圖像
- 7. 顯示圖像的iPhone應用程序
- 8. 問題!在我的iOS4應用程序中添加.tiff圖像
- 9. 使用xamarin格式將圖像轉換爲iPhone應用程序的字節
- 10. 圖像託管爲iPhone應用程序
- 11. 圖像增強在iPhone應用程序
- 12. iphone啓動圖像應用程序
- 13. 啓動圖像 - iPhone應用程序
- 14. 圖像保存到iPhone應用程序
- 15. iPhone應用程序替換圖像
- 16. iPhone應用程序,像文字處理器格式文本
- 17. 使用UIWebView使用tiff和gif格式圖像的問題
- 18. 如何在iPhone中顯示.tiff圖像?
- 19. CSS風格舊iphone應用程序圖標樣式
- 20. 可可。爲什麼應用程序的圖像在沙箱中從png更改爲tiff格式?
- 21. NSBitmapImageRep數據格式爲應用程序圖標圖像?
- 22. TIFF圖像,TIFF庫VISUAL C++
- 23. 地圖應用程序iphone
- 24. iPhone地圖應用程序
- 25. 下面的圖像UISearchBar像筆記應用程序 - iPhone
- 26. iPhone和iPad肖像模式應用程序不同的反應
- 27. 如何在Matlab中用tiff格式讀取大圖像?
- 28. 約TIFF圖像
- 29. Rich TIFF格式的TIFF轉換問題
- 30. 爲iPhone應用程序處理圖像/視圖層的最佳方式