Contrast and Transparent

3 posts, 0 answers
  1. ADM-IT Denis Pujdak
    ADM-IT Denis Pujdak avatar
    34 posts
    Member since:
    Sep 2011

    Posted 31 Mar 2014 Link to this post

    I have the icon in the color="#333333" and the background="Transparent". I wanted to change the color of my icon to white. Look what I received. I lack color fill effect so I used the contrast.

    <Image Width="20" Height="20" Margin="0,0,5,0" VerticalAlignment="Center"
        Cursor="Hand" Source="/MyProject.Res;component/Img/user-32.png" Stretch="Fill">
        <Image.Effect>
            <ShaderEffects:ContrastAdjustEffect Brightness="1"/>
        </Image.Effect>
    </Image>

    In my opinion transparent should not fill the color when do contrast.
  2. ADM-IT Denis Pujdak
    ADM-IT Denis Pujdak avatar
    34 posts
    Member since:
    Sep 2011

    Posted 31 Mar 2014 in reply to ADM-IT Denis Pujdak Link to this post

    I found solution.

    <Rectangle Fill="White" Width="20" Height="20" Margin="0,0,5,0" VerticalAlignment="Center" Cursor="Hand">
        <Rectangle.OpacityMask>
            <ImageBrush ImageSource="/MyProject.Res;component/Img/user-32.png"/>
        </Rectangle.OpacityMask>
    </Rectangle>
  3. DevCraft banner
  4. Todor
    Admin
    Todor avatar
    168 posts

    Posted 03 Apr 2014 Link to this post

    Hello Denis,

    I'm glad that you already find a working solution for the problem.
    As an alternative I can suggest you to use a Path instead of Rectangle and the image, if it possible of course. 

    If you have any further assistance, please do not hesitate to contact us again.


    Regards,
    Todor
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top