c++ - Not able to use the loaded Image data properly -
i load image raw data , use qimage::format_monolsb
format while loading. try write file, , image in b&w mono color format. ok.
what way image out of in color format ? eg: if want color while portions particular color, how do ?
i tried create qimage
using qimage::format_argb32_premultiplied
, , used painter draw 1 got above using pen/brush. not seem work. suspect there compatibility issue between formats.
colorimage = qimage(qrect(0, 0, w, h), qimage::format_argb32_premultiplied); _painter.begin(&blockimage); _painter.setpen(qt::blue); _painter.drawimage(qrect(0, 0, w, h), blockimage, aboveimage); _painter.end();
i tried change loading code use color format (format_argb32_premultiplied
), not seem work either. no image in output.
you're drawing blockimage
on blockimage
. think want paint on colorimage
instead: _painter.begin(&colorimage);
anyway, use qimage::converttoformat
, pass in color table instead.
Comments
Post a Comment