English 中文(简体)
(一) 记忆犹化的程度如何?
原标题:(iphone) how much memory UIImage takes up?

我对UIImage记忆规模感到不安。

  1. When you have 320*320 resolution image data(png), when you load the image onto memory,
    using [UIImage imageWithData:], the resulting UIImage will take up 320*320*4?

  2. 屏幕大小(分辨率)是否影响对图像的记忆使用?

  3. Would the code below take up twice memory size of myImage or just single image memory size? (320*320*4) * 2 vs (320*320*4)? or something else?

    UIImage* myImage = [UIImage imageWithData:];    
    myImage = [myImage scaleToSize:];
    

    比额表 定义

    - (UIImage*)scaleToSize:(CGSize)size
    {
      // Create a bitmap graphics context                                                                                              
    
    
      // This will also set it as the current context                                                                                                                                                                                                                             
      UIGraphicsBeginImageContext(size);
    
      // Draw the scaled image in the current context                                                                                                                                                                                                                             
      [self drawInRect:CGRectMake(0, 0, size.width, size.height)];
    
      // Create a new image from current context                                                                                                                                                                                                                                  
      UIImage* scaledImage = UIGraphicsGetImageFromCurrentImageContext();
    
      // Pop the current context from the stack                                                                                                                                                                                                                                   
      UIGraphicsEndImageContext();
    
      // Return our new scaled image                                                                                                                                                                                                                                              
      return scaledImage;
    }
    
问题回答

TO CHECK MEMORY ALLOCATION

如果你想测试具体图像,则在使用仪器时在Pipe/Simulator应用。

确保你选择适当的目标。 在你管理该方案时,请看到通过具体拨款所占用的记忆空间。


www.un.org/Depts/DGACM/index_spanish.htm WHILE RUNNING

请看窗子里分配的物体。 和我附随的这份文件一样,我也附上了这份文件。

https://i.stack.imgur.com/c7CPu.png” alt=“Whileî”/>

显然,你将使用的记忆越大,你一带的图像也越多。





相关问题
Code sign Error

I have created a new iPhone application.I have two mach machines. I have created the certificate for running application in iPhone in one mac. Can I use the other mac for running the application in ...

ABPersonViewController Usage for displaying contact

Created a View based Project and added a contact to the AddressBook using ABAddressBookRef,ABRecordRef now i wanted to display the added contact ABPersonViewController is the method but how to use in ...

将音频Clips从Peter改为服务器

我不禁要问,那里是否有任何实例表明从Peit向服务器发送音响。 I m不关心电话或SIP风格的解决办法,只是一个简单的袖珍流程......

• 如何将搜查线重新定位?

我正试图把图像放在搜索条左边。 但是,问题始于这里,搜索条线不能重新布署。

热门标签