This is my next extension, the purpose of which is to take a photo with any representation of the layout superimposed on it. With this application, only fantasy can limit its photo creation applications.
Here is a usage example that provides insights, but not all the possibilities. For example, you can capture coordinates on a photo or create a drawing on a photo. Here are some examples of photo overlays.
viewfinder example and sample photo: :
when creating the extension, I tried to take into account the compactness of use, without piling up incomprehensible blocks.
brief annotations are written in all blocks
how to use:
this is the first traditional feature
here you can specify the component on which your overlay view layout is located. that is, I made it simpler and clearer. it is not necessary to add overlay components later, but on the contrary, we add the camera background to the component. and do not forget that if you set the background color in the specified layout, the camera will not be visible. so the background must be colorless to see the camera broadcast.
as soon as the camera is initialized (also when you turn it over, change cameras) this will be reflected in the CameraReady event.
this function outputs a string of all supported photo sizes in the camera in the format width x height(4000x3000,…) the quality of the photo and its size depend on it. the list can be quite a long one. it should be understood that the front and rear cameras can and will have a different set, including the maximum resolution, so when changing the camera, this should be taken into account.
sets the image quality in the photo.takes an integer value up to 100
in this block, you can set the size of the photo by the index. you don’t have to install it, then the camera will be saved in the default size.
returns the photo resolution
switch between the front and rear camera. important! The camera does not start if it cannot support the specified resolution.
flash control. Attention! If the front camera is working, the flash will not work. these are the features of the flash. it depends on the camera. In total, the flash will be monitored if the back camera is turned on
indicates how the camera is oriented now. horizontally or vertically (Portrait or Landscape)
only for the front camera. this function will make the final photo mirrored upside down (will lead to the correct view). I noticed that all the cameras I’ve seen save photos as they see them, but in reality you can flip the image.
save the photo to the specified directory and the file name of the specified prefix with the date and time in the file name. by default, this is the DCIM/PhotoPlus directory. the default file prefix is PhotoPlus_. you can change it as you wish.the final format will look something like this: “/storage/emulated/0/DCIM/PhotoPlus/PhotoPlus_20240718_100121.jpg”
The photo will be immediately available in the Gallery!
The overlays themselves may differ slightly in size in the preview and the finished photo due to the peculiarities of scaling. I have been working on the problem of scale and made adjustments, but it is very difficult to achieve a perfect match keep this in mind and don’t throw slippers at me for it
after saving the photo, this event is triggered indicating the path to the file. it is the actual path , and not the URL of the content link, which is convenient in further application.
the list of photos opens via the available applications. (for example, a Gallery or a Google photo)
the event occurs in cases of an error
for the extension to work, you need to declare two standard and harmless permissions: -------android.permission.CAMERA
android.permission.WRITE_EXTERNAL_STORAGE (for Android 10 and below (SDK 29))
(annotations are already included in the extension, you only need to request them)
Download:
testapk:PhotoPlus.apk (4.6 MB)
aix: I will post after 20 likes
aia: oh, look at the same conditions as aix
…
the condition is fulfilled
PhotoPlus_v1.aix (19.7 KB)
TEST96_PhotoPlus.aia (134.4 KB)