简体   繁体   English

如何获取存储在iPhone应用程序的文件夹中的png文件的尺寸?

[英]How to get dimension of png file stored in documents folder of iPhone application?

I am facing a problem, hope some one will help me to sort it out. 我正面临一个问题,希望有人帮我解决问题。 I am working on an application that saves png files in the documents folder of the iPhone application, and also user can view the files that were saved. 我正在开发一个将png文件保存在iPhone应用程序的文档文件夹中的应用程序,用户也可以查看保存的文件。 So, i want to know is there any way to find out the dimension of the file being displayed? 所以,我想知道有没有办法找出正在显示的文件的维度? so that, if image dimension is bigger than my imageView then i can make them scroll, currently image is shrink. 这样,如果图像尺寸大于我的imageView,那么我可以让它们滚动,目前图像缩小。

this may help... 这可能有帮助......

ImageIO framework (CGImageSource...)

similar Q to accessing UIImage properties without loading in memory the image 类似的Q 访问UIImage属性而不在内存中加载图像

Create a UIImage from the file, using imageWithContentsOfFile: . 使用imageWithContentsOfFile:从文件创建一个UIImage。 The size of the image is held in the size property of your new UIImage object. 图像的size保存在新UIImage对象的size属性中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何从iPhone文档文件夹中获取文件的文件大小 - How to get file size of file from iPhone documents folder 解析存储在iPhone应用程序的Documents目录中的XML文件 - Parsing an XML file stored in the Documents directory of an iPhone application 如何获取仅保存在iphone应用程序的文档文件夹中的所有照片名称 - How to get all the names of photos only which are saved in documents folder of iphone application 如何对Xcode说此文件存储在 <myApp> /文件(iPhone) - how to say to Xcode that this file is stored on <myApp>/documents (iPhone) 如何将音频文件从iPhone文档文件夹上载到服务器 - how to upload a audio file from iphone documents folder to server 访问iPhone应用程序的文件文件夹中的文件 - access files in documents folder of application of iphone 目标C - 如何从iPhone /应用程序/文档访问文件 - Objective C - how to access a file from iPhone/Application/Documents iPhone存储,然后从“文档”文件夹中读取文件 - iphone storing and then reading a file from Documents folder 如何从iPad应用程序中的documents文件夹播放视频文件 - how to play video file from documents folder in ipad application 如何将文本文件(本地存储在documents目录中)的内容转换为NSString? - How to get the contents of a text file (stored locally in the documents directory) into an NSString?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM