Weird behaviour when using icon

10 posts, 0 answers
  1. Oliver
    Oliver avatar
    263 posts
    Member since:
    Feb 2011

    Posted 22 Sep 2011 Link to this post

    Hi,

    I use a RadOutlookBar and I display an image (png) in the header section. The problem is that the image doesn't look the same when I look at it using the shell explorer vs in my RadOutlookBar. In my RadOutlookBar, the image is a little bit blurred... (the component seem's to magnify the image, the original size is 24x24 and in the componentm the isze is 30x30)

    Here is my XAML code:

    <

     

    telerik:RadOutlookBarItem Header="{StaticResource Files}" FontWeight="Bold" Icon="Resources/Files_24x24.png" SmallIcon="Resources/Files_16x16.png" Tag="Files">

     


    Thank's
  2. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 27 Sep 2011 Link to this post

    Hello Oliver,

    I wasn't able to reproduce this issue. Can you please have a look at the attached sample and let me know if it works for you.

    If you can modify the solution to better reproduce the issue, that can help us further investigate the case. Also, please keep in mind that in WPF the resolution of the images can cause such issues and this is why we recommend using a 72dpi resolution.

    Let us know how it goes.

    Best wishes,
    Tina Stancheva
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. UI for WPF is Visual Studio 2017 Ready
  4. Oliver
    Oliver avatar
    263 posts
    Member since:
    Feb 2011

    Posted 30 Sep 2011 Link to this post

    Hi,

    it's ok and it's nt really a bug, the problem was the contrast between the background and the icon. I see the same result with your demo.

    Thank's
  5. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 05 Oct 2011 Link to this post

    Hello Oliver,

     Could you please point us to the demo you are looking at, any sample picture will be highly appreciated? This way we would be better able to advice you. Thank you for your cooperation.

    Kind regards,
    Petar Mladenov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  6. Oliver
    Oliver avatar
    263 posts
    Member since:
    Feb 2011

    Posted 05 Oct 2011 Link to this post

    Hi,

    it's the demo RadOutlookBarSample.zip you guys included in a previous post.

    If you look at the icon in the top portion (the one in the top who is centered), the look is more "clean" and "clear" instead of the icons who was aligned to the left, the rendering is not the same.

    Thank's

  7. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 10 Oct 2011 Link to this post

    Hello Oliver,

     We can see that the images in the left that are used as "Icons" are clear and do not get blurry like the centered image. You can resize the WPF windows and see that the centered Image gets both "clear" and blurry. This is a common WPF problem and sometimes could be resolved with setting the property SnapToDevicePixels to true but unfortunately, in this scenario it doesn't help. Please let us know if you need more questions.

    Best wishes,
    Petar Mladenov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  8. Oliver
    Oliver avatar
    263 posts
    Member since:
    Feb 2011

    Posted 21 Oct 2011 Link to this post

    Hi,

    do plan to fix this issue?

    Thank's
  9. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 26 Oct 2011 Link to this post

    Hi Oliver,

    This is a common WPF Framework problem and the only thing we could do is try to use the SnapToDevicePixels property to true. 

    Regards,
    Petar Mladenov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  10. Greg
    Greg avatar
    29 posts
    Member since:
    Oct 2007

    Posted 30 Nov 2011 Link to this post

    I found a solution to this problem.

    The .png files that cause the oversize issue are "bloated" internally for some reason. I found that if I used an image resizing program (ImageResizer - ImageResizer-2.1_x64) on the .png files, for example a 24X24 pixel png file - and resized it to the SAME size - e.g. 24X24 pixels - the resized image did not have the internal bloating and displayed fine!!!!

    I was able to see the "internal bloating" by opening the .png files in Notepad and saw that the images that caused the problem were MUCH larger bit-wise in Notepad than the ones that displayed fine.

    While I can't explain why this works - it does! Perhaps someone more knowledgable than I in image structures can explain it.



  11. Palani
    Palani avatar
    4 posts
    Member since:
    May 2014

    Posted 13 Jan in reply to Tina Stancheva Link to this post

    Found a solution.

    The image(32 x 32) which i have used in RadOutlookBarItem is blurred, also it's resolution is 72dpi.

    So, I increased the resolution from 72 dpi to 100 dpi, now it is working fine, now image is clear than before :)

Back to Top
UI for WPF is Visual Studio 2017 Ready