cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
lk777
Helper III
Helper III

Add Picture control problems

Hi,

 

I gave up on a Camera control with its low image resolution and Power Automate flow's  lack of support for transform: rotate() (in convert to PDF process). So I decided to give a 'Add picture' control a chance but all my test results do no look promising.

 

I was really excited when I found "ImageRotation" property but it seems does nothing with the image, it just " rotates image before displaying it" but this rotation doesn't have any affect on the saved image.

 

What I am trying to achieve is to take a picture on the mobile device (a phone or a tablet)  in a portrait mode, to covert it to the PDF file and upload a PDF file to the Sharepoint document library (Flow).

 

My goal is to use a mobile device as a document scanner (I am aware of mobile  scan apps, just need to use a Powerapp for these purposes).

 

My settings:

ApplyEXIFOrientation - true

CalculateOriginalDimensions -true

ImagePosition - Fit

ImageRotation.Rotate270

 

When I take a picture in a portrait mode, it is displayed 90deg clockwise rotated  in "Add picture" control , so I set ImageRotation.Rotate270. The image looks (displays) ok but these changes are not saved.

 

 

 

 

18 REPLIES 18

Thanks @lk777 ,

Good luck with your project

Am I missing somewhere where you actually give the code or step-by-step instructions for the fancy rotations you show there?

 

If you don't... how is that helpful?

 

I don't get it.

@AndrewMWolfe ,

The originator of the post did not ask as they figured it out themselves (ImageRotation is a built-in property of an Image Control). You simply set it to a Variable (value of 90, 180, 270 or None) and progress it when the icon is pressed.

I couldn't get that to work, but it's okay, I have bigger problems that I just posted about. If I can get that to work, I'll give rotation another try.

 

Thanks for your response, and sorry for my snarky comment (made while debugging).

Hello @WarrenBelz , 

 

I've come back to this and I can't understand the solution. This is what I have for .OnSelect for my IconRotate:

 

 

Switch(UploadedImage1.ImageRotation, ImageRotation.None, Set(_Rotation, ImageRotation.Rotate90), ImageRotation.Rotate90, Set(_Rotation, ImageRotation.Rotate180), ImageRotation.Rotate180, Set(_Rotation, ImageRotation.Rotate270), ImageRotation.Rotate270, Set(_Rotation, ImageRotation.None))

 

 

I've also tried nesting the Switch inside the Set. However I get there, I then set the .ImageRotation feature of UploadedImage1 to be "_Rotation."

 

I seem to be having problems with data type here. It keeps telling me that I've got an invalid argument type (Text) and that it is expecting an Enum Value instead. I have searched the interwebs high and low and can't figure out how to make this work.

 

Any pointers? 

 

Thanks in advance.

If you'd like me to split this off as a separate post, I can, and then we can mark your answer as the resolution. 

@AndrewMWolfe ,

Screen OnVisible

 

Set(
   iRotate,
   0
);
Set(
   stRotate,
   "ImageRotation.None"
)

 

Rotate button OnSelect

 

If(
    iRotate < 3,
    Set(
        iRotate,
        iRotate + 1
    ),
    Set(
        iRotate,
        0
    )
);
Switch(
   iRotate,
   1,
   Set(
      stRotate,
      "rotate90"
   ),
   2,
   Set(
      stRotate,
      "rotate180"
   ),
   3,
   Set(
      stRotate,
      "rotate270"
   ),
   Set(
      stRotate,
      "ImageRotation.None"
   )
)

 

ImageRotation

 

stRotate

 

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

View solution in original post

As long as the final ImageRotation property is your stRotate variable and not your iRotate variable, it works beautifully!

Thank you. Quite an elegant solution.

@AndrewMWolfe ,

Mis-type on the image variable - now fixed.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

I wish I could click Accept as Solution but because I'm not the originator of the thread, it doesn't show as an option. I would if I could!

 

Thanks again.

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Did you miss the call? Check out the recording here!

Top Solution Authors
Top Kudoed Authors
Users online (36,993)