I am using Camera2 to take a picture and save it to the download directory using the logic from the Camera2 sample as follows.
Note that I am currently setting the name of the jpg file to the date, time, latitude, and longitude of the picture.
In
www.b4x.com
Erel gives a method to add an image of a compass to an image as follows.
I would like to add a label with the latitude and longitude of the location of the picture.
Preferably, the label would be transparent and across the bottom of the picture.
The image with the label would be downloaded.
Any help would be appreciated,
Thanks, Cl;iff McKibbin
Note that I am currently setting the name of the jpg file to the date, time, latitude, and longitude of the picture.
B4X:
Sub TakePicture
Try
xErr="Focus and Take Picture"
Wait For(cam.FocusAndTakePicture(MyTaskIndex)) Complete (Data() As Byte)
Dim bmp As Bitmap = cam.DataToBitmap(Data)
' set name of jpg
x="LL" & Starter.llnr
DateTime.DateFormat="yyyy-MM-dd hh-mm "
X=x & DateTime.Date (MarkTime)
X=x & "Lat " & ActLat & " Lg " & ActLg
' Log ("Actlat " & ActLat)
X=x & ".jpg"
xErr="Data to File"
cam.DataToFile(Data, VideoFileDir, x)
Catch
MsgboxAsync (xErr, "Error in Take Picture")
Return
End Try
End Sub
In
[SOLVED]Capture image from Camera2 with overlaid compass
Hi everybody: I use Camera2 to make pictures in my app. In some of these pictures, I need to know the compass orientation, so I've overlaid a compass over the camera preview, and I need to save the image with the overlaid compass. I've tried to define pnlCamera as B4XView ...
B4X:
Dim bmp As B4XBitmap = cam.DataToBitmap(Data)
Dim bmp2 As B4XBitmap = LoadBitmap(File.DirAssets, "android-chrome-192x192.png")
Dim bc As BitmapCreator
bc.Initialize(bmp.Width, bmp.Height)
bc.CopyPixelsFromBitmap(bmp)
Dim r As B4XRect
r.Initialize(20dip, 20dip, 0, 0)
r.Width = bmp2.Width
r.Height = bmp2.Height
bc.DrawBitmap(bmp2, r, False)
Dim mergedbmp As B4XBitmap = bc.Bitmap
I would like to add a label with the latitude and longitude of the location of the picture.
Preferably, the label would be transparent and across the bottom of the picture.
The image with the label would be downloaded.
Any help would be appreciated,
Thanks, Cl;iff McKibbin