| Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date | |
| All threads index page 6 | |
Hi, All I Generated a pic in QPixmap and when i scaled the this QPixmap, the edges of the box may disappear, but I don't want that effect, I want edges still there, but I dont' how can i do this, in the accessories, there are two snapshot of the pic in different scaled rate, you can see that edges are missing, so Is there a way to avoid edge missing? Best Regards,Reimand.zhu
Attachment:
1.JPG
Description: image/pjpeg
Attachment:
2.JPG
Description: image/pjpeg
Either use smooth scaling (instead of nearest neighbor scaling), or don't use pixmaps and rewrite your code using vector graphics and render the pixmaps at the necessary resolution on the fly. To use smooth scaling you have to pass Qt::SmoothTransformation to QPixmap::scaled. Make sure to read the documentation. Paul. reimand zhu wrote: > Hi, All > > I Generated a pic in QPixmap and when i scaled the this QPixmap, the > edges of the box may disappear, but I don't want that effect, I want > edges still there, but I dont' how can i do this, in the accessories, > there are two snapshot of the pic in different scaled rate, you can see > that edges are missing, so Is there a way to avoid edge missing? > > Best Regards, > Reimand.zhu > > > > > ------------------------------------------------------------------------ > 免费试玩2006中国最佳网络游戏--梦幻西游 <http://xyq.163.com/> > ------------------------------------------------------------------------ > > > ------------------------------------------------------------------------ > -- [ signature omitted ]
For that particular image, I doubt smooth scaling will really help. Details only one pixel wide have very little hope of surviving most filtering mechanisms. He's pretty much going to have to redraw the image at each resolution. This is an image processing problem, not really a QPixmap limitation... Richard On Apr 25, 2007, at 12:02 AM, Paul Koshevoy wrote: > Either use smooth scaling (instead of nearest neighbor scaling), or > don't use > pixmaps and rewrite your code using vector graphics and render the > pixmaps at > the necessary resolution on the fly. > > To use smooth scaling you have to pass Qt::SmoothTransformation to > QPixmap::scaled. Make sure to read the documentation. > > Paul. > > > reimand zhu wrote: >> Hi, All >> >> I Generated a pic in QPixmap and when i scaled the this QPixmap, the >> edges of the box may disappear, but I don't want that effect, I want >> edges still there, but I dont' how can i do this, in the accessories, >> there are two snapshot of the pic in different scaled rate, you >> can see >> that edges are missing, so Is there a way to avoid edge missing? >> >> Best Regards, >> Reimand.zhu >> >> >> >> >> --------------------------------------------------------------------- >> --- >> åèèç2006äåæäççææ--æåèæ <http://xyq. >> 163.com/> >> --------------------------------------------------------------------- >> --- >> >> >> --------------------------------------------------------------------- >> --- >> > > -- > To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx > with "unsubscribe" in the subject or the body. > List archive and information: http://lists.trolltech.com/qt-interest/ > -- [ signature omitted ]
Use a Mac, not a PC. The Mac has much better image scaling routines. (Some Unix machines might do it as good as a Mac, but I doubt it). Windows is notoriously bad at pixel image scaling. It uses a simple dropout (or doubling for enlargement) row/column scheme instead of choosing the 'unique' pixels or using pixel averaging in a range to reduce loss of critical information. Regardless, using vector drawing instead of QPixmap is always better for scaling. Keith **Please do not reply to me, reply to the list.** On 04-25-2007 5:58 AM, "Richard S. Wright Jr." wrote: > For that particular image, I doubt smooth scaling will really help. > Details only one pixel wide have very little hope of surviving most > filtering mechanisms. He's pretty much going to have to redraw the > image at each resolution. This is an image processing problem, not > really a QPixmap limitation... > > Richard > > On Apr 25, 2007, at 12:02 AM, Paul Koshevoy wrote: > >> Either use smooth scaling (instead of nearest neighbor scaling), or >> don't use >> pixmaps and rewrite your code using vector graphics and render the >> pixmaps at >> the necessary resolution on the fly. >> >> To use smooth scaling you have to pass Qt::SmoothTransformation to >> QPixmap::scaled. Make sure to read the documentation. >> >> Paul. >> >> >> reimand zhu wrote: >>> Hi, All >>> >>> I Generated a pic in QPixmap and when i scaled the this QPixmap, the >>> edges of the box may disappear, but I don't want that effect, I want >>> edges still there, but I dont' how can i do this, in the accessories, >>> there are two snapshot of the pic in different scaled rate, you >>> can see >>> that edges are missing, so Is there a way to avoid edge missing? >>> >>> Best Regards, >>> Reimand.zhu -- [ signature omitted ]
On 4/25/07, Keith Esau <keith.esau@xxxxxxx> wrote: > Use a Mac, not a PC. The Mac has much better image scaling routines. (Some > Unix machines might do it as good as a Mac, but I doubt it). Qt uses it's own code for smooth scaling, so that won't help. Cheers Rich. -- [ signature omitted ]