I have developed an application in android which contains videos. Now I want to take screen shots from that running video. Is anybody having any idea regarding this thing.
Pleas provide some example code or links.
What you need is using MediaPlayer. Put SurfaceView to your layout and provide it to the MediaPlayer. After the playback is begun you will be able to get snapshot from SurfaceView.
If you want to take the screenshot of your full screen (with status bar and all) you cannot do that programatically unless you have a rooted phone. If you want the screenshot of your app only, then you can.
If you don't want it programatically, then you can-
Go to "Devices" view in eclipse and you have a screenshot (camera like) button there. You can find it from from Window -> Show View.
Try android-screenshot-library
these links may help you
capture screenshot of playing video and mailing that screen shot
http://code.google.com/p/android-screenshot-library/w/list
it worked for me
Assume your video view is inside a linearlayout, you can try:
linearlayout.setDrawingCacheEnabled(true);
linearlayout.buildDrawingCache();
Bitmap bm = linearlayout.getDrawingCache();
Related
I try to modify google sample "samples-simplevideowidge", for see the video in full screen automatically. But I can't.
I need create a empty activity, only with a video 360.
You can use directly full screen mode with
vrVideoView.setDisplayMode(VrWidgetView.DisplayMode.FULLSCREEN_MONO);
in any initial or construction method
I need to add to user interface in Android application using Camera API a frame showing ID card position with specific dimension on the screen, when the user is taking a picture.
like this:
Any suggestion?
Thank you.
You will have to make your own camera and process each frame to find and highlight edges.
It's not an easy task :)
https://www.tensorflow.org/ or OpenCV might be of interest to you.
I think you cant use android API (Android.Camera) for doing that. You can use the OpenCV to do anything in your application.
Which are the best ways to create a Camera Custom activity, using FRONT FACE CAMERA or BACK FACE, and choosing the best sizes of SurfaceView and Camera for each device?
I would want to create an activity like Instagram has, squared and with custom layouts above and below.
If there's any sample that's like this, please It would be very useful.
see https://thenewcircle.com/s/post/39/using__the_camera_api (small) or https://github.com/commonsguy/cwac-camera (with lots of enhancements)
you can try my simple library https://github.com/mistreckless/PortraitCameraSupport
but instagram developers did that by another way. They capture the entire screen image then programmatically cut the square preview you see
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 am working on camera application in android and have a page with a camera preview on half of the screen and an image gallery as shown in image below. Right now, i am using gridview to show image thumbnails in gallery. But, the problem is, i can't make the gallery scrollable(horizontally). I also found that horizontal scrolling is not supported in grid view.
The screenshot i provided is from iphone app and that is working fine. I used uicollectionview in iphone app for the same.
I can't find anything like uicollectionview in android.
Any help will be appreciated. Thanks in advance.
Or you can use additional plugins like this
You could take a look at Gallery if that is what you meant. Just take not that it recently got deprecated and you should either use a HorizontalScrollView or a ViewPager and programmatically add the items.