Checking pixels from call to:  grabPixels();

I am using pixel grabber to grab the pixels in an image. Then once I have the pixels, I want to know how many of the pixels are Transparent.
I am loading a total transparent image to test with. The problem is that when I examine the contents of the array image_array, the values are all 0 (Zero ). This means the color of the pixel is black.
Which I think somehow equates to Transparent. But I thought transparent is: 0x01FF01
??? Help I am lost? Here is the code. I have included comments on
lines 23,25,26. Thanks in advance, Amy Danough
1 temp = getImage(getDocumentBase(),"sky.gif");
2 MediaTracker tracker = new MediaTracker(this);
3 tracker.addImage(temp,0);
4 try { tracker.waitForID(0);
5 }catch (InterruptedException e) {return;}
6
7
8 int widths = temp.getWidth(this);
9 int heights = temp.getHeight(this);
10 int[] image_array = new int[widths*heights];
11
12 try {tracker.waitForID(0);}
13 catch (InterruptedException e){}
14
15 PixelGrabber pg = new PixelGrabber(temp,0,0,widths,heights,image_array,0,widths);
16 try { pg.grabPixels(); }
17 catch (InterruptedException e) {}
18
19 int count = 0;
20 int rgb;
21 for (int i = 0; i < widths*heights; i++) {
22 rgb = image_array[i]; // get a pixel from the array
23 if (rgb == 0x01FF01){ count++; } // I am thinking tranpsarent == 0x01FF01
24 }
25 // Count always returns Zero for my totally transparent image.
// The value rgb at line 22 always equates to Zero ???

Don't use Toolkit.getImage()/createImage(), use javax.imageio.ImageIO.read(...)
or, if u do use the toolkit methods, copy the image into a BufferedImage before you start messing around with the pixels.
BufferedImage offers much better ways of maipulating the pixels directly. (without having to make a copy of them [which is what pixel grabber does])

