LockBits in Qt. How to implement?

216 Views Asked by At

Please tell me this analogue in Qt. How to implement this in Qt? Thx!

BitmapData btmData= currentRegionMap.LockBits(new Rectangle(x, y, width, height), ImageLockMode.ReadOnly, currentRegionMap.PixelFormat);
byte* a = (byte*)btmData.Scan0.ToPointer();
1

There are 1 best solutions below

0
On

There is no need to do this in Qt. In Qt, the LockBits is a No-Op. You need to be using the QImage class, that's about it. You can paint on a QImage by starting a QPainter on it, or by tweaking its binary data. Eventually you convert it to a QPixmap and you can draw it on the screen (in a widget or window).