Bitmap bitmap = new Bitmap("1.jpg"); TextureBrush b = new TextureBrush(bitmap);//指定纹理图片 Pen p = new Pen(b, 30);//创建画笔 ...
分类:
其他好文 时间:
2015-01-20 15:16:33
阅读次数:
146
一、Bitmap转DrawableBitmap bm=xxx; //xxx根据你的情况获取BitmapDrawable bd=new BitmapDrawable(bm);因为BtimapDrawable是Drawable的子类,最终直接使用bd对象即可。二、 Drawable转Bitmap转成Bi...
分类:
其他好文 时间:
2015-01-20 10:15:00
阅读次数:
97
Color c = new Color();//创建颜色对象 Bitmap bitmap = new Bitmap(this.BackgroundImage);//创建BITMAP对象 int x = Cursor.Position.X;//鼠标x坐标 ...
分类:
其他好文 时间:
2015-01-19 18:57:59
阅读次数:
200
近期在工作中,由于Activity的背景图片均为1280 * 720大小的,引发了一系列的OOM问题。做了一些处理,心得如下: 1.首先为什么会出现OOM呢。对于一张1280 * 720的图片,它应该占多大的内存呢? 一张图片(bitmap)占用的内存大小大概等于图片的长度 * 图片的宽度(像素)*...
分类:
其他好文 时间:
2015-01-19 18:38:43
阅读次数:
109
关于图像直方图均衡化的原理和步骤先不作讨论,我就看看代码吧。 private Bitmap picequalization(Bitmap basemap, int width, int height) { Bitmap retmap = new Bitmap(b...
1、主要的绘制图片方法 //Bitmap:图片对象,left:偏移左边的位置,top: 偏移顶部的位置 drawBitmap(Bitmap bitmap, float left, float top, Paint paint)2、对图片剪接和限定显示区域 drawBitmap(Bitmap bit....
分类:
移动开发 时间:
2015-01-16 20:41:16
阅读次数:
161
简介之前往往是通过Bitmap、Drawable和Canvas配合完成,需要写一系列繁杂的逻辑去缩小原有图片,从而得到缩略图。现在我给大家介绍一种比较简单的方法:(网上有)在Android 2.2版本中,新增了一个ThumbnailUtils工具类来是实现缩略图,此工具类的功能是强大的,使用是简单,...
分类:
移动开发 时间:
2015-01-16 18:57:33
阅读次数:
135
在进行Android开发的过程中,在一个非Activity类(此处假设类名为MyNewClass)中引用了getResources()方法,如下: Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.marke.....
分类:
移动开发 时间:
2015-01-16 18:26:09
阅读次数:
193
1、效果图
2、自定义代码:
public class ImageTextView extends View implements OnClickListener {
private Paint mImagePaint;
private Paint mTextPaint;
private int mTextSize=16;
private Bitmap imageBitmap;...
分类:
其他好文 时间:
2015-01-16 16:46:49
阅读次数:
115
android 对图片编码解码demopackage com.example.appdemos;import java.io.ByteArrayOutputStream;import android.app.Activity;import android.graphics.Bitmap;import...
分类:
移动开发 时间:
2015-01-16 14:40:10
阅读次数:
171