🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: cn.bbs.comp.lang.java
Article #24153

Re: ask about Image to array

#24153
From: ���
Date: Thu, 14 May 1998 00:00
30 lines
1571 bytes
        int[] pixels = new int[w * h];
        PixelGrabber pg = new PixelGrabber(img, x, y, w, h, pixels, 0, w);
        try {
        ^^^^^
             pg.grabPixels();
             ^^^^^^^^^^^^^^^^
        } catch (InterruptedException e) {
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            System.err.println("interrupted waiting for pixels!");
            return;
        }
        if ((pg.getStatus() & ImageObserver.ABORT) != 0) {
            System.err.println("image fetch aborted or errored");
            return;
        }
�� �� lion (lion) �Ĵ������ᵽ: ��
: Hi, i meet some problem when i am doing an image processing program.
: i draw an Image first, and then i want to get the array according to the
: image, i use PixelGrabber, but it seems doesn't work.
: here is the example of my problem:
: Graphics g=new bufferImg.getGraphics();
: g.drawLine(0,0,100,100);
: PixelGrabber grabber=new PixelGrabber(bufferImg,0,0,w,h,p,0,w);
: but i got p is filled with 0.
: any help will be appreciated.


--
�� ��Դ:���ϴ�С�ٺ���Ϣ����վ bbs.nju.edu.cn��[FROM: 202.119.36.245]
Technical Details
Message-ID: <3OTb1U$7Ga@bbs.nju.edu.cn>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: f6cb0,ae2829269b78ecf2,start
X-Google-Attributes: gidf6cb0,public
From: Firefox.bbs@bbs.nju.edu.cn (���)
Subject: Re: ask about Image to array
Date: 1998/05/14
Message-ID: <3OTb1U$7Ga@bbs.nju.edu.cn>
X-Deja-AN: 353871548
X-Filename: Java/M.895106382.A
Organization: nju_bbs
Newsgroups: cn.bbs.comp.lang.java