Similar Messages

  • ORA-39127: unexpected error from call to export_string :=SYS.DBMS_RMGR_GROUP_EXPORT.GRANT_EXP

    Hi,
    I am trying to export a Schema from 11.2.0.2 and getting the below error on export
    ORA-39127: unexpected error from call to export_string :=SYS.DBMS_RMGR_GROUP_EXPORT.GRANT_EXP(12425,1,...)
    ORA-06502: PL/SQL: numeric or value error: NULL index table key value
    ORA-06512: at "SYS.DBMS_RMGR_GROUP_EXPORT", line 154
    ORA-06512: at line 1
    ORA-06512: at "SYS.DBMS_METADATA", line 7049
    ORA-39127: unexpected error from call to export_string :=
    SYS.DBMS_RMGR_GROUP_EXPORT.GRANT_EXP(12424,1,...)
    ORA-06502: PL/SQL: numeric or value error: NULL index table key value
    ORA-06512: at "SYS.DBMS_RMGR_GROUP_EXPORT", line 154
    ORA-06512: at line 1
    ORA-06512: at "SYS.DBMS_METADATA", line 7049
    ORA-39127: unexpected error from call to export_string :=SYS.DBMS_RMGR_GROUP_EXPORT.GRANT_EXP(12423,1,...)
    ORA-06502: PL/SQL: numeric or value error: NULL index table key value
    ORA-06512: at "SYS.DBMS_RMGR_GROUP_EXPORT", line 154
    ORA-06512: at line 1
    ORA-06512: at "SYS.DBMS_METADATA", line 7049
    ORA-39127: unexpected error from call to export_string := SYS.DBMS_SCHED_JOB_EXPORT.GRANT_EXP(2003412,1,...)
    ORA-01031: insufficient privileges
    ORA-06512: at "SYS.DBMS_SCHED_MAIN_EXPORT", line 2296
    ORA-06512: at "SYS.DBMS_SCHED_JOB_EXPORT", line 52
    ORA-06512: at line 1
    ORA-06512: at "SYS.DBMS_METADATA", line 7049
    I  have searched the forum and found similar errors, but I am struggling to understand the cause and solution.
    Forums seem to indicate it may be related to bug 4358907, Re: Datapump export/import object grants given by another user but not sure it is relevant as I can see a ORA-01031: insufficient privileges in this log.
    Can you please advise?
    Thanks

    Please show your export command  and read MOS ID: ORA-39127 using datapump exp [ID 451987.1 ]
    and check below forms discussion:
    https://forums.oracle.com/message/10237007

  • Capturing pixels from a selected part of an image

    Im writing a tool to allow a user to drag a rectangle over any area of an image (contained on a ScrollingImagePanel) in order to perform an operation such as blur on the region.
    When I have the co-ordinates of the rectangular area for the operation, how do I save the pixels to any sort of image object i.e a PlanerImage for manipulation?
    Thanks

    I'm developing a tool where one of the features is the one you describe. I haven't got it working yet, but I'm currently checking out createScreenCapture in java.awt.Robot. It creates a BufferedImage containing pixels from the screen. Might be what we're looking for :).

  • IMac screen gains dead pixels from Mac Store visit???

    My 3.4gHz i7 2011 27" iMac died, so I brought it into "The Mac Store" here in Portland (an authorized Apple reseller and repair facility).  According to the work order, they changed out the logic board and the video card under warranty.  When I picked it up last week, I noticed there was now a spot of 4-8 stuck dark pixels (all next to eachother in one big splotch) on the LCD that wasn't there when I dropped it off.  I opened it up to put my hard drive back in and I saw that the SMT connector on the top of the video card (ambient light sensor?) was damaged, the plastic was broken and the plug was hanging on by gravity, not plastic tabs.  So it still works, but the cable could pop off on it's own.
    My assessment is careless work.  The LCD was either swapped for a different unit, or damaged by the repair techs.  Is it possible that a LCD can be damaged in a way that it receives a spot of dead pixels?  AFAIK thats a sign of bad transistors and more of a manufacturing defect, which leads me to suspect the LCD was swapped out.  The pixels are next to eachother both vertically and horizontally, so I'd doubt it's a video card issue.
    The way the video card is damaged shows me they were careless during installation of the new card, and either didn't notice it (doubtful) or figured I'd never notice so they left it.  Just speculation on my part, but as someone who does IT consulting for a living myself, it seems really sloppy either way.
    I emailed the customer service address twice (in response to my work ticket) and the local store manager once, but have not received a reply or acknowledgement.  I had to reschedule a second appointment and go in on my own.  When I did the, the guy who received my iMac at the service desk said while it is not his call, he doubts they will fix it as "Apple has a policy regarding a certain number of allowable dead pixels", which completely neglects the fact that my LCD was perfect when I brought in the machine for unrelated service.  He also said that the fact that I noticed the bad video card connector shows I was opening up the computer to reach non user servicable parts and therefore they probably wouldn't cover that.  Which is ridiculous to me for a couple reasons, first, the Apple Warranty terms of service say nothing about voiding warranty for changing out the hard drive, second, it's illegal to void a warranty if I didn't damage the unit while servicing a user servicable part, and third, that gives them a self defining ability to damage anything inside my computer and then if I notice it they use the fact that I noticed it as a way to get out of fixing it.  Kind of a catch-22 if you ask me.
    So I'll be posting my follow ups to what happens here, but in the meantime, my questions -
    - Can a LCD gain bad pixels from careless handling?  Can a splotch of bad pixels be related to a bad video card?
    - Has anyone had service like this from Mac Store or Apple before?  I paid a lot of cash for this system and this is pretty frustrating.
    regards,
    Rob

    Follow up post - I brought the system back, they were really nice, the escalated it, I got it back in 2 days, they must have had to overnight some stuff for that, and probably ate the costs themselves. The replacement LCD is perfect, the backlight board was swapped, everything is good, and they were nice to deal with the whole time.
    I should have given them a chance before posting here.  They went out of their way to treat me well, and that is appreciated.  Please ignore the frustrated tone from my first post, it was just grumpiness on my part.  Crap happens, customer service is how that crap is dealt with, and they did a very good job.
    Rob

  • A module reported an error 0x80004005 from call back which was running as part of rule

    Hi 
    a module reported an error 0x80004005 from call back which was running as part of rule. with event id 4503this error shown since delta monitor is enable!thanks

    Hi,
    What is your SCOM version, would you please try to install the newest update, and check the result.
    And here is a similar thread, please refer to it:
    http://social.technet.microsoft.com/Forums/en-US/28516ca3-ae97-49a2-bb72-d6814750813f/scom-warnings-and-errors-event-id-4503-10703-1103-and-10102?forum=exchangesvradminlegacy
    Regards,
    Yan Li
    Regards, Yan Li

  • Checking email from site that use Outlook Web Access Lite

    I just got a Blackberry 8330 and need to use it for checking email from my company's email server.
    It turns out that this server uses Outlook Web Access lite. I am currently not able to check the mail as I am
    getting errors that say the browser needs to accept cookies. Also something about scripting.
    Does anybody know how to work around this problem?
    I don't want to "integrate" this email account so that I get the messages pushed to the Blackberry- only to be able to
    access the email site and check the email.
    Solutions Please!
    Solved!
    Go to Solution.

    Hi and Welcome to the Forums!
    It might not actually be a cookie problem...since I don't access OWA in the way you want (I do integrate it via BIS...very slick!), I can only guess.
    From within the Browser, click the BBKey and select Options. Inside of there are a ton of different options, including one that lets your BB browser identify to a website as IE, FF, or BB...the default being, of course, BB. If you change that to IE, you might have more luck. That setting is in the Browser Configuration screen and is usually called Browser Identification.
    There are also many other settings that may be helpful...basically you need to fiddle around with these until you find the combination that works right for your specific situation. But I'd try the Browser ID/Emulation first.
    Cheers!
    Occam's Razor nearly always applies when troubleshooting technology issues!
    If anyone has been helpful to you, please show your appreciation by clicking the button inside of their post. Please click here and read, along with the threads to which it links, for helpful information to guide you as you proceed. I always recommend that you treat your BlackBerry like any other computing device, including using a regular backup schedule...click here for an article with instructions.
    Join our BBM Channels
    BSCF General Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • Block someone from calling

    How dp i block someone from calling me on my nokia nuron 5230

    It's very rare for any phone to support this feature and I don't think any nokia phones do. You will need an application to do it for you and even then it isn't techincally blocking the call it's just hiding the fact that someone has called.
    If you check the ovi store there are multiple applications for this kind of thing but i'm sure someone here can recommend a good application to use.

  • I can erase pixels from my screen revealing the grey Lion background

    I can erase pixels from my 2011 21inch iMac screen after I wake it up from sleep mode. I did a reinstall...it did not solve the problem.
    Additionally, my wi-fi times out every 5min. I cross check my router with my phone with no problems.
    help

    It may be the graphics card but that wouldn't effect your wi-fi.
    They may be seperate problems.
    Run Disk Utility > Verify Disk
    Download and run Rember to test your RAM. a front-end GUI to the 'memtest' command line memory testing program. This application will allow the user to select the number of test loops, as well as the amount of memory to test.

  • How to get all checked items from TreeView in VC++ mfc

    void CPDlg::OnTreeClk(NMHDR *pNMHDR, LRESULT *pResult)
    NMTREEVIEW& nm = *(LPNMTREEVIEW)pNMHDR;
    // which item was selected?
    HTREEITEM hItem = m_columnTree.GetTreeCtrl().GetSelectedItem();
    temp = m_columnTree.GetItemText(hItem, 0);
    MessageBox(temp);
    if (!hItem) return;
    // the rest of processing code..
    I'm new in VC++ .
    this code gives only current selected item . but i need to get all checked items from treeView.
    kindly help me..

    no not unchecked .. the all check box's gone from tree view. which means Treeview without check box.
    finally i tried SetCheck 
    void CPracticesDlg::OnSelchangedTreectrl(NMHDR* pNMHDR, LRESULT* pResult)
    NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
    // TODO: Add your control notification handler code here
    tree_state = 1;//changed
    HTREEITEM hItem = m_columnTree.GetTreeCtrl().GetSelectedItem();
    BOOL chk = m_columnTree.GetTreeCtrl().GetCheck(hItem);
    if (chk == TRUE)
    HTREEITEM hmyItem = m_columnTree.GetTreeCtrl().GetSelectedItem();
    // Check all of the children of hmyItem.
    if (m_columnTree.GetTreeCtrl().ItemHasChildren(hmyItem))
    HTREEITEM hNextItem;
    HTREEITEM hChildItem = m_columnTree.GetTreeCtrl().GetChildItem(hmyItem);
    while (hChildItem != NULL)
    hNextItem = m_columnTree.GetTreeCtrl().GetNextItem(hChildItem, TVGN_NEXT);
    m_columnTree.GetTreeCtrl().SetCheck(hChildItem, 1);
    hChildItem = hNextItem;
    else
    HTREEITEM hmyItem = m_columnTree.GetTreeCtrl().GetSelectedItem();
    // Uncheck all of the children of hmyItem.
    if (m_columnTree.GetTreeCtrl().ItemHasChildren(hmyItem))
    HTREEITEM hNextItem;
    HTREEITEM hChildItem = m_columnTree.GetTreeCtrl().GetChildItem(hmyItem);
    while (hChildItem != NULL)
    hNextItem = m_columnTree.GetTreeCtrl().GetNextItem(hChildItem, TVGN_NEXT);
    m_columnTree.GetTreeCtrl().SetCheck(hChildItem, 0);
    hChildItem = hNextItem;
    code works good . but here is i think small problem . i cant find it.
    when i click the root node it goes to checked state but not child node. again i click same root node it goes to unchecked state but all child's are goes to checked state.
    help me. here what is the problem?

  • Iphone 4: while talking, phone automatically switches onto facetime and at other times when talking the sound "beep beep" is heard and disconnects from call?

    Iphone 4: while talking, phone automatically switches onto facetime and at other times when talking the sound "beep beep" is heard and disconnects from call? Anyone know what is happening??

    Basic troubleshooting from the User's Guide is reset, restart, restore.  Has any of this been tried?

  • How do I transfer my checked songs from one computer to another - tried exporting library playlist etc but no luck! Please help! I have 26,000 songs - 17,000 are selected and I can't run down the list on my new computer and re-check 17,000 songs! Thanks!

    How do I transfer my checked songs from one computer to another - tried exporting library playlist etc but no luck! Please help! I have 26,000 songs - 17,000 are selected and I can't run down the list on my new computer and re-check 17,000 songs! Thanks!

    Make a smart playlist of your whole library but only checked songs - #4 on  http://support.apple.com/kb/ht1801
    Highlight all files in that playlist, then drag to the other drive.  This isn't preserving any playlists or whatever, just copying files from one drive to another.
    You might want to delete the smart playlist this once you are done because it will probably gobble up resources with that many files.

  • How to block a number from calling

    How do I block a specific number from calling my phone? I have a 4S

    Press the ⓘ to the right of the call in the Recents section in the Phone app.  Scroll to the bottom and use "Block this Caller".

  • How can i access my old correspondense with old password in Mozilla Thunderbird? How can i check out from my password?

    I had my website moved to other hosting. Accordingly, i changed a password, and when i checked in on my computer the first time with a new password, i stupidly checked the box "remember me on this computer", but i lost access to all my old emails that were laying in Thunderbird on my PC. How can i check out from the current password and log in with the old one so that i could access my old correspondense?

    '''Pop mail accounts '''can only access the server Inbox.
    Messages are downloaded to your computer and stored in the Thunderbird Profile mail account.
    Usually, the copy on the server is removed unless you select to 'leave messages on server' in Account Settings..
    'Tools' > 'Account Settings' > 'Server Settings' for pop mail account.
    These emails are stored on your computer and can be accessed in both 'online' and 'offline' mode.
    You would need to make sure you periodically create a backup of these emails.
    '''IMAP mail accounts '''see a remote view of any subscribed folder on the server.
    Subscribed folders download headers only and when you select to read an email, it is retrieved from the server and stored in a temporary cache to faciltate quick access to reading.
    These emails are not stored in your Thunderbird profile folders on your computer, so would not be visible if you changed to 'offline' mode. They are stored on the server.
    If you did not synchronise those subscribed folders then a copy was never stored in your Thunderbird profile imap mail account.
    As you have modified the IMAP mail account and it is currently accessing the new hosting server, so cannot display anything on a different server, I would leave it alone because it is working just fine.
    What you could try is to create a new IMAP mail account with server settings to the old host server using the old password.
    File > New > exisitng mail account
    Enter name, email address and password
    click on 'Continue'
    If you do manage to get access, then synchronise the subscribed folders to get a copy downloaded to Thunderbird Profile folders. As those folders are constantly updating to match the server, once you have the emails downloaded, go into 'offline' mode and move them into 'Local Folders'; you will need to make new folders in Local Folders account for those emails.
    However, it is possible that you may not get access as that contract has ended. There is no obligation for the old host company to keep your emails if you do not have an account with them. In which case those emails will be lost.
    After creating new imap mail account, if you get access do as advised to get emails into Local Folders, once emails are in Local folders you can remove/delete the imap mail account. If it does not work, you can delete the imap mail account.
    Information on synchronising subscribed folders:
    * https://support.mozilla.org/en-US/kb/imap-synchronization
    Information on backup:
    * http://kb.mozillazine.org/Profile_backup
    * http://kb.mozillazine.org/IMAP_backup

  • Need Help in expdp for resolving ORA-39127: unexpected error from call

    Hi All,
    My Environment is -------> Oracle 11g Database Release 1 On Windows 2003 Server SP2
    Requirement is ------------> Data Pump Jobs to be completed without any error message.
    I am tryring to take export data pump of a schema
    Command Used --> expdp schemas=scott directory=data_pump_dir dumpfile=scorr.dmp version=11.1.0.6.0
    Export Log Show this details its completed with 2 error messages
    Export: Release 11.1.0.6.0 - Production on Saturday, 23 April, 2011 13:31:10
    Copyright (c) 2003, 2007, Oracle. All rights reserved.
    Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
    With the OLAP option
    FLASHBACK automatically enabled to preserve database integrity.
    Starting "SYSTEM"."SYS_EXPORT_SCHEMA_01": system/******** schemas=scott directory=data_pump_dir dumpfile=scorr.dmp version=11.1.0.6.0
    Estimate in progress using BLOCKS method...
    Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
    Total estimation using BLOCKS method: 192 KB
    Processing object type SCHEMA_EXPORT/USER
    Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
    Processing object type SCHEMA_EXPORT/ROLE_GRANT
    Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
    ORA-39127: unexpected error from call to export_string :=SYS.DBMS_CUBE_EXP.schema_info_exp('SCOTT',0,1,'11.01.00.06.00',newblock)
    ORA-37111: Unable to load the OLAP API sharable library: (The specified module could not be found.
    ORA-06512: at "SYS.DBMS_CUBE_EXP", line 205
    ORA-06512: at "SYS.DBMS_CUBE_EXP", line 280
    ORA-06512: at line 1
    ORA-06512: at "SYS.DBMS_METADATA", line 5980Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
    Processing object type SCHEMA_EXPORT/TABLE/TABLE
    Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
    Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
    Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
    Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
    ORA-39127: unexpected error from call to export_string :=SYS.DBMS_CUBE_EXP.schema_info_exp('SCOTT',1,1,'11.01.00.06.00',newblock)
    ORA-37111: Unable to load the OLAP API sharable library: (The specified module could not be found.
    ORA-06512: at "SYS.DBMS_CUBE_EXP", line 205
    ORA-06512: at "SYS.DBMS_CUBE_EXP", line 280
    ORA-06512: at line 1
    ORA-06512: at "SYS.DBMS_METADATA", line 5980
    . . exported "SCOTT"."DEPT" 5.945 KB 4 rows
    . . exported "SCOTT"."EMP" 8.585 KB 14 rows
    . . exported "SCOTT"."SALGRADE" 5.875 KB 5 rows
    . . exported "SCOTT"."ACCTYPE_GL_MAS" 0 KB 0 rows
    . . exported "SCOTT"."BONUS" 0 KB 0 rows
    Master table "SYSTEM"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
    Dump file set for SYSTEM.SYS_EXPORT_SCHEMA_01 is:
    D:\APP\ADMINISTRATOR\ADMIN\SIPDB\DPDUMP\SCORR.DMP
    Job "SYSTEM"."SYS_EXPORT_SCHEMA_01" completed with 2 error(s) at 13:40:08
    Please help me to resolve this issue.
    Thank you,
    Shan

    Hi Shan,
    I am getting very similar to yours
    "ORA-37111: Unable to load the OLAP API sharable library: (The specified module could not be found."
    error message while creating OLAP Analytic Workspace with AWM.
    I am creating workspace for the first time, actually following some tutorial to get some knowledge about OLAP)
    I see you managed to solve you problem.
    I wonder how I can get this MOS DOC 852794.1 - is it possible to get it without going to Metalink?
    Thanks in advance for any help.
    Regards,
    SC

  • T-sql 2008 r2 place results from calling a stored procedure with parameters into a temp table

    I would like to know if the following sql can be used to obtain specific columns from calling a stored procedure with parameters:
    /* Create TempTable */
    CREATE TABLE #tempTable
    (MyDate SMALLDATETIME,
    IntValue INT)
    GO
    /* Run SP and Insert Value in TempTable */
    INSERT INTO #tempTable
    (MyDate,
    IntValue)
    EXEC TestSP @parm1, @parm2
    If the above does not work or there is a better way to accomplish this goal, please let me know how to change the sql?

    declare @result varchar(100), @dSQL nvarchar(MAX)
    set @dSQL = 'exec @res = TestSP '''+@parm1+''','' '''+@parm2+' '' '
    print @dSQL
      EXECUTE sp_executesql @dSQL, N'@res varchar(100) OUTPUT', @res = @result OUTPUT
    select @result
    A complicated way of saying
    EXEC @ret = TestSP @parm1, @parm2
    SELECT @ret
    And not only compliacated, it introduces a window for SQL injection.
    Erland Sommarskog, SQL Server MVP, [email protected]

Maybe you are looking for