以下内容Sinfrancis版权所有,专注请注明来自 http://mdev.cc/dev
Hi ben, it is very easy to Zoom in and zoom out Images. take a look here
using UP and Down Arrow keys , u can zoom in and zoom out the images.
zooming.java
import android.app.Activity;
import android.os.Bundle;
public class zooming extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(new Zoom(this));
}
}
Zoom.java
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.drawable.Drawable;
import android.view.KeyEvent;
import android.view.View;
public class Zoom extends View {
private Drawable image;
private int zoomControler=20;
public Zoom(Context context)
{
super(context);
image=context.getResources().getDrawable(R.drawable.icon);
setFocusable(true);
}
@Override
protected void onDraw(Canvas canvas) {
// TODO Auto-generated method stub
super.onDraw(canvas);
//here u can control the width and height of the images........ this line is very important
image.setBounds((getWidth()/2)-zoomControler, (getHeight()/2)-zoomControler,(getWidth()/2)+zoomControler, (getHeight()/2)+zoomControler);
image.draw(canvas);
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if(keyCode==KeyEvent.KEYCODE_DPAD_UP)// zoom in
zoomControler+=10;
if(keyCode==KeyEvent.KEYCODE_DPAD_DOWN) // zoom out
zoomControler-=10;
if(zoomControler<10)
zoomControler=10;
invalidate();
return true;
}
}
分享到:
相关推荐
ZOOM安装包
Finding People in Images and Videos,dalal大神的毕业论文130多页,我打印出一部分看过,理解hog很有用,光流部分还没看。还有另一个人毕业论文,放这里,怕自己以后找不到
[智慧物流](https://images.gitee.com/uploads/images/2019/0614/130751_e439728b_2327318.png "左侧打开预览图") ![舆情分析](https://images.gitee.com/uploads/images/2019/0614/130021_887dc34c_2327318.png "...
[智慧物流](https://images.gitee.com/uploads/images/2019/0614/130751_e439728b_2327318.png "智慧物流.png") ![舆情分析](https://images.gitee.com/uploads/images/2019/0614/130021_887dc34c_2327318.png "...
npm i react-native-fade-in-out-slideshow 导入React Native import Slideshow from ' react-native-fade-in-out-slideshow ' 例子 const items = [ { image: ' ...
The book presents selected methods of object detection and recognition with special stress on statistical and – relatively new to this domain – ...in many projects and proved to be useful in practice.
"Object Detection and Recognition in Digital Images" addresses key problems of CV focusing on the significant issues of object detection, tracking, and recognition in images, which are not easily ...
[输入图片说明](https://images.gitee.com/uploads/images/2021/0108/165504_43ab97cf_344794.jpeg "QQ图片20210108165027.jpg") ![输入图片说明]...
* Accompanied by a public domain system called MG which is a fully worked-out operational example of the advanced techniques developed and explained in the book * New appendix on an existing digital ...
8000多张yolov5交通牌目标检测数据集dataset2,数据集目录已经配置好,划分好 train,val, test,并附有data.yaml文件,yolov5、yolov7、yolov8等算法...train: ./train/images val: ./valid/images test: ./test/image
As more images and videos are becoming available in compressed formats, researchers have begun designing algorithms for different image operations directly in their domains of representation, leading ...
Web of Science-Journal Title Abbreviations--Part 2 Date: 2011-5-11 Author: Andy Wang ... 1,Abbreviation of Journals and proceedings from Web of Science; 2,You can Import it to Endnote as term list
[输入图片说明](https://images.gitee.com/uploads/images/2018/0722/180627_5694fa33_722815.png "微信截图_20180722180456.png") 2.报表汇总包含日报/周报 ![输入图片说明]...
With the ever-growing production, use, and exploitation of digital visual information (e.g., documents, websites, images, videos, and movies), a visual overflow will occur, and hence demands are ...
npm install --save react-images-zoom 或者 yarn add react-images-zoom import React from 'react' ; import Lightbox from 'react-images-zoom' ; export default class Sample extends React . Component { ....
We propose a scalable, efficient and accurate approach to retrieve 3D models for objects in the wild. Our contri- bution is twofold....ShapeNet given RGB images of objects in the wild.
6000~8000之间:红色}](https://images.gitee.com/uploads/images/2021/0925/104208_ab42ad8c_8254421.png "用户列表-展示工资样式.png") ![员工列表-筛选部门]...
[Image text](https://images.gitee.com/uploads/images/2021/0624/110700_4275874f_1204097.png) # VNPY官方 VNTrader (基于期货CTP接口专用量化交易开源软件) #### 介绍 VNTrader是VNPY官方 ...