跳到內容
  • 版面
  • 最新
  • 標籤
  • 熱門
  • 使用者
  • 群組
  • 搜尋
  • Get Qt Extensions
  • Unsolved
Collapse
品牌標誌
  1. 首頁
  2. Qt Development
  3. Mobile and Embedded
  4. Png images
Forum Updated to NodeBB v4.3 + New Features

Png images

已排程 已置頂 已鎖定 已移動 Mobile and Embedded
15 貼文 4 Posters 7.0k 瀏覽 1 Watching
  • 從舊到新
  • 從新到舊
  • 最多點贊
回覆
  • 在新貼文中回覆
登入後回覆
此主題已被刪除。只有擁有主題管理權限的使用者可以查看。
  • F 離線
    F 離線
    f.vanalmetelevic.com
    寫於 最後由 編輯
    #6

    The final size of the executable is 1198462 bytes.
    Target has 64 Mb of RAM.
    Not yet tested when not compiled in to application.
    Number of png's in qrc file : 170!

    1 條回覆 最後回覆
    0
    • Z 離線
      Z 離線
      ZapB
      寫於 最後由 編輯
      #7

      If you are targeting a particular device it is pointless to rescale the images at runtime over and over again. Much better idea to rescale them once offline and use the rescaled images directly.

      Nokia Certified Qt Specialist
      Interested in hearing about Qt related work

      1 條回覆 最後回覆
      0
      • C 離線
        C 離線
        Chuck Gao
        寫於 最後由 編輯
        #8

        [quote author="ZapB" date="1305897728"]If you are targeting a particular device it is pointless to rescale the images at runtime over and over again. Much better idea to rescale them once offline and use the rescaled images directly.[/quote]

        Agree. Different device, different resolution.

        Chuck

        1 條回覆 最後回覆
        0
        • F 離線
          F 離線
          f.vanalmetelevic.com
          寫於 最後由 編輯
          #9

          Just to be sure my reasoning is right :
          One of the images is 25Kb in size. If I open that image, the size is 3289x1385 pixels. So, if we have to rescale that, the app has to load the original image in memory meaning consuming 3289x1385x3 = 13,66Mb of RAM (if I assume 24 bits per pixel). Right ?

          1 條回覆 最後回覆
          0
          • Z 離線
            Z 離線
            ZapB
            寫於 最後由 編輯
            #10

            Yes except it is more likely 4 bytes per pixel since it could well be using RGBA pixel format. What is your screen resolution on your device? I doubt it is anywhere near that image size is it?

            Nokia Certified Qt Specialist
            Interested in hearing about Qt related work

            1 條回覆 最後回覆
            0
            • F 離線
              F 離線
              f.vanalmetelevic.com
              寫於 最後由 編輯
              #11

              The screen resolution of the target is 800x480 !
              Well, it's clear that this way of working is not a good choice at all... it looks like the application will need some rework...
              Resizing the images once to their correct size will certainly resolve the "out of memory" problem...

              Thanks !

              1 條回覆 最後回覆
              0
              • Z 離線
                Z 離線
                ZapB
                寫於 最後由 編輯
                #12

                The app should not need much reworking if it is already using the larger images. You just need to spend a little time in your favourite image editor rescaling the png's to more suitable sizes. Another bonus is that yoru app will load faster (since it will be smaller) and it will also display the images faster since there will be no slow software scaling to be performed.

                Nokia Certified Qt Specialist
                Interested in hearing about Qt related work

                1 條回覆 最後回覆
                0
                • F 離線
                  F 離線
                  f.vanalmetelevic.com
                  寫於 最後由 編輯
                  #13

                  Stupid remark of me...! Of course, app should normally not change one byte... only scale images.

                  1 條回覆 最後回覆
                  0
                  • Z 離線
                    Z 離線
                    ZapB
                    寫於 最後由 編輯
                    #14

                    No worries - it's Friday afternoon. My brain has already departed for the weekend ;-)

                    Nokia Certified Qt Specialist
                    Interested in hearing about Qt related work

                    1 條回覆 最後回覆
                    0
                    • S 離線
                      S 離線
                      srikanth_trulyit
                      寫於 最後由 編輯
                      #15
                      1. Imaging scaling is very expensive and memory constrained in low memory devices like handhelds.
                      2. Why don't you use svg instead of png. They scale to the target resolution and work like a charm in low memory targets.
                      3. If you still prefer to use png files, please scale it yourself and provide an image cache that resides on the disk rather than on RAM. If you downscale try doing a "cheat scale":http://labs.qt.nokia.com/2009/01/26/creating-thumbnail-preview/
                      1 條回覆 最後回覆
                      0

                      • 登入

                      • Login or register to search.
                      • 第一個貼文
                        最後的貼文
                      0
                      • 版面
                      • 最新
                      • 標籤
                      • 熱門
                      • 使用者
                      • 群組
                      • 搜尋
                      • Get Qt Extensions
                      • Unsolved