
7 Answers, 1 is accepted
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

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

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
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
.jpg)
we are running into the same issue. Any other tools that we have used when using the scaling of "Scale Proportional", the image us usually aligned TOP/LEFT. In the Telerik PictureBox control, it's always CENTERED both Vertically and Horizontally. I know this thread is old, but is there any way to have an option, in the future, to allow us to how to align the image after it is scaled in the control?
Thanks
This option is not supported at the moment.
Feel free to add a request for it into our feedback portal and describe the exact functionality you expect from a PictureBox item.
This way other community members also interested in this functionality can vote for it which will raise its priority. New features are selected for development based on the interest from the community members.
Regards,
Katia
Telerik by Progress
I'm really surprised this isn't supported.
Looks like the only workaround to this is what another user commented: My hack will be to analyze the pictures pixel-dimensions using System.Drawing.Image, and set the picturebox width based on that.
Hoping this might be helpful to someone, this is the code I came up with that will resize the PicutreBox to the actual width, so you don't get any left/right padding.
var width = pngLogoImage.Width;
var height = pngLogoImage.Height;
var resolution = pngLogoImage.VerticalResolution;
var widthInInches = width / resolution;
var heightInInches = height / resolution;
var picBoxWidth = companyLogoPictureBox.Width.Value;
var picBoxHeight = companyLogoPictureBox.Height.Value;
if (widthInInches > picBoxWidth || heightInInches > picBoxHeight)
{
double ratioX = (double)picBoxWidth / widthInInches;
double ratioY = (double)picBoxHeight / heightInInches;
double ratio = Math.Min(ratioX, ratioY);
var newWidth = widthInInches * ratio;
var newHeight = heightInInches * ratio;
companyLogoPictureBox.Width = Unit.Inch(newWidth);
companyLogoPictureBox.Height = Unit.Inch(newHeight);
}
Hi David,
Have you tested different values for the Sizing property? For example, the Stretch ImageSizeMode.