1. PrincipleInstead of directly changing the video aspect ratio of the codec output, the size of the video player window is changed.2. Set WindowYou need to set the window to not exceed the screen sizeMwindow.setflags (WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_ LIMITS);3. Surfaceview Maintain aspect ratioMsurfaceholder.setfixedsize (Mvideowidth, mvideoheight);4. Change Surface window sizeViewgroup.layoutparams layoutparams = (viewgroup.layoutpara
In a simple way, the gesture zoom-in and zoom-out function is implemented on android.
Package com. example. eventtest; import java. util. arrayList; import android. OS. bundle; import android. app. activity; import android. gestur
/**bitmap Amplification Method */private static Bitmap big (Bitmap Bitmap) {Matrix matrix = new Matrix ();Matrix.postscale (1.5f,1.5f); Ratio of long and wide magnification reductionBitmap resizebmp = Bitmap.createbitmap (Bitmap,0,0,bitmap.getwidth (), Bitmap.getheight (), matrix,true);return resizebmp;}/**bitmap Reduction Method */private static Bitmap Small (Bitmap Bitmap) {Matrix matrix = new Matrix ();Matrix.postscale (0.8f,0.8f); Ratio of long and wide magnification reductionBitmap resizebm
This article introduces the Android realization ImageView picture Double click enlarge and reduce the related skill, share to everybody for everybody reference, the concrete content is as follows
public class Doublescaleimageview extends ImageView implements Ontouchlistener, Ongloballayoutlistener {private Boolea
n Isfirst = false;
Private float doublescale;//Double click the magnified value private Matrix Mscalematrix;
Private float defa
This article has launched two kinds of Android gestures to realize ImageView scale picture size method, share for everybody reference, the concrete content is as follows
Method One:write the following code into Mulitpointtouchlistener.java, and then ontouchlistener your corresponding picture.For example: Imageview.setontouchlistener (New Mulitpointtouchlistener ());To change the zoom format of ImageView to
Objective
This chapter continues to improve the playback of the relevant player's core functions, for subsequent expansion lay a good foundation.
Series
1.Android uses Vitamio to build its own universal player (1)--ready
Body
I. Achievement of the goal
1.1 Brightness Control
Imitate the Vplayer interface:
1.2 Voice Control
Imitate the Vplayer interface:
1.3 Screen Zoom
According to the follow
Today, I wrote a method to handle the ondoubletap event. Double-click the program to zoom in and out the screen event, double-click the screen image to zoom in, and then double-click the screen image to zoom in to the original effect. See the results!
Source image: double-click the screen to enlarge the effect:
Paste the code below:
I. Code in mainactivty. Java
Today, I wrote a method to handle the onDoubleTap event. Double-click the program to zoom in and out the screen event, double-click the screen image to zoom in, and then double-click the screen image to zoom in to the original effect. See the results!
Source image: double-click the screen to enlarge the effect:
Paste the code below:
I. Code in MainActivty. jav
The zoomcontrols control is a zoomcontrols control that can be scaled but has the following effect:
The following are some of the main methods
Hasfocus (): determines the focus
Hide (): Hide
Ontouchevent (motionevent event): Now this method is used to handle touch screen mobile events.
Setiszoominenabled (Boolean isenabled): whether to allow Amplification
Setiszoomoutenabled (Boolean isenabled): whether to allow downgrading
Setonzoominclicklistener (view. onclicklistener listener): registers a l
Custom implementation of the Android Baidu Map zoom icon, you need to customize a zoom control, the effect is as follows:The zoom effect here enables the Click button to zoom in and out of the map, and also controls the available state of the
than the screen, the control range if (Rect.width () >= width) {if (Rect.left > 0) {deltax =-rect
. Left;
} if (Rect.right
Inside the Onscale remember to call:
/**
* Set ZOOM ratio * *
Mscalematrix.postscale (scalefactor, Scalefactor,
detector.getfocusx (), Detector.getfocusy ());
Checkborderandcenterwhenscale ();
Setimagematrix (Mscalematrix);
This is good, can be free to enlar
Android Drag and Zoom picturesMay 9, 2014We use apps that often require a view of the image. For example, in which. After clicking on the image, you can zoom in on the image.This blog describes how to drag and zoom pictures. This is the first thing to know about the touch mechanism in
Drag and zoom on Android imagesMay 9, 2014We often need to browse images in the app, such as when you click on the image to zoom in on the image.This blog describes how to drag and zoom the image, this first to understand the touch mechanism in Android, the screen has a fing
Reprint Please specify source: http://blog.csdn.net/guolin_blog/article/details/11100327In the previous article I took everyone together to achieve the effect of the image wall of the Android waterfall, although the effect is very cool, but in fact, it can only be considered a semi-finished, because all the pictures in the photo wall can only be seen can not point. Therefore, in this article, we will be able to perfect this function, add click on the
The previous article has already brought everybody to realize the free enlargement to reduce the picture, introduced the next matrix simply; Please refer to: Android to achieve gesture sliding multi-touch zoom translation Image effect, this article continues to improve our imageview.
First add the amplification after the move.
1, free to move
We are in the ontouchevent, plus the moving code, of course, m
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.