C#Bitmap newBitmap = new Bitmap(rects[i].Width, rects[i].Height, PixelFormat.Format24bppRgb);Graphics graphics = Graphics.FromImage(newBitmap);graphics.DrawImage(currentRegionMap, new Rectangle(0, 0, rects[i].Width, rects[i].Height), rects[i], GraphicsUnit.Pixel);graphics.Dispose();
C++ (Qt)QImage surf;QPainter p( &surf );p.drawImage( ... );
QPainter painter(&screenMap);............................................................painter.drawImage(QPoint(xPos[i],yPos[i]),regions[i]);
void ScreenAnalyzer::copyRegion(QImage &srcImage, QImage &dstImage, int x, int y){ int pixLen=3; int dstXOffset=pixLen*x; for(int i=0;i<srcImage.height();i++) { uchar* srcXPoint = srcImage.scanLine(i); uchar* dstXPoint = dstImage.scanLine(y+i);dstXPoint+=dstXOffset; memcpy(dstXPoint,srcXPoint,srcImage.width()*pixLen); }}