[Qt-interest] QGraphicsSvgItem scalling image question
Pritam Ghanghas
pritam_ghanghas at infosys.com
Tue Aug 23 13:30:53 CEST 2011
On Tue, 2011-08-23 at 15:32 +0530, franki wrote:
> Dnia poniedziałek, 22 sierpnia 2011 o 14:56:06 franki napisał(a):
> > Hi,
> >
> > I have some items on QGraphicsView that represents icons. Icons are
> > clickable and can change look (e.g. switch on/off) I need these icons to
> > come in different resolutions without lose of quality, so I tunerd to
> > QGraphicsSvgItem, supposedly this is Scalable Vector Graphics. But I can
> > find no way to change icon resolution. I've googled and all I've got is
> > that I could change some parameters in svg file before loading, simply by
> > parsing it. But with complex icon's that nearly impossible, or at least
> > highly cumbersome.
> > I do have however setScale() function that somes from QGraphicsItem, but
> > this is just applying transormation matrix onto item, and the item does not
> > have to be svg item,
> > So my question is: Do I get this right? Only possible scalling is by
> > setScale function or parsing svg text file? Because if so, what advantages
> > gives me using svg format? Does this downscale better that png format
> > giving better item quality?
>
> Please anyone..
> I know it may be stupid question, but is it possible that function scale, or
> setScale inherited from QGraphicsItem by QGraphicsSvgItem, takes advantage of
> SVG file and render it without loss of quality in different size?
> SVG Cards example is doing this that way, setting scale for every item form
> one svg file.
setScale() should result in properly scaled svg Item (lossless). It
should be very easy to check.
create the item,
set the scale to be very huge may be 20x and then look for artifacts.
If scale is being applied after rasterization, you will get very visible
ugly looking pixel blocks.
--
Thanks,
Pritam
>
> best regards
> Marek
>
> >
> >
> > best regards
> > Marek
> > _______________________________________________
> > Qt-interest mailing list
> > Qt-interest at qt.nokia.com
> > http://lists.qt.nokia.com/mailman/listinfo/qt-interest
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at qt.nokia.com
> http://lists.qt.nokia.com/mailman/listinfo/qt-interest
**************** CAUTION - Disclaimer *****************
This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely
for the use of the addressee(s). If you are not the intended recipient, please
notify the sender by e-mail and delete the original message. Further, you are not
to copy, disclose, or distribute this e-mail or its contents to any other person and
any such actions are unlawful. This e-mail may contain viruses. Infosys has taken
every reasonable precaution to minimize this risk, but is not liable for any damage
you may sustain as a result of any virus in this e-mail. You should carry out your
own virus checks before opening the e-mail or attachment. Infosys reserves the
right to monitor and review the content of all messages sent to or from this e-mail
address. Messages sent to or from this e-mail address may be stored on the
Infosys e-mail system.
***INFOSYS******** End of Disclaimer ********INFOSYS***
More information about the Qt-interest-old
mailing list