Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
请告诉我这个 Qt 中的类似物。如何在 Qt 中实现这一点?谢谢!
BitmapData btmData= currentRegionMap.LockBits(new Rectangle(x, y, width, height), ImageLockMode.ReadOnly, currentRegionMap.PixelFormat); byte* a = (byte*)btmData.Scan0.ToPointer();
在 Qt 中不需要这样做。在 Qt 中,这LockBits是一个无操作。您需要使用该QImage课程,仅此而已。QImage您可以通过在其上启动 aQPainter或通过调整其二进制数据来绘制它。最终您将其转换为 aQPixmap并且您可以将其绘制在屏幕上(在小部件或窗口中)。
LockBits
QImage
QPainter
QPixmap