以下内容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安装包
create morphed images with TGA/IMG/BMP/GIF/IPI/PCX files(630KB)
Finding People in Images and Videos,dalal大神的毕业论文130多页,我打印出一部分看过,理解hog很有用,光流部分还没看。还有另一个人毕业论文,放这里,怕自己以后找不到
[智慧物流](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.
Navneet Dalal的博士论文。比较长,150页。
"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
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
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 ...
对一副没有约束的含GPS信息图片进行检测识别与分割,分割成树的形式,在此基础上进行行为分析等。
[输入图片说明](https://images.gitee.com/uploads/images/2018/0722/180627_5694fa33_722815.png "微信截图_20180722180456.png") 2.报表汇总包含日报/周报 ![输入图片说明]...
r16/lichee/out/sun8iw5p1/linux/common/buildroot/build/buildroot-config/conf --silentoldconfig Config.in # # make dependencies written to .auto.deps # ATTENTION buildroot devels! # See top of this file...
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 { ....
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 ...
Malware Images Visualization and Automatic Classification Web 安全之机器学习 提到的恶意文件图像识别机制,本论文提供恶意图像可视化和自动分类的方法
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.