Sub Cam_Complete(Success As Boolean, Image as Bitmap, VideoPath As String)
If Success Then
If Image.IsInitialized Then
btnDelete_Click 'delete previous chached images'
imgCL.ContentMode = imgCL.MODE_FIT
imgCL.Bitmap = Image
Dim out as OutputStream = File.OpenOutput(path, fname, False)
Image.Rotate(90).WriteToStream(out, 50, "JPEG")
Dim p as Phone
p.AddImageToAlbum(LoadBitmap(path, fname))
End If
End If
End Sub
Image.WriteToStream(out, 50, "JPEG")
it's only a different shot -.-I'm not sure if you are joking but the second image is a completely different image to the first. Look elsewhere in your code for whatever the problem is.
Sorry but I still don't understand your problem?
You should use same image in example, not two different images.
dim im as bitmap = Image.Rotate(90)
im.WriteToStream(out, 50, "JPEG")
I put both the images in the first post just to give to all of you a reference. I thought it was clear that the first photo isn't representing the real-world in a correct way ?... compared to the one I classified like "the good one" (the second).where I still can't really see the stretching despite now knowing what to look for!
First thing I would do is put the image on a PC and display it with several different image viewers
The only thing I can suggest is that you try saving without rotation then reload an image from the file, rotate it and save again to see if that makes any difference.
B4X:dim im as bitmap = Image.Rotate(90) im.WriteToStream(out, 50, "JPEG")
Sub Cam_Complete (Success As Boolean, image As Bitmap, VideoPath As String)
If Success Then
If image.IsInitialized Then
imageview.ContentMode = imageview.MODE_FIT
imageview.Bitmap = image
Dim out As OutputStream = File.OpenOutput(File.DirLibrary & "/" & "TestBitmap", "bitmap.jpeg", False)
image.WriteToStream(out, 50, "JPEG")
out.Close
Dim im As Bitmap = LoadBitmap(File.DirLibrary & "/" & "TestBitmap", "bitmap.jpeg")
If Switch1.Value Then
im = im.Rotate(90)
End If
Dim p As Phone
p.AddImageToAlbum(im)
End If
End If
End Sub
Not necessarily, it depends on how the EXIF data is treated within an Image and written to file.Technically should be similar to this
So you mean rotate and THEN WriteToStreamYou have only rotated the image in memory.
Yes.
Sub Cam_Complete (Success As Boolean, image As Bitmap, VideoPath As String)
If Success Then
If image.IsInitialized Then
If Switch1.Value Then
image = image.Rotate(90)
End If
imageview.ContentMode = imageview.MODE_FIT
imageview.Bitmap = image
Dim out As OutputStream = File.OpenOutput(File.DirLibrary & "/" & "TestBitmap", "bitmap.jpeg", False)
image.WriteToStream(out, 50, "JPEG")
out.Close
Dim p As Phone
p.AddImageToAlbum(image)
End If
End If
End Sub
Try putting the imageview inside a panel and rotating the panelThis is the updated function. Same result. when the switch is on, the image is squeezed instead of rotated
B4X:Sub Cam_Complete (Success As Boolean, image As Bitmap, VideoPath As String) If Success Then If image.IsInitialized Then If Switch1.Value Then image = image.Rotate(90) End If imageview.ContentMode = imageview.MODE_FIT imageview.Bitmap = image Dim out As OutputStream = File.OpenOutput(File.DirLibrary & "/" & "TestBitmap", "bitmap.jpeg", False) image.WriteToStream(out, 50, "JPEG") out.Close Dim p As Phone p.AddImageToAlbum(image) End If End If End Sub
Try putting the imageview inside a panel and rotating the panel
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?