I want to save off a Bitmap of the current screen for my users to share, but I only want to do a partial (I want to remove the areas that have user buttons and such).
I have found code on taking a full screenshot, but cannot figure out how to do this.
Hoping there is something easy that I am just missing.
Thanks in advance.
Put the partial area of which the screenshot is to be taken in a ViewGRoup say RelativeLayout. Then when you launch the Activity just make sure to build the drawing cache as follows
relativeLayout = (RelativeLayout)findViewById(R.id.relativeLayout);
relativeLayout.setDrawingCacheEnabled(true);
relativeLayout.buildDrawingCache();
And then when you actually want ot take the screenshot of that particular area, just get the Screenshot in the form of a Bitmap from the drawing cache
bitmap = relativeLayout.getDrawingCache();
You can place elements in Frame Layout which you want to in screen shot.
Then you can take screen shot of Frame layout.
You can refer this Link : http://divyamotiwala.blogspot.in/2013/10/taking-screenshot-of-layout-in-android.html
Related
Lets say this picture below is a full screen custom camera, how could I capture a square photo from the inside of that red square?
I chose this approach on custom camera to avoid THIS kind of problem which results to a squashed preview for square camera. After the process the output should be like this :
I just want to try the solution that Instagram used to prevent that squashed-image-from-square-camera issue, I read it from the accepted answer of #xramos from THIS LINK also.
Here's what he said :
Please help me fellow prgrammers :) Thank you and have a good day :D
I want to take an particular part of an image from the image preview. Is it possible, if so how to do that?
for ex,
I just want to show some limit to the user, so they can take partial part of an image. How to show my surface view like the given above picture and how to take particular part of an image??
Thanks is in advance.
I don't know of any way to capture less than the full preview. You could display the crop marks as an overlay, and retrieve that portion of the bitmap in post-processing after you capture the image.
I was worried if an Image view over another image view can be z-indexed? and brought to front or back. Is there any options for this?
Thanks in advance.
you can use frame layout to achieve that. Have a look a look at this link
You can use one ImageView for that.
If you want to switch between images in an ImageView you can use a LevelListDrawable.
If you want all images to be drawn in a certain z-order you can use a LayerDrawable.
I would like to know if we can edit the picture that we take from a camera and store it on our Phone. Can we make use of android.graphics package to edit the picture.
One of the sample picture has has been edited on the top width is this as you can see the image has been clipped from the top center just below the word "Discovery". Is this possible on Andriod?
Yes, you can make a Canvas out of a bitmap, and then use canvas drawing commands to mutate and save it again.
I'm not really sure what you're asking, though.
In my application i want displaying the one image as half of the screen and below i am producing that image spelling and below display that image name letters as shuffled and kid will take one image and place into into that place in above spelling.For example see following website
//www.youtube.com/watch?v=_LSlYYu3F0k
For this how can i design my layout(xml)Please gice me some code suggestions.Thanks in advance
With a layout based on xml you wont get a result like that on the video.
You should use 2D/3D based SurfaceView/GLSurfaceView and draw on the canvas what you need and where you need it.