I have a bitmap and when I set an ImageView to view it in the app, it appears perfectly normal:
http://ompldr.org/vaTZxZw/Screenshot_2013-04-22-14-20-35.png
However, when I export that same bitmap without modification to a file using the WriteToStream method, I get the following:
http://ompldr.org/vaTZxaA/Scrotter4A_20130422_141705.png
For some reason, the image clips along the bottom. When opened with Photoshop, I get the error "Could not complete your request because the file-format module cannot parse the file". Windows 7's default image viewer opens it without issue, save for the clipping issue.
My code is as follows, for writing:
Any ideas?
http://ompldr.org/vaTZxZw/Screenshot_2013-04-22-14-20-35.png
However, when I export that same bitmap without modification to a file using the WriteToStream method, I get the following:
http://ompldr.org/vaTZxaA/Scrotter4A_20130422_141705.png
For some reason, the image clips along the bottom. When opened with Photoshop, I get the error "Could not complete your request because the file-format module cannot parse the file". Windows 7's default image viewer opens it without issue, save for the clipping issue.
My code is as follows, for writing:
B4X:
Sub SaveBtn_Click
DateTime.DateFormat = "yyyyMMdd_HHmmss"
Dim result As Int
result = Msgbox2("Save file as what format?", "Save Image", "PNG", "Cancel", "JPG", Null)
Select Case result
Case DialogResponse.POSITIVE
Dim filename As String = "Scrotter4A_" & DateTime.Date(DateTime.now) & ".png"
Dim Out As OutputStream
Out = File.OpenOutput(File.Combine(File.DirRootExternal, "Scrotter/"), filename, False)
FinalBitmap.WriteToStream(Out, 100, "PNG")
ToastMessageShow ("File saved to the sdcard at /sdcard/Scrotter/" & filename & ".", True)
Case DialogResponse.NEGATIVE
Dim filename As String = "Scrotter4A_" & DateTime.Date(DateTime.now) & ".jpg"
Dim Out As OutputStream
Out = File.OpenOutput(File.Combine(File.DirRootExternal, "Scrotter/"), filename, False)
FinalBitmap.WriteToStream(Out, 95, "JPEG")
ToastMessageShow ("File saved to the sdcard at /sdcard/Scrotter/" & filename & ".", True)
End Select
End Sub
Any ideas?
Last edited: