Home > other >  How to clean the inside of the QImage content??
How to clean the inside of the QImage content??

Time:11-25

Qt drawing when I was doing was let QPainter draw on QImage is then plotted on a QWidget QImage but if I now want to empty QImage is stored inside the contents of the QImage didn't provide the corresponding interface, this is my practice, but do feel a little bad, is not a good mark, have to release the space to apply for space, first feel redundant, do you have a better solution?? NodeForm: : NodeForm (QWidget * parent) {UI - & gt; SetupUi (this); Image=new QImage (IMAGE_WIDTH, IMAGE_HEIGHT QImage: : Format_ARGB32_Premultiplied); {} void NodeForm: : clearImage () the delete image; Image=new QImage (IMAGE_WIDTH, IMAGE_HEIGHT QImage: : Format_ARGB32_Premultiplied); }

CodePudding user response:

refer to the original poster weixin_38053139 response:
qt drawing when I was doing was first make QPainter draw on QImage is then plotted on a QWidget QImage but if I now want to empty QImage is stored inside the contents of the QImage didn't provide the corresponding interface, this is my practice, but do feel a little bad, is not a good mark, have to release the space first, then apply for space, feel redundant, do you have a better solution?? NodeForm: : NodeForm (QWidget * parent) {UI - & gt; SetupUi (this); Image=new QImage (IMAGE_WIDTH, IMAGE_HEIGHT QImage: : Format_ARGB32_Premultiplied); {} void NodeForm: : clearImage () the delete image; Image=new QImage (IMAGE_WIDTH, IMAGE_HEIGHT QImage: : Format_ARGB32_Premultiplied); }

I also want to empty, seems only img=QImage ()
  • Related