How does pixelgrabber store the pixels?

i used pixelgrabber like so in an applet
Image ball = getImage(getCodeBase(), "bball.gif");
int w = ball.getWidth(this);
int h = ball.getHeight(this);
int[] pixels = new int[w * h];
PixelGrabber pg=new PixelGrabber(ball,0,0,w,h,pixels,0,w);
try{
pg.grabPixels();
}catch (InterruptedException e) {}
when i go used a for loop to print out all the elements of pixels[] 1 by 1, i get something like this.
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-2697514
-2697514
-4868683
-5395027
-8684677
-8684677
-5921371
-5395027
-3223858
-2697514
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
now, this basketball image is fills up most of the 64x64 space, its mostly orange with black borders (as you would expect). but why do i get so many -1's (-1 is FFFFFFFF, which is white)?

From the PixelGrabber docs:
  int alpha = (pixel >> 24) & 0xff;
  int red   = (pixel >> 16) & 0xff;
  int green = (pixel >>  8) & 0xff;
  int blue  = (pixel      ) & 0xff;I've used this in code that slices an image into a 10x10 grid and
figures out the "main color" in each cell. Do it twice, compare
the result and you can tell if Image A is a scaled version of Image B.
Given that my code works, I'd have to say that the storage described
here is accurate !
Hope this helps !

Similar Messages

  • In InDesign, how does one determine the pixel size of a text box? Specifically, we need to write text to specifications of 600 pixel width, and have no idea a) how to scale a text box to specific pixel width, b) how to

    This may be a basic question... but in InDesign, how does one determine the pixel size of a text box? Specifically, we need to write text to specifications of 600 pixel width, and have no idea a) how to scale a text box to specific pixel width, b) how to determine what word count we can fit in, and c) how to do it in a table? Thanks!

    Set your ruler increments to pixels Preferences>Units & Increments. You can fill the text box with placeholder text Type>Fill with Placeholder text and get a word count from the Info panel with Show Options turned on from the flyout.
    From the Transform panel you can set a text box's width and height

  • How does Labview stores the binary data - The header, where the actual data starts etc.

    I have problem in reading the binary file which is written by labview. I wish to access the data (which is stored in binary format) in Matlab. I am not able to understand - how the data will be streamed in to binary file (the binary file format) when we save the data in to a binary format through Labview program. I am saving my data in binary format and I was not able to access the same data in Matlab.
    I found a couple of articles which discusses about converting Labview to Matlab but What I really wanna know is - How can I access the binary file in Matlab which is actually written in Labview?
    Once I know the format Labview uses to store its binary files, It may be easy for me to read the file in Matlab. I know that Labview stores the binary files in Big Endian format which is
    Base Address+0 Byte3
    Base Address+1 Byte2
    Base Address+2 Byte1
    Base Address+3 Byte0
    But I am really confused about the headers, where the actual data start. Hence I request someone to provide me data about - How Labview stores the Binary Data. Where does the original data start. Below attached is the VI that I am using for writing in to a binary file.
    Attachments:
    Acquire_Binary_LMV.vi ‏242 KB

    Hi Everybody!
    I have attached a VI (Write MAT file.vi - written in LabVIEW 7.1) that takes a waveform and directly converts it to a 2D array where the first column is the timestamps and the second column is the data points. You can then pass this 2D array of scalars directly to the Save Mat.vi. You can then read the .MAT file that is created directly from Matlab.
    For more information on this, you can reference the following document:
    Can I Import Data from MATLAB to LabVIEW or Vice Versa?
    http://digital.ni.com/public.nsf/websearch/2F8ED0F588E06BE1862565A90066E9BA?OpenDocument
    However, I would definitely recommend using the Matlab Script node (All Functions->Analyze->Mathematics->Formula->Matlab Script). In order to use the Matlab Script node, you must have Matlab installed on the same computer. Using the MatlabScript node, you can take data generated or acquired in LabVIEW and save it directly to a .mat (Matlab binary) file using the 'save' command (just like in Matlab). You can see this in example VI entitled MathScriptNode.vi - written in LabVIEW 7.1.
    I hope this helps!
    Travis H.
    LabVIEW R&D
    National Instruments
    Attachments:
    Write MAT file.zip ‏189 KB

  • How does iMovie store the original video?

    I have some video files on an external HD from my old computer with iMovie 08. On my new iMac with iMovie 09, I have opened up one of those video files, or imported it. My question is this: Is there any need to keep the original file from my old computer, or has it now been stored on my new one with iMove 09? I'm thinking if I keep the old one, I am storing it twice. I am backing up my iMac, so that's not an issue. I'm just trying to figure out if I am keeping a "third" copy when it's not really needed.

    From the PixelGrabber docs:
      int alpha = (pixel >> 24) & 0xff;
      int red   = (pixel >> 16) & 0xff;
      int green = (pixel >>  8) & 0xff;
      int blue  = (pixel      ) & 0xff;I've used this in code that slices an image into a 10x10 grid and
    figures out the "main color" in each cell. Do it twice, compare
    the result and you can tell if Image A is a scaled version of Image B.
    Given that my code works, I'd have to say that the storage described
    here is accurate !
    Hope this helps !

  • Edited or ranked photos - how does LR3 store the files?

    Hello - I am using iPhoto as my photo presentation repository. Once I edit photos in Lr3, I want to be able to simply drag them or import them into a new even in iPhoto. How do I do this? I am not sure that LR3 categorizes the edited photos (or higher ranked) in any different way. Thats why if I could simply drag and drop from the LR interface into the iPhoto new event, I'd be in better shape. But, that doesnt work. Any suggestions?
    Thanks

    I think in Lightroom you need to do a File->Export and then place the exported file into your iPhoto repository.
    I think in the long run, you would be better off using Lightroom to manage and edit your files and create slideshows, as this is how it was designed to be used, as this is the most efficient way to use Lightroom; instead of Lightroom as an editor and iPhoto for photo management or slideshows.

  • How do I find the pixel size of a photo?

    I have taken a photo or found one online.
    It's now on my ipad.
    How do I tell the pixel resoution of the photo via the ipad?
    I have two of the same photos on my device at the moment and want to delete one.  They may both be 2048/2048, but without emailing them or putting them in Dropbox, and viewing on my laptop, I don't see how to tell.

    Get the Actual Pixels App from the App Store. It's free and will tell you the pixel size of any photo you open.
    https://itunes.apple.com/ca/app/actual-pixels/id608679577?mt=8

  • HT3842 Does iTunes store the original music file and copy it into a separate folder? If i delete the original file from finder will it remove it from my iTunes library?

    Hi, on my last PC when transferring music to my new MacBook Pro i noticed i had about 6 duplicated of each song in every album i took hours in removing them.
    I Just wondered Does iTunes store the original music file and then copy it into a separate folder?
    If i delete the original file from finder will it remove it from my iTunes library or vice versa. I didnt want to lose any music like i have some how managed to on my old computer.
    Or should i keep both files of it in the Music folder and also iTunes library folder?
    Which is best ?

    DrewPowell wrote:
    I Just wondered Does iTunes store the original music file and then copy it into a separate folder?
    It does both at the same time.
    When you add files to iTunes, it copies them into /Music/iTunes/iTunes media/ folder. The original file remains where it was.
    You can drag a file to /Music/iTunes/iTunes media/Automatically add to iTunes/ folder.
    This will add to iTunes and move it to /Music/iTunes/iTunes media/.
    I keep a shortcut of this folder on my desktop then simply drag files to the shortcut to add to iTunes.
    Then there are no "extra" files around.

  • How does apex detect the MIMETYPE of an upload?

    Hello,
    I need to import a bunch of files from the OS filesystem to my own table (blob).
    For implementing the download of these files I need to know the mimetype.
    Now, the files are stored in my table, but I have no clue how to detect the mimetype of
    my files (blob).
    How does Apex detect the mimetype of an uploaded file?
    Thanks,
    Michael
    Edited by: MJaro on 21.09.2010 15:52, Reason: little typo

    Michael,
    Mimetype detection is done during upload, if you don't have a mimetype column in your table where APEX can store it, this information is lost.
    Peter
    Blog: http://www.oracle-and-apex.com
    ApexLib: http://apexlib.oracleapex.info
    BuilderPlugin: http://builderplugin.oracleapex.info
    Work: http://www.click-click.at

  • How does one reduce the size of a photo on iphoto?  I want to post images on my website, but they exceed the limit.

    How does one reduce the size of a photo on iphoto.  I want to post images to my website but they exceed the limits. 

    Select the photo(s) and export (file menu ==> export) them. You can change the size there setting a maximum pixel dimension and/or reducing quality
    LN

  • My Daughter changed her Apple ID, not sure why. Then she changed it back to the original. She has lost $50 on her iTunes. How does she restore the funds?

    My Daughter changed her Apple ID, not sure why. Then she changed it back to the original. She has lost $50 on her iTunes. How does she restore the funds?

    Tank 64 wrote:
    My Daughter changed her Apple ID, not sure why. Then she changed it back to the original. She has lost $50 on her iTunes. How does she restore the funds?
    How did she change her AppleID?
    If she simply updated the AppleID (not created a new one with a new email address), log out then log back into iTunes store.

  • Why and how does Adobe Store's policy deliberately impede Least Developed Countries from developing?

    Hi there,
    My name is Dr Eric Mousset. I currently reside in Cambodia, having the privilege to serve as (international) Technical Assistant to support a Government project that is co-funded by the Royal Government of Cambodia and the World Bank, and purposed to Higher Education Capacity and Quality Improvement.
    My mission implies conducting a survey on skills demand by employers and skills supply by Higher Education Institutions, in order to better inform further policy development.
    Among the expected policy outcomes: a more effective alignment between skills supply and job market needs. 
    Among the desired policy impacts: providing the Cambodian economy with the HR skills that are required for its growth and diversification.
    I am impressed by the combined capabilities of Adobe Acrobat XI Pro and Adobe Forms Central. And until this morning it was on top of my shortlist of surveying tools.
    Unfortunatley, while attempting to upgrade to FormsCentral's "Plus" plan, I have received the following reply from Adobe:
    Unsupported Country
    Thus here is my question:
    Why and how does Adobe Store's policy deliberately impede Least Developed Countries from developing?
    Yours sincerely,
    Dr Eric Mousset

    Hi;
    I can't speak to the business decisions that lead to which countries we enable purchasing subscriptions in the store, but I can guarantee you that it is not to impede anyones development. 
    A credit card with an address in any of the supported countries can be used for purchasing the subscription, this has enabled many to get around the issue, but that is the only way to subscribe.
    Thanks,
    Josh

  • Where does portal store the username after a successful log in?

    We have an intranet application, we use the portal security and login screen, etc.
    I have written a stored procedure which requires two parameters. One of them we already have at the time we need to call it. The other is username. All we need
    to know is how to get the username at the time we must call it. Where does portal store the username after a successful log in for the particular session this user is logged into?
    I tried using the following syntax,
    When i log in using PORTAL30 then it returns,
    SQL> select portal30.wwctx_api.get_user()
    2 from dual;
    PORTAL30.WWCTX_API.GET_USER()
    PORTAL30
    But when i logged in using some other user i.e.rtemps it returns,
    SQL> connect rtemps@mpdb
    Enter password: *******
    Connected.
    SQL> select portal30.wwctx_api.get_user()
    2 from dual;
    PORTAL30.WWCTX_API.GET_USER()
    PUBLIC
    Why does it return PUBLIC, instead of RTEMPS?
    rtemps is a Database user though.
    How do i test this script for portal users?
    Also my application is a multiple user application.
    So at a given time, there could be more than user logged in, also there could be more than one sessions of the same user logged in.
    what happens in that scenario?
    Thank you,
    Kalpa

    still not working..
    The first page my user goes to log in, is
    http://159.225.218.59/pls/portal30_sso/portal30_sso.draw_custom_login_page
    when i look at this stored procedure, it makes a call to the following procedure,
    PORTAL30_SSO.wwsso_app_admin.ls_login
    and passes a parameter ssousername
    From here my user is directed to the home page, which is built using the portlets, the URL for the same is,
    http://159.225.218.59/servlet/page?_pageid=255,257&_dad=portal30&_schema=PORTAL30
    This is where i want to pass the ssousername, so as to keep track of what the user is doing.
    Question 1: where does this page physically reside, or how do i add the parameter ssousername to this page?
    I have 1 HTML PORTLET, on this page, and the code behind this looks like,
    <!-- PL/SQL Language Definition Section -->
    <%@ page language="PL/SQL" %>
    <%@ plsql parameter="i_pagenum" default="1" %>
    <body>
    <table width = 760>
    <tr>
    Link 1
    </tr>
    </table>
    In the above code, when they click on link 1, it calls a database stored procedure(rpt_param_prov), which is also a psp page.
    In here, i want to pass the parameter ssousername.
    e.g. the link should look like,
    Link 1
    Again this is a HTML portlet, so i don't think it will recognize the psp tags.. so that probably might be another issue.
    But this is what i want to accomplish. So i can use the user who logged in, for my audit trail application, which will be inserting a record in a database table, everytime, the user runs reports that are being clicked.. like link 1 in above example.
    I don't understand why this is so hard.
    When i tried
    portal30.WWCTX_API.get_user, it still brings back PUBLIC or PORTAL30_PUBLIC.

  • How does one change the font size for folders and/or file lists in the Bookmarks Library?

    How does one change the font size for folders and/or file lists in the '''Bookmarks''' Library?
    Since the upgrade to version 9.0.1 of Firefox, the Bookmarks feature changes are confusing me. They seem to be confusing themselves as well. The list of bookmarks has changed. The font size is so small that my aging eyes cannot read it without fogging the screen with my breath. Some folders are out of alphabetical order (where I know they were previously good), and some are missing altogether (folders to which I frequently add references).
    As for missing or deranged files or folders, was there something that I should have done or now need to do to recover those after the upgrade (or before)?
    With regard to font size,
    1. there is no “Edit Bookmarks” or like option to edit the list in this version
    2. the “zoom” option in the “view” list of functions is greyed out when in “Show All Bookmarks” window
    3. expanding the browser window has no effect on font size
    4. “Preferences” settings for font size has no effect in that window either, including advanced settings
    5. “Help” offers none that I can find.
    Can any of you Help?!?

    Maybe this extension helps:
    *Theme Font & Size Changer: https://addons.mozilla.org/firefox/addon/theme-font-size-changer/

  • How can i store the data from the list to MS-Access?

    Hi all,
    We all know that from alv it is possible to export data to Ms-excel or word or text file. Can anyone tell me how can i store the data from alv or reports to Ms-Access?
    Thanks in Advance,
    Abhijit

    Hi,
    If you want that without code, i suppose there is a option in MS-Access to import data from Excel, so you have to first export to excel and then import to Access.
    If you want to code it yourself then have a look at FM TABLE_EXPORT_TO_MSACCESS, as said in Exporting Data from R/3 to MS ACCESS
    You can also see the search results in SCN for [export data to MS-Access (45 Results)|https://www.sdn.sap.com/irj/sdn/advancedsearch?query=exportdatato+MS-Access&cat=sdn_all].
    Regards
    Karthik D

  • How does this happen: The picture of recent apps you get when double clicking the home button showed in Settings-Wifi that I had been connected to a network I have not been near for two months. Its not a recent "image" of Settings-Wifi. Can anyone explain

    How does this happen: The picture of recent apps you get when double clicking the home button showed in Settings-Wifi that I had been connected to a network I have not been near for two months. Its not a recent "image" of Settings-Wifi. Can anyone explain?

    Greetings,
    I've never seen this issue, and I handle many iPads, of all versions. WiFi issues are generally local to the WiFi router - they are not all of the same quality, range, immunity to interference, etc. You have distance, building construction, and the biggie - interference.
    At home, I use Apple routers, and have no issues with any of my WiFi enabled devices, computers, mobile devices, etc - even the lowly PeeCees. I have locations where I have Juniper Networks, as well as Aruba, and a few Netgears - all of them work as they should.
    The cheaper routers, Linksys, D-Link, Seimens home units, and many other no name devices have caused issues of various kinds, and even connectivity.
    I have no idea what Starbucks uses, but I always have a good connection, and I go there nearly every morning and get some work done, as well as play.
    You could try changing channels, 2.4 to 5 Gigs, changing locations of the router. I have had to do all of these at one time or another over the many years that I have been a Network Engineer.
    Good Luck - Cheers,
    M.

Maybe you are looking for

  • How can I connect 10.4 Mac to Windows Small Business Server 2003?

    I have seen some other discussions touching on this topic and have tried the various solutions but am getting nowhere. I can't connect my iBook, which is running Tiger, to our office's server, a Windows Small Business Server 2003. I am the only Mac u

  • BAPI FOR change CHECKBOX!!!

    Hi at all, i have an problem with searching BAPI´s. Is there any BAPI, which becomes two imports("Purchase Order Number" and "Position Number") for find the data sets in the Transaction ME22N and also change the column elikz ??? The column elikz is a

  • Global create activity with screenflow and constructor

    Hi Question 1) Is it possible to get data from database (Oracle) in constructor Execute Screen flow in a row (One fer other) if yes how and if not how can we do that? Question 2) Explain how data can be displayed in JSP with BPM Object Please give si

  • Fonts not found when using Xvfb

    Hi all, I keep encountering "fonts specified in fonts.properties not found" whenever I execute rwserver.sh server=XXX. fyi, I'm running Solaris8 on Sun SPACE machine. I use Xvfb downloaded from Oracle to allow report server to run after I logoff from

  • Software Update crashes during check

    Yesterday I installed Security Update 2005-009 via Software Update to my 10.4.3 up-to-date system (I installed everythig software update suggested). Today daily software update check crashes: Link (dyld) error: Symbol not found: __ZN3KJS7UString7rele