QImage/QPixmap size limitations?

前端 未结 4 2014
粉色の甜心
粉色の甜心 2020-12-03 17:54

Are there any known size/space limitation of QPixmap and/or QImage objects documented? I did not find any useful information regarding this. I\'m c

4条回答
  •  北海茫月
    2020-12-03 18:24

    I actually had occasion to look into this at one time. Do a search in the source code of qimage.cpp for "sanity check for potential overflows" and you can see the checks that Qt is doing. Basically,

    • The number of bytes required (width * height * depth_for_format) must be less than INT_MAX.
    • It must be able to malloc those bytes at the point you are creating the QImage instance.

提交回复
热议问题