Dogbonesix Active Member Licensed User Longtime User Oct 7, 2015 #1 Using the BitMapExtended library the code below rotates an imageview: ' Where btmpex is a Global (Dim btmpex As BitmapExtended); btmp is a Global (Dim btmp As Bitmap); RotV is a Global set to 0 at Activity_Create Sub Label1_Click RotV = RotV + 90 If RotV > 270 Then RotV = 0 imgView.Bitmap = btmpex.rotateBitmap(btmp,RotV) ' End Sub My question is - how do I save the ROTATED imageview to a Directory/FileName? It seems that File.OpenOutput would be a place to start - bit I can not figure it out. Any help would be appreciated.
Using the BitMapExtended library the code below rotates an imageview: ' Where btmpex is a Global (Dim btmpex As BitmapExtended); btmp is a Global (Dim btmp As Bitmap); RotV is a Global set to 0 at Activity_Create Sub Label1_Click RotV = RotV + 90 If RotV > 270 Then RotV = 0 imgView.Bitmap = btmpex.rotateBitmap(btmp,RotV) ' End Sub My question is - how do I save the ROTATED imageview to a Directory/FileName? It seems that File.OpenOutput would be a place to start - bit I can not figure it out. Any help would be appreciated.
Lee Gillie CCP Active Member Licensed User Longtime User Oct 7, 2015 #2 See Bitmap.WriteToStream Code: Example: Dim Out As OutputStream Out = File.OpenOutput(File.DirRootExternal, "Test.png", False) Bitmap1.WriteToStream(out, 100, "PNG") Out.Close Upvote 0
See Bitmap.WriteToStream Code: Example: Dim Out As OutputStream Out = File.OpenOutput(File.DirRootExternal, "Test.png", False) Bitmap1.WriteToStream(out, 100, "PNG") Out.Close
Dogbonesix Active Member Licensed User Longtime User Oct 7, 2015 #3 The ImageView rotates like a champ BUT the "Bitmap1.WriteToStream(out, 100, "PNG")" does not save the rotated view as seen in the ImageView. For me - Test.png appears the same as before it was rotated however the ImageView is rotated. There is some small (very small) difference in the size between the original and the ...WriteToStream Test.png, so I guess something happened. If you have a sample of code where the ImageView can be saved to a file - it would be great. I may doing it the right way but just don't see it OR doing it completely wrong and still do see it. Thanks Upvote 0
The ImageView rotates like a champ BUT the "Bitmap1.WriteToStream(out, 100, "PNG")" does not save the rotated view as seen in the ImageView. For me - Test.png appears the same as before it was rotated however the ImageView is rotated. There is some small (very small) difference in the size between the original and the ...WriteToStream Test.png, so I guess something happened. If you have a sample of code where the ImageView can be saved to a file - it would be great. I may doing it the right way but just don't see it OR doing it completely wrong and still do see it. Thanks