davelt99 Member Licensed User Longtime User Mar 26, 2015 #1 After taking a picture in portrait mode with cameraEx the image is always in landscape mode. I'm showing a preview with: Dim imgPreview As ImageView imgPreview.Initialize("") imgPreview.Bitmap=RotateImage(LoadBitmap(File.DirRootExternal, sPicName),90) which corrects the orientation of the jpg file. I can't figure out how to save the corrected imgView to a file for uploading. Thanks in advance,
After taking a picture in portrait mode with cameraEx the image is always in landscape mode. I'm showing a preview with: Dim imgPreview As ImageView imgPreview.Initialize("") imgPreview.Bitmap=RotateImage(LoadBitmap(File.DirRootExternal, sPicName),90) which corrects the orientation of the jpg file. I can't figure out how to save the corrected imgView to a file for uploading. Thanks in advance,
DonManfred Expert Licensed User Longtime User Mar 26, 2015 #2 Have you trie dto use the forum search? I think no. Fault! Upvote 0
davelt99 Member Licensed User Longtime User Mar 26, 2015 #3 Yes, but I need to copy the rotated imgView to a file. The imgView is not yet a file. Not sure how this might work, Upvote 0
Yes, but I need to copy the rotated imgView to a file. The imgView is not yet a file. Not sure how this might work,
DonManfred Expert Licensed User Longtime User Mar 27, 2015 #4 The first link in the search i posted is this. Here you can see how to write a Bitmap to a file. Upvote 0
davelt99 Member Licensed User Longtime User Mar 27, 2015 #5 I Think that I've been confusing an ImageView bitmap with a bitmap. ' saving the camera picture taken to a file Dim out As OutputStream out = File.OpenOutput(File.DirRootExternal, "myImage.jpg", False) out.WriteBytes(Data, 0, Data.Length) out.Close dim imgPreview as ImageView imgPreview.Initialize("") imgPreview.Bitmap=RotateImage(LoadBitmap(File.DirRootExternal, "myImage.jpg"),90) ' now this rotated image, imgPreview.Bitmap, I would like to save to the original filename - "myImage.jpg" Sorry for the confusion. Upvote 0
I Think that I've been confusing an ImageView bitmap with a bitmap. ' saving the camera picture taken to a file Dim out As OutputStream out = File.OpenOutput(File.DirRootExternal, "myImage.jpg", False) out.WriteBytes(Data, 0, Data.Length) out.Close dim imgPreview as ImageView imgPreview.Initialize("") imgPreview.Bitmap=RotateImage(LoadBitmap(File.DirRootExternal, "myImage.jpg"),90) ' now this rotated image, imgPreview.Bitmap, I would like to save to the original filename - "myImage.jpg" Sorry for the confusion.
davelt99 Member Licensed User Longtime User Mar 27, 2015 #6 I found It!! Had to store ImageView.Bitmap to a Bitmap first and then write to the outputstream. Dim b As Bitmap b = imgPreview.Bitmap Dim Out As OutputStream Out = File.OpenOutput(File.DirRootExternal, sPicName, False) b.WriteToStream(Out, 100, "JPEG") Out.Close Thank you for your assistance - I'll try to search more diligently in the future. Upvote 0
I found It!! Had to store ImageView.Bitmap to a Bitmap first and then write to the outputstream. Dim b As Bitmap b = imgPreview.Bitmap Dim Out As OutputStream Out = File.OpenOutput(File.DirRootExternal, sPicName, False) b.WriteToStream(Out, 100, "JPEG") Out.Close Thank you for your assistance - I'll try to search more diligently in the future.
DonManfred Expert Licensed User Longtime User Mar 27, 2015 #7 Something like B4X: Expand Collapse Copy 'save image to file Dim out As OutputStream out = File.OpenOutput(File.DirRootExternal, "myImage_rotaged.jpg", False) imgPreview.Bitmap.WriteToStream(out, 100, "JPEG") out.Close Upvote 0
Something like B4X: Expand Collapse Copy 'save image to file Dim out As OutputStream out = File.OpenOutput(File.DirRootExternal, "myImage_rotaged.jpg", False) imgPreview.Bitmap.WriteToStream(out, 100, "JPEG") out.Close