[Qt-interest] QGraphicsSvgItem scalling image question
frares at gmail.com
frares at gmail.com
Tue Aug 23 22:41:27 CEST 2011
If you need to scale individual items, apply the transformation to it.
If your whole scene should be zoomed, apply the transformation to the
QGraphicsView.
Francisco
Em 23/08/2011 09:27, franki <franki at franki.eu.org> escreveu:
> Dnia wtorek, 23 sierpnia 2011 o 13:30:53 Pritam Ghanghas napisał(a):
> > 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 (eg 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 it's seems to be OK, as far as I can tell there is no ugly looking
> pixels, at least under qt simulator..., but usually items look beter on N8
> than on simulator ;)
> Thanks
> Marek
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at qt.nokia.com
> http://lists.qt.nokia.com/mailman/listinfo/qt-interest
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110823/f59f9246/attachment.html
More information about the Qt-interest-old
mailing list