Do i only copy one pixel? Whats wrong?
you are doing it the other way around...
You said you want to
to change QPixmaps in char* and vice versa
Then:
unsigned char *myField = (unsigned char*) Fg_getImagePtrEx(fg,1,dma_no,pmem0);
//Pixmap to unsigned char*
unsigned char *buff = pixmap->convertToImage().bits(); //access the raw image data
//unsigned char to Pixmap
pixmap->loadFromData(myField,imageSize);
unsigned char *myField = (unsigned char*) Fg_getImagePtrEx(fg,1,dma_no,pmem0);
//Pixmap to unsigned char*
QPixmap *pixmap = new QPixmap("image.png");
unsigned char *buff = pixmap->convertToImage().bits(); //access the raw image data
//unsigned char to Pixmap
pixmap->loadFromData(myField,imageSize);
To copy to clipboard, switch view to plain text mode
Have a look at QPixmap and QImage.
Bookmarks