[Qt-interest] QPainter drawPixmap , wired image scale problem

Aaron Lewis aaron.lewis1989 at gmail.com
Sat Apr 17 08:27:41 CEST 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,
	I'm trying to draw a small picture in a QWidget::paintEvent,

	QRectF source(0.0, 0.0, 36.0, 36.0); 	// does it means the file scale
mode or image size to paint ?

    	QPixmap wallPic(":/bomber/images/wall.jpg");	// Define some pictures
	QPixmap boxPic(":/bomber/images/box.jpg");

	-snip-
	Then i use a for loop to draw Pixmaps:
	-snip-
	while(....)
	{
            target = QRectF(36.0*i,36.0*mapRow,36.0*(i+1),36.0*(mapRow+1));
	//mapRow is the number n of the image we paint.
	     switch(...)
             {
                 default:
                     painter->drawPixmap(target,wallPic,source);
                     break;
             } // switch
	} // while


	But i've got an bad image , does anyone has any ideas ?
	Every image is scaled,which's not what i want , i think it's problem
with definition of QRectF source.
	See attachment


	Thanks in advance !
	
- -- 
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4r0n on freenode
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkvJVNwACgkQvf41sEptMqBTFwCeIMFJ9xiV8g5QZ6ZUVK+TDf8F
+esAn3X9s6j+Wux1Cli70sDcQ+zbN6iD
=ynFE
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mpainter.jpeg
Type: image/jpeg
Size: 94392 bytes
Desc: not available
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100417/28e7ade5/attachment.jpeg 


More information about the Qt-interest-old mailing list