---- Pôvodná správa ----
        Od koho: Michal Sawicz <[email protected]>
        Komu: elisa <[email protected]>
        Dátum: 18. 12. 2008 23:09:00
        Predmet: Re: [Elisa] cropping scaled image 
        
        Dnia 2008-12-18, czw o godzinie 21:45 +0000, mato konecny pisze:
        > I'm trying to create a universal "star widget" to show rating etc. I
        > have 2 images with 5 stars ('inactive' and 'active'). In a widget I
        > put them over eachother so that the 'active' stars are in the 'front'.
        > Then I would like to say that let's say only 0.8 of the 'active' image
        > is visible.
        > It looks a bit like the images used in grid view. There,
        > pgm.IMAGE_ZOOMED was used, but this creates a problem that if I change
        > the width attribute of a image, the height is also altered. What I
        > would like to do is to be able to modify only the drawed width without
        > modifiyng the rest. I tried absolute_width, boxing the image in a HBox
        > and modifiyng that one, but none of them seem to work good. The
        > resulting image depends also on what's the widget parent.
        
        If I undestand correctly, you want to mask the 'active' image.
        Unfortunately I was once told that's not possible in pigment until 0.5
        at least.
That's a pity.. I was thinking about using 3 separate images (active, 
non-active and half star), but you would gain extra "precision" if you can only 
show 0.87 of a bigger image with 5 stars.
        Anyway are you using two 5-stars wide images where the active one
        overlays the inactive ones... If you want it to be universal, use
        separate images (so that you can have 8 stars, if needed) and when
        masking's possible, hide / mask those that shouldn't show. This way
        there's place for semitransparent images there.
        
        You shouldn't ever rely on overlaying some images to hide them - that's
        what the .visible property is there for. If something shouldn't be
        visible - it should really be, not just behind something else.
I agree... It's a bit dirty way, but it's quick and (in principle) easier to 
implement than creating 2x 5 identical images and and then deciding which ones 
to show. But because the masking isn't currently possible, I am gonna do it the 
other way.

Matej
        
        -- 
        Michal Sawicz <[email protected]>

----------

www.inPage.sk ��� Domena, webhosting, e-mail a seo od 3 Sk/denne.

Reply via email to