Picturebox Orientation
The picturebox control in VS Reporting doesn't seem to honor the rotation property of the attachment. If a user takes a photo attachment in landscape mode, the attachment is displayed sideways in the report. The EXIF information of the attachment includes the orientation property which tells the client how to rotate the image so that it's oriented properly. Is there any way to control this in the picturebox control so that images are rotated properly, or is this an 'idea' that should be submitted?
-
Hi Erik,
If you are using a PictureBox control with the Image Source property, you can use the CorrectImageOrientation function in your expression to do this. It was added at version 5.14.
If you are using a PictureBox control with the Image URL property I don't think this is possible today.
The Single and Multiple Attachment controls have been able to automatically correct the orientation since version 5.4.
0 -
Thanks Ryan, I am in fact using the Image URL property to show an image that's linked from a feature, so I suspect I'm down the creek without a paddle.
Perhaps as an aside... If I were using Image Source property, how would I have known about the CorrectImageOrientation function? I looked all over the PictureBoxControl's reference in the help documentation and this function is not listed as a potential solution for this issue. Why is it not a property of the control? I find the whole configuration of reports and their controls to be unintuitive.
0 -
Ah, I see the reference now:
https://docs.vertigisstudio.com/reporting/latest/help/Default.htm#shr/help/operators-literals-and-functions.htm#image-functionsPerhaps I can use my workflow that is used to run the report and get the attachment URL, download it to a byte array and pass it to the report as a parameter to use in that function? In the meantime, I have used the navigation URL to allow the end user to click on the image to open the attachment in the correct orientation to save future neck sprains. :-P
0 -
I agree it is difficult to know what functions ought to be used when.
Why isn't CorrectImageOrientation just a property of the PictureBox? This control is inherited from a third party component, DevExpress, that provides many of the general purpose controls and layout capabilities. The latest version of DevExpress introduces a UseImageMetadata property that does exactly this. I don't have a timeframe for you yet, but we will eventually update to this version and it will then become available to you.
The approach of passing the bytes as a parameter to the report will certainly work, you'll just need to base64 encode those bytes in the workflow and then use the Base64Decode function when you supply it to the Image Source. One word of caution though... this approach doesn't work so well when the images are huge, say when it is a 10MB image from a smartphone.
0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
4 Kommentare