Picture box alignment

6 posts, 0 answers
  1. James Shelton-Agar
    James Shelton-Agar avatar
    108 posts
    Member since:
    May 2008

    Posted 02 Feb 2011 Link to this post

    When working with picturebox, which sizing is "ScaleProptional", can we set alignment to be at right? dock doesn't seems to be working
  2. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 03 Feb 2011 Link to this post

    Hi James,

    The TextAlign and VerticalAlign properties do not contain any meaning for the PictureBox item they are both responsible for alignment of text.
    The Dock property determines how a report item is resized with its parent e.g. setting Dock to Bottom causes the report item to align itself with the bottom edges of its parent and to resize as the parent is resized.

    Regards,
    Steve
    the Telerik team
    Get started with Telerik Reporting with numerous videos and detailed documentation.
  3. DevCraft banner
  4. James Shelton-Agar
    James Shelton-Agar avatar
    108 posts
    Member since:
    May 2008

    Posted 03 Feb 2011 Link to this post

    when the image width is random, if the width wider than PictureBox, it will scaled by ratio but if less than PictureBox's width, image will aligned into center, any idea?
  5. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 07 Feb 2011 Link to this post

    Hello James,

    This is the behavior by design. Here is the description of the ScaleProportional property from the PictureBox help article:
    "The image is sized proportionally (without clipping), so that it's best fitted to the picturebox item. If the height and width ratio of the picturebox item is the same as the image's ratio it will be resized to exactly fit into the picturebox item. Otherwise the closest fitting side (height or width) of the image will be sized to the item and the other side (height or width) of the image sized proportionally (leaving empty space)."

    Kind regards,
    Steve
    the Telerik team
    Get started with Telerik Reporting with numerous videos and detailed documentation.
  6. Morten Louw
    Morten Louw avatar
    21 posts
    Member since:
    Sep 2008

    Posted 06 May 2011 Link to this post

    I agree. It would be nice to be able to control the alignment of the open content. The white filling area.
    Not the textalign, but a picturealign!

    My hack will be to analyze the pictures pixel-dimensions using System.Drawing.Image, and set the picturebox width based on that.
    It has to be by code. It would have been nice to do databinding instead - and a more declarative approach in general...

    Kind Regards,
    Morten
  7. Chavdar
    Admin
    Chavdar avatar
    898 posts

    Posted 11 May 2011 Link to this post

    Hi Morten Louw,

    Here is one more suggestion before you implement your solution with code. Try with PictureBox.Sizing mode set to AutoSize and then dock the PictureBox item to the right. In this case the width of the PictureBox should be set to the greatest possible image width and the detail section's width should be that of the page without margins. If this approach does not help then as a last resort you can specify the size and the location of the PictureBox item using user functions and bindings.

    Best wishes,
    Chavdar
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top
DevCraft banner