亚洲免费不卡_在线视频精品_国产尤物精品_久久久久网址_久久精品91_欧美va天堂在线_狠狠入ady亚洲精品_亚洲午夜精品福利_国产精品草草_午夜精品久久99蜜桃的功能介绍

安卓開發中Bitmap源碼實例
來源:易賢網 閱讀:1797 次 日期:2014-08-21 15:57:23
溫馨提示:易賢網小編為您整理了“安卓開發中Bitmap源碼實例”,方便廣大網友查閱!

package android.graphics;

import java.awt.image.BufferedImage;

import java.io.File;

import java.io.IOException;

import java.io.InputStream;

import javax.imageio.ImageIO;

public final class Bitmap extends _Original_Bitmap {

private BufferedImage mImage;

public Bitmap(File input) throws IOException {

super(1, true, null, -1);

mImage = ImageIO.read(input);

}

public Bitmap(InputStream is) throws IOException {

super(1, true, null, -1);

mImage = ImageIO.read(is);

}

Bitmap(BufferedImage image) {

super(1, true, null, -1);

mImage = image;

}

public BufferedImage getImage() {

return mImage;

}

// ----- overriden methods

public enum Config {

// these native values must match up with the enum in SkBitmap.h

ALPHA_8 (2),

RGB_565 (4),

ARGB_4444 (5),

ARGB_8888 (6);

Config(int ni) {

this.nativeInt = ni;

}

final int nativeInt;

/* package */ static Config nativeToConfig(int ni) {

return sConfigs[ni];

}

private static Config sConfigs[] = {

null, null, ALPHA_8, null, RGB_565, ARGB_4444, ARGB_8888

};

}

@Override

public int getWidth() {

return mImage.getWidth();

}

@Override

public int getHeight() {

return mImage.getHeight();

}

/**

* Returns an immutable bitmap from the source bitmap. The new bitmap may

* be the same object as source, or a copy may have been made.

*/

public static Bitmap createBitmap(Bitmap src) {

return createBitmap(src, 0, 0, src.getWidth(), src.getHeight(), null, false);

}

/**

* Returns an immutable bitmap from the specified subset of the source

* bitmap. The new bitmap may be the same object as source, or a copy may

* have been made.

*

* @param source The bitmap we are subsetting

* @param x The x coordinate of the first pixel in source

* @param y The y coordinate of the first pixel in source

* @param width The number of pixels in each row

* @param height The number of rows

*/

public static Bitmap createBitmap(Bitmap source, int x, int y,

int width, int height) {

return new Bitmap(source.mImage.getSubimage(x, y, width, height));

}

/**

* Returns an immutable bitmap from subset of the source bitmap,

* transformed by the optional matrix.

*

* @param source The bitmap we are subsetting

* @param x The x coordinate of the first pixel in source

* @param y The y coordinate of the first pixel in source

* @param width The number of pixels in each row

* @param height The number of rows

* @param m Option matrix to be applied to the pixels

* @param filter true if the source should be filtered.

* Only applies if the matrix contains more than just

* translation.

* @return A bitmap that represents the specified subset of source

* @throws IllegalArgumentException if the x, y, width, height values are

* outside of the dimensions of the source bitmap.

*/

public static Bitmap createBitmap(Bitmap source, int x, int y, int width,

int height, Matrix m, boolean filter) {

checkXYSign(x, y);

checkWidthHeight(width, height);

if (x + width > source.getWidth()) {

throw new IllegalArgumentException(

"x + width must be <= bitmap.width()");

}

if (y + height > source.getHeight()) {

throw new IllegalArgumentException(

"y + height must be <= bitmap.height()");

}

// check if we can just return our argument unchanged

if (!source.isMutable() && x == 0 && y == 0

&& width == source.getWidth() && height == source.getHeight()

&& (m == null || m.isIdentity())) {

return source;

}

if (m == null || m.isIdentity()) {

return new Bitmap(source.mImage.getSubimage(x, y, width, height));

}

int neww = width;

int newh = height;

Paint paint;

Rect srcR = new Rect(x, y, x + width, y + height);

RectF dstR = new RectF(0, 0, width, height);

/* the dst should have alpha if the src does, or if our matrix

doesn't preserve rectness

*/

boolean hasAlpha = source.hasAlpha() || !m.rectStaysRect();

RectF deviceR = new RectF();

m.mapRect(deviceR, dstR);

neww = Math.round(deviceR.width());

newh = Math.round(deviceR.height());

Canvas canvas = new Canvas(neww, newh);

canvas.translate(-deviceR.left, -deviceR.top);

canvas.concat(m);

paint = new Paint();

paint.setFilterBitmap(filter);

if (!m.rectStaysRect()) {

paint.setAntiAlias(true);

}

canvas.drawBitmap(source, srcR, dstR, paint);

return new Bitmap(canvas.getImage());

}

/**

* Returns a mutable bitmap with the specified width and height.

*

* @param width The width of the bitmap

* @param height The height of the bitmap

* @param config The bitmap config to create.

* @throws IllegalArgumentException if the width or height are <= 0

*/

public static Bitmap createBitmap(int width, int height, Config config) {

return new Bitmap(new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB));

}

/**

* Returns a immutable bitmap with the specified width and height, with each

* pixel value set to the corresponding value in the colors array.

*

* @param colors Array of {@link Color} used to initialize the pixels.

* @param offset Number of values to skip before the first color in the

* array of colors.

* @param stride Number of colors in the array between rows (must be >=

* width or <= -width).

* @param width The width of the bitmap

* @param height The height of the bitmap

* @param config The bitmap config to create. If the config does not

* support per-pixel alpha (e.g. RGB_565), then the alpha

* bytes in the colors[] will be ignored (assumed to be FF)

* @throws IllegalArgumentException if the width or height are <= 0, or if

* the color array's length is less than the number of pixels.

*/

public static Bitmap createBitmap(int colors[], int offset, int stride,

int width, int height, Config config) {

checkWidthHeight(width, height);

if (Math.abs(stride) < width) {

throw new IllegalArgumentException("abs(stride) must be >= width");

}

int lastScanline = offset + (height - 1) * stride;

int length = colors.length;

if (offset < 0 || (offset + width > length)

|| lastScanline < 0

|| (lastScanline + width > length)) {

throw new ArrayIndexOutOfBoundsException();

}

// TODO: create an immutable bitmap...

throw new UnsupportedOperationException();

}

/**

* Returns a immutable bitmap with the specified width and height, with each

* pixel value set to the corresponding value in the colors array.

*

* @param colors Array of {@link Color} used to initialize the pixels.

* This array must be at least as large as width * height.

* @param width The width of the bitmap

* @param height The height of the bitmap

* @param config The bitmap config to create. If the config does not

* support per-pixel alpha (e.g. RGB_565), then the alpha

* bytes in the colors[] will be ignored (assumed to be FF)

* @throws IllegalArgumentException if the width or height are <= 0, or if

* the color array's length is less than the number of pixels.

*/

public static Bitmap createBitmap(int colors[], int width, int height,

Config config) {

return createBitmap(colors, 0, width, width, height, config);

}

public static Bitmap createScaledBitmap(Bitmap src, int dstWidth,

int dstHeight, boolean filter) {

Matrix m;

synchronized (Bitmap.class) {

// small pool of just 1 matrix

m = sScaleMatrix;

sScaleMatrix = null;

}

if (m == null) {

m = new Matrix();

}

final int width = src.getWidth();

final int height = src.getHeight();

final float sx = dstWidth / (float)width;

final float sy = dstHeight / (float)height;

m.setScale(sx, sy);

Bitmap b = Bitmap.createBitmap(src, 0, 0, width, height, m, filter);

synchronized (Bitmap.class) {

// do we need to check for null? why not just assign everytime?

if (sScaleMatrix == null) {

sScaleMatrix = m;

}

}

return b;

}

}

更多信息請查看IT技術專欄

更多信息請查看網絡編程
易賢網手機網站地址:安卓開發中Bitmap源碼實例
由于各方面情況的不斷調整與變化,易賢網提供的所有考試信息和咨詢回復僅供參考,敬請考生以權威部門公布的正式信息和咨詢為準!
關于我們 | 聯系我們 | 人才招聘 | 網站聲明 | 網站幫助 | 非正式的簡要咨詢 | 簡要咨詢須知 | 新媒體/短視頻平臺 | 手機站點

版權所有:易賢網

亚洲免费不卡_在线视频精品_国产尤物精品_久久久久网址_久久精品91_欧美va天堂在线_狠狠入ady亚洲精品_亚洲午夜精品福利_国产精品草草_午夜精品久久99蜜桃的功能介绍
99热这里只有精品8| 一区二区日本视频| 日韩亚洲不卡在线| 国产伦精品一区二区三区四区免费 | 一区二区三区我不卡| 亚洲毛片播放| 午夜免费电影一区在线观看| 亚洲高清激情| 欧美黄色一区| 一区二区三区国产在线| 欧美黄色精品| 久久av一区| 亚洲久久在线| 欧美日韩在线不卡一区| 国产日韩欧美一区在线 | 亚洲一区二区三区在线观看视频| 欧美不卡在线| 性欧美暴力猛交另类hd| 影音先锋中文字幕一区| 麻豆av福利av久久av| 亚洲国产精品一区| 午夜日韩电影| 久久精品日韩| 美脚丝袜一区二区三区在线观看 | 欧美一区二区三区久久精品| 在线视频一区观看| 精品动漫3d一区二区三区免费| 午夜亚洲伦理| 国产欧美日韩综合一区在线观看| 欧美午夜在线| 久久综合中文色婷婷| 午夜亚洲性色视频| 亚洲一区bb| 国产亚洲毛片| 国产精品一级| 国产亚洲一区二区三区在线播放| 亚洲精品少妇| 中文精品视频一区二区在线观看| 黑人中文字幕一区二区三区| 欧美日韩专区| 亚洲一级黄色| 99综合视频| 一本久道综合久久精品| 亚洲精品在线免费| 国产日韩一区二区三区在线播放| 最新亚洲一区| 国产精品女主播一区二区三区| 亚洲精华国产欧美| 国产欧美大片| 裸体素人女欧美日韩| 看欧美日韩国产| 午夜精品999| 国内外成人免费视频| 精品av久久久久电影| 亚洲精品护士| 免费视频一区| 欧美日本三区| 亚洲精品系列| 噜噜噜在线观看免费视频日韩| 乱人伦精品视频在线观看| 久久高清国产| 欧美午夜a级限制福利片| 在线观看不卡| 亚洲一区一卡| 黄色另类av| 亚洲一区成人| 国内综合精品午夜久久资源| 日韩视频在线观看国产| 久久av一区二区三区亚洲| 欧美区一区二| 99热这里只有精品8| 男人的天堂成人在线| 欧美午夜不卡| 国产精品美女久久久| 欧美va天堂在线| 一区二区三区四区五区精品视频 | 玖玖国产精品视频| 影音先锋中文字幕一区| 先锋亚洲精品| 国内精品久久久久久久影视蜜臀| 999在线观看精品免费不卡网站| 国产美女诱惑一区二区| 黑丝一区二区三区| 久久久亚洲人| 国产精品试看| 亚洲黄色一区| 欧美日本精品| 免费久久久一本精品久久区| 亚洲激情网站| 欧美性久久久| 欧美不卡在线| 国产精品日韩高清| 99re热精品| 激情综合自拍| 国产精品v一区二区三区| 久久不射网站| 亚洲综合日本| 一区二区三区免费看| 伊人久久婷婷| 一区在线免费| 伊人成人网在线看| 亚洲视频碰碰| 欧美日韩在线大尺度| 久久免费黄色| 久久青青草综合| 久久国产一二区| 亚洲综合首页| 免费日韩精品中文字幕视频在线| 一本色道婷婷久久欧美| 亚洲精一区二区三区| 欧美午夜精品| 精品999在线观看| 国外成人免费视频| 伊人久久婷婷色综合98网| 欧美日韩一区二区三区在线视频| 久久福利电影| 女人色偷偷aa久久天堂| 久久先锋资源| 欧美天天视频| 亚洲国产综合在线看不卡| 亚洲成人原创| 中文网丁香综合网| 国产区日韩欧美| 欧美一级专区| 欧美久久成人| 尤物精品在线| 亚洲免费在线| 午夜国产精品视频免费体验区| 欧美一区影院| 亚洲国产成人不卡| 亚洲一区二区三区四区中文| 鲁鲁狠狠狠7777一区二区| 午夜国产欧美理论在线播放| 激情综合激情| 免费在线日韩av| 国产在线精品二区| 日韩亚洲精品在线| 久久久久国产一区二区| 欧美一区三区二区在线观看| 亚洲小说欧美另类社区| 国产精品久久久一区二区| 久久精品91| 在线看片日韩| 久久久亚洲人| 亚洲第一精品影视| 久久国产精品免费一区| 国产一区免费视频| 国产精品有限公司| 国产一区二区中文| 亚洲欧美99| 91久久精品国产91久久性色tv| 先锋影音久久| 亚洲激情网址| 欧美日韩在线精品一区二区三区| 99国内精品| 欧美日韩一区二区三区免费| 亚洲深爱激情| 精品二区视频| 欧美区一区二| 久久婷婷丁香| 国产精品毛片在线看| 激情综合电影网| 欧美精品日本| 久久精品日产第一区二区三区| 亚洲国产精品一区二区第四页av| 久久经典综合| 国产精品永久| 国产欧美韩日| 妖精视频成人观看www| 欧美/亚洲一区| 亚洲一区三区在线观看| 亚洲精品美女91| 国产一区再线| 欧美日韩一区在线播放| 欧美在线首页| 久久一综合视频| 亚洲一区三区视频在线观看| 99成人精品| 99国产精品久久久久久久成人热| 国产一区自拍视频| 国产一区二区三区四区三区四| 欧美一区在线看| 欧美a级片网站| 欧美在线一二三区| 欧美成人dvd在线视频| 久久一区二区三区av| 欧美一区不卡| 欧美日韩影院| 国内精品99| 亚洲日本免费| 日韩午夜免费视频| 国产日韩精品久久| 亚洲一区bb| 久久精品官网| 欧美私人啪啪vps| 激情综合亚洲| 日韩一区二区久久| 国产午夜久久| 六月婷婷一区| 国语对白精品一区二区| 亚洲区一区二区三区| 亚洲裸体俱乐部裸体舞表演av| 亚洲毛片播放| 媚黑女一区二区| 欧美国产专区| 亚洲黄色成人| 国产女优一区| 欧美视频四区| 一本久久综合| 老司机午夜精品视频| 欧美日韩国产三区| 亚洲人成久久| 久久精品二区三区| 在线观看亚洲视频啊啊啊啊| 一本色道精品久久一区二区三区| 免费不卡亚洲欧美| 狠久久av成人天堂| 亚洲欧美卡通另类91av| 午夜日韩激情| 国产亚洲精品久久飘花| 午夜日韩视频| 国产一区二区三区的电影| 久久亚洲一区| 亚洲深爱激情| 国产精品红桃| 久久久久国产精品一区三寸| 激情欧美丁香| 久久亚洲综合| 一本综合精品| 欧美日韩在线不卡一区| 在线亚洲精品| 亚洲视频高清| 女生裸体视频一区二区三区| 在线综合亚洲| 国内视频精品| 午夜精品视频| 久久精品综合| 亚洲永久免费精品| 亚洲日本免费| 黄色国产精品一区二区三区| 午夜亚洲影视| 国产欧美亚洲日本| 在线不卡亚洲| 黄色在线成人| 欧美三级午夜理伦三级中文幕| 亚洲一区免费| 国产一级精品aaaaa看| 一区二区三区我不卡| 欧美日本亚洲韩国国产| 久久aⅴ乱码一区二区三区| 一区二区三区欧美成人| 亚洲成人在线| 亚洲成色精品| 亚洲午夜在线| 韩日成人在线| 欧美日一区二区三区在线观看国产免| 亚洲欧美日韩精品一区二区| 国产日韩高清一区二区三区在线| 一区二区自拍| 亚洲视频碰碰| 亚洲激情一区二区| 亚洲精品社区| 中文一区在线| 亚洲一区二区免费看| 一本色道久久综合亚洲精品高清 | 午夜一区不卡| 国产伦精品一区二区三区四区免费| 亚洲激情婷婷| 亚洲免费黄色| 亚洲在线播放| 免费在线国产精品| 欧美福利在线| 尤物精品在线| 一本不卡影院| 欧美亚洲专区| 牛牛国产精品| 精品96久久久久久中文字幕无| 激情成人综合| 国产精品女主播一区二区三区| 国产精品一区二区三区免费观看| 国产伦精品一区二区三区视频黑人| 午夜亚洲激情| 国产精品v欧美精品v日韩| 在线国产日韩| 亚洲一区二区三区免费在线观看| 性高湖久久久久久久久| 欧美区国产区| 亚洲精品美女91| 亚洲免费影视| 激情久久一区| 性感少妇一区| 亚洲午夜伦理| 美女诱惑黄网站一区| 欧美二区不卡| 亚洲看片一区| 久久xxxx精品视频| 伊人久久综合| 牛牛国产精品| 国产一区成人| 好吊色欧美一区二区三区四区| 国产欧美在线| 国产综合激情| 久久不射网站| 亚洲国产影院| 快she精品国产999| 一区二区福利| 国内一区二区在线视频观看| 国产亚洲精品bv在线观看| 国产精品国色综合久久| 国产亚洲毛片在线| 亚洲性图久久| 午夜精品剧场| 久久av免费一区| 一区二区三区四区国产| 午夜久久资源| 欧美中日韩免费视频| 亚洲国产综合在线看不卡| 欧美伊人影院| 久久天堂精品| 欧美专区18| 中文日韩在线| 1024成人| 亚洲国产高清一区二区三区| 美女亚洲精品| 国产亚洲欧洲| 一本色道久久综合亚洲二区三区| 国模大胆一区二区三区| 欧美精品国产一区| 欧美.www| 午夜欧美精品| 久热re这里精品视频在线6| 国产精品日韩高清| 一本色道久久综合亚洲精品不卡| 亚洲视频狠狠| 亚洲调教视频在线观看| 欧美视频成人| 国产一区二区三区四区hd| 欧美日韩mv| 狠狠色综合一区二区| 国产精品豆花视频| 黄色成人在线网站| 在线不卡视频| 一区二区欧美日韩| 国产欧美一区二区三区另类精品 | 欧美.www| 欧美在线免费| 欧美日本一区二区高清播放视频| 久久青青草原一区二区| 欧美一区二区三区另类 | 久久久www| 久久另类ts人妖一区二区| 久久久精彩视频| 欧美日韩一区二区三区四区在线观看| 欧美精品一区在线| 国模一区二区三区| 亚洲国内在线| 亚洲一区二区高清视频| 久久经典综合| 国产在线视频欧美一区二区三区| 亚洲小说欧美另类社区| 一区二区欧美日韩| 久久久一本精品99久久精品66| 久久人人97超碰国产公开结果| 欧美日韩精品久久| 91久久国产自产拍夜夜嗨| 国产精品日韩一区二区三区| 久久精品动漫| 亚洲无线视频| 欧美中文字幕| 亚洲一二三区在线| 一区二区三区四区国产| 欧美一区激情视频在线观看| 亚洲一级二级| 久久福利一区| 1024成人| 欧美一区成人| 亚洲开发第一视频在线播放| 校园激情久久| 亚洲欧洲一区| 欧美日本一区| 亚洲欧美日本国产专区一区| 国产精品v日韩精品v欧美精品网站| 亚洲精品国产日韩| 欧美精品国产一区| 亚洲色诱最新| 激情久久中文字幕| 久久在线91| 国产一区二区三区的电影| 欧美日韩1区| 久久av在线| 国产亚洲欧美另类一区二区三区| 国产在线欧美| 欧美在线资源| 久久精品国产综合精品| 在线视频一区观看| 欧美色综合网| 玖玖国产精品视频| 亚洲中字在线| 国产伦精品一区二区三区高清版| 激情婷婷久久|