Image size in CoverFlow

7 posts, 1 answers
  1. Ben Hayat
    Ben Hayat avatar
    892 posts
    Member since:
    May 2008

    Posted 07 Dec 2008 Link to this post

    Let's say I have a series of pictures, all at W=480 H=295. However if i put them inside of a coverflow and display them, I see the images are getting stretched if the the "ItemMaxHeight & ItemMaxWidth" are set NaN.
    And if I enter the size of the picture 480x295 the pictures get stretch much bigger. So, by trail and error I set the height to 240 and width as Nan, in order to get to the right size.

    I'm having a difficult time making any sense out of this, especially when you can not see the result in Blend. You to run it to see it.
    Is this a bug or is there a pattern to follow?

    Thanks!
    ..Ben
  2. Answer
    Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 08 Dec 2008 Link to this post

    Hello Ben,

    Indeed, the images seem to be with different sizes than the specified in the ItemMaxWidth/Height properties. I suppose that this is due to the fact that the RadPerspectiveRotator in each RadCoverFlowItem resizes the image depending on its distance from the camera.

    We will research the problem and hopefully we will be able to fix it, or at least provide better descriptions for the ItemMaxWidth/Height properties it in the service pack next week.

    Best wishes,
    Valeri Hristov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. DevCraft banner
  4. Ben Hayat
    Ben Hayat avatar
    892 posts
    Member since:
    May 2008

    Posted 08 Dec 2008 Link to this post

    >>We will research the problem and hopefully we will be able to fix it, or at least provide better descriptions for the ItemMaxWidth/Height properties it in the service pack next week.<<

    Please! The whole sizing is not clear the way it works. I tried the changing several things to make sense out of it, but I couldn't come up with a formula!

    Thanks!
    ..Ben
  5. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 09 Dec 2008 Link to this post

    Hello Ben,

    The ItemMaxHeight and ItemMaxWidth are constraints for the size of the image. You should set one of them in order to have the right result. I will try to explain how it works and I hope that will help you:

    If you have a coverflow with images with different sizes and you want to make them look good in the same coverflow you either need to resize them or to tell the coverflow to resize them for you. If you set the ItemMaxWidth property to 200 you are telling the coverflow that it needs to resize all the pictures bigger than 200 pixels in width to 200 pixels and to keep the image in the same proportion. For example 400x500 will be displayed as 200x250. The other thing is that this size is not the screen size of the image. The images are put in a "scene" and their screen size depends on their position on the scene. The image I previously mentioned should appear 200x250 big only if it is put with no rotation and with Z position set to 0. 
    In more detail: If you set both - ItemMaxHeight and ItemMaxWidth, the coverflow will do the following: it will check if the ItemMaxWidth is either 0 or NaN. If it is, the coverflow will ignore it. If it is not, it will take the horizontal ratio (ItemMaxWidth/OriginalWidth) only if it is smaller than 1.0. The coverflow will do the same for the vertical ratio. After that, the coverflow will take the smaller from both of them and set it as scale of the image.

    I hope that will help you understand how it works. If you have further questions, don't hesitate to ask.

    Regards,
    Miroslav Nedyalkov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  6. Ben Hayat
    Ben Hayat avatar
    892 posts
    Member since:
    May 2008

    Posted 09 Dec 2008 Link to this post

    Miroslav, you answer is very close to what I had come up with by trail and error and it does make sense. The part that couldn't get to narrow down was, if the actual image height was 250 and the width was 400 and if I put the MaxItemHeight to 250 and Width to Nan, the image that would show was larger than 400x250. I had to reduce it (by trail and error) to 200 to get the same result. In order for this to work properly, I made all the images to the same original size of 400x250.

    It's too bad we can see the result of these changes in Blend until we run the app.

    Thanks for the info!
  7. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 09 Dec 2008 Link to this post

    Hi ..Ben,

    As I mentioned before, the Item is in a 3D scene. To have your images sized exactly as you set their max sizes you should put them at the center of the coordinate system. If you change the ZPosition of the items to 0, you will have the correct sizes. You can achieve this by changing the control template of the item. Notice that when you start rotating an image one of the ages is going far from the camera and the other one is going close to it. This will cause the nearer edge to appear bigger and the further one to look smaller than the size you have set as ItemMaxHeight, but in my opinion this is normal.
    We are really sorry that the design time for this properties is not working good and will try to fix it as soon as we can.

    Greetings,
    Miroslav Nedyalkov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  8. Ben Hayat
    Ben Hayat avatar
    892 posts
    Member since:
    May 2008

    Posted 09 Dec 2008 Link to this post

    Got you! Thank you Sir!
Back to Top
DevCraft banner