java image getwidth_Java BufferedImage.getWidth方法代碼示例

本文整理匯總了Java中java.awt.image.BufferedImage.getWidth方法的典型用法代碼示例。如果您正苦於以下問題:Java BufferedImage.getWidth方法的具體用法?Java BufferedImage.getWidth怎麽用?Java BufferedImage.getWidth使用的例子?那麽恭喜您, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類java.awt.image.BufferedImage的用法示例。

在下文中一共展示了BufferedImage.getWidth方法的19個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於我們的係統推薦出更棒的Java代碼示例。

示例1: apply

​點讚 3

import java.awt.image.BufferedImage; //導入方法依賴的package包/類

@Override

public final BufferedImage apply(BufferedImage img) {

float[][] matrix = getMatrix();

float[] data = getKernelData(matrix);

if(normalize)

normalize(data);

scale(data);

if(isZero(data))

return new BufferedImage(img.getWidth(), img.getHeight(), BufferedImage.TYPE_INT_RGB);

Kernel k = new Kernel(matrix[0].length, matrix.length, data);

ConvolveOp op = new ConvolveOp(k, ConvolveOp.EDGE_NO_OP, null);

BufferedImage img2 = new BufferedImage(img.getWidth(), img.getHeight(), BufferedImage.TYPE_INT_RGB);

img2.getGraphics().drawImage(img, 0, 0, null);

return op.filter(img2, null);

}

開發者ID:CalebKussmaul,項目名稱:GIFKR,代碼行數:20,

示例2: loadCropResult

​點讚 3

import java.awt.image.BufferedImage; //導入方法依賴的package包/類

/**

* Load the segmented result of the crop image to a visualisation panel.

*/

private void loadCropResult(BufferedImage cropResult) {

// remove the old image if it exists

if (dPCropResult != null) {

this.remove(dPCropResult);

jPCropResult.remove(dPCropResult);

}

// load the viewer of the result

dPCropResult = new ResultPanel(cropResult, new Dimension(cropResult.getWidth(), cropResult.getHeight()), cropWindowConfig.getObjectColor());

dPCropResult.updateResultImg();

dPCropResult.setBackground(new java.awt.Color(255, 255, 255));

jPCropResult.add(dPCropResult);

this.validate();

this.repaint();

}

開發者ID:buni-rock,項目名稱:Pixie,代碼行數:22,

示例3: apply

​點讚 3

import java.awt.image.BufferedImage; //導入方法依賴的package包/類

@Override

protected BufferedImage apply(BufferedImage img) {

float flength = 1 + (img.getWidth()-1) * threshold;

int length = Math.round(flength);

for (int y = 0, x = 0; y < img.getHeight(); y++) {

for(x = 0; x < img.getWidth() && ((img.getRGB(x, y) & 0xFF000000) == 0); x++);

int firstEnd = Math.round(flength*(x/length +1)) -1;

line(img, x, Math.min(img.getWidth()-1, firstEnd), y);

x = firstEnd+1;

for(float fx = x; x < img.getWidth()-length && ((img.getRGB(x + length, y) & 0xFF000000) != 0); fx += flength, x = Math.round(fx))

line(img, x, Math.round(fx + flength)-1, y);

int end = x;

for(; end < img.getWidth() - 1 && ((img.getRGB(end, y) & 0xFF000000) != 0); end++);

line(img, x, end, y);

}

return img;

}

開發者ID:CalebKussmaul,項目名稱:GIFKR,代碼行數:24,

示例4: resizeImage

​點讚 3

import java.awt.image.BufferedImage; //導入方法依賴的package包/類

private static BufferedImage resizeImage(BufferedImage sample, double sampleMinLat, double sampleMaxLat, double tileMinLat, double tileMaxLat) {

BufferedImage img = new BufferedImage(TILE_SIZE, TILE_SIZE, BufferedImage.TYPE_3BYTE_BGR);

double tileScale = TILE_SIZE / (tileMinLat - tileMaxLat);

// s for source; d for destination; all measurements in pixels

int sx1 = 0;

int sy1 = 0;

int sx2 = sample.getWidth();

int sy2 = sample.getHeight();

int dx1 = 0;

int dy1 = (int) ((sampleMaxLat - tileMaxLat) * tileScale);

int dx2 = TILE_SIZE;

int dy2 = (int) ((sampleMinLat - tileMaxLat) * tileScale);

img.createGraphics().drawImage(sample, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2, null);

return img;

}

開發者ID:iedadata,項目名稱:geomapapp,代碼行數:20,

示例5: uploadTextureImageSubImpl

​點讚 3

import java.awt.image.BufferedImage; //導入方法依賴的package包/類

private static void uploadTextureImageSubImpl(BufferedImage p_110993_0_, int p_110993_1_,

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值