小编swa*_*dhi的帖子

在鼠标移动中获取fabric.js中图像像素的rgb值

如何在鼠标移动中获取fabric.js中图像的rgb值.我使用了图像对象的getFill()方法,但它返回(0,0,0).请帮我

javascript html5 html5-canvas fabricjs

7
推荐指数
1
解决办法
2923
查看次数

用facebook javascript api发邮件

我正在尝试为我的应用程序获取Facebook用户电子邮件.但是当我查询时,电子邮件地址将返回为undefined.我没有得到如何处理它.

这是我的代码 -

<body>
  <script>
    function statusChangeCallback(response) {
      console.log('statusChangeCallback');
      console.log(response);

      if (response.status === 'connected') {

        testAPI();
      } else if (response.status === 'not_authorized') {

        FB.login(function(response) {}, {
          scope: 'email'
        });
        document.getElementById('status').innerHTML = 'Please log ' +
          'into this app.';
      } else {
        FB.login(function(response) {}, {
          scope: 'email'
        });
        document.getElementById('status').innerHTML = 'Please log ' +
          'into Facebook.';
      }
    }

    function checkLoginState() {
      FB.getLoginStatus(function(response) {
        statusChangeCallback(response);
      });
    }

    window.fbAsyncInit = function() {
      FB.init({
        appId: 'app id',
        cookie: true, // …
Run Code Online (Sandbox Code Playgroud)

javascript facebook facebook-javascript-sdk facebook-graph-api-v2.0

4
推荐指数
1
解决办法
3431
查看次数

在Java中更改图像颜色

我正在尝试更改图像的颜色。因此,我使用以下代码

public class Picture {

String img_name;
BufferedImage buf_img;
int width;
int height;

public Picture(String name) {
    this.img_name = name;

    try {
        buf_img = ImageIO.read(new File(img_name));
    } catch (IOException ex) {
        Logger.getLogger(Picture.class.getName()).log(Level.SEVERE, null, ex);
    }
}

public Picture(int w, int h) {
    this.width = w;
    this.height = h;
    buf_img = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
}

public int width() {
    width = buf_img.getWidth();
    return width;
}

public int height() {
    height = buf_img.getHeight();
    return height;
}

public Color get(int col, int …
Run Code Online (Sandbox Code Playgroud)

java image

1
推荐指数
1
解决办法
7351
查看次数

用于肝脏的Matlab图像分割

我正在努力在matlab中分割图像.我的目标是从ct扫描图像中提取肝脏.这是样本图像.

我为这个样本图像提取了肝脏,输出就像这样 样本图像的输出图像.我的实现代码是

function [] = Code4( image_file )
image = imread(image_file);       
[height, width, planes] = size(image);
rgb = reshape(image, height, width * planes);
r = image(:, :, 1);             
g = image(:, :, 2);             
b = image(:, :, 3);             

% since r,g & b are of equeal values, we will be considering only r.

mask=r>120 & r<140 ;  % range of color component for liver
labels = bwlabel(mask);
id = labels(111, 200);

% get the mask containing only the …
Run Code Online (Sandbox Code Playgroud)

matlab image image-processing image-segmentation

-1
推荐指数
1
解决办法
1365
查看次数