Two part question: what does do? what does how to get red from getRGB()

Hi,
I came across some interesting code today, which was
System.out.println((255 & 0xFF) << 24);
outputting -16777216.
Firstly, what does << do?
Secondly, if -16777216 was the output of getRGB() in say, BufferedImage class, how should I go about getting just the red part of it?

The oiperator << shifts bits left. This means if you have a Binary sequence like
b == 01001
and perform b << 1 then
b == 10010
read Here:
http://java.sun.com/docs/books/tutorial/java/nutsandbolts/op3.html
for your second question,
Construct a Color from your int.
BuferredImage img;
int x, int y;
int i = img.getRGB(x,y);
Color c = new Color(i); //this makes your integer an instance of Color
int redPart = c.getRed();API References:
BufferedImage:
http://java.sun.com/j2se/1.5.0/docs/api/
then select java.awt.image
then select class BufferedImage
Color:
http://java.sun.com/j2se/1.5.0/docs/api/
then select java.awt
then select class Color.
Enjoy reading the APIs!
why the heck don?t the code tags work?
Edited by: AikmanAgain on Feb 8, 2008 12:35 AM

Similar Messages

  • Two part question 1) what happens if you  sign into messages beta on os x lion 10.7.5 after it expired? does the whole application not work or just imessage? 2) does installing messages beta on os x lion 10.7.5  delete ichat?

    Two part question
    1) what happens if you  sign into messages beta on os x lion 10.7.5 after it expired? does the whole application not work or just imessage? can you stil use AIM, jabbar, google talk, or yahoo?  if you open messages beta does it immediately tell you that messages beta expired?
    2) does installing messages beta on os x lion 10.7.5  delete ichat or just transform ichat into messages beta giving the illusion that ichat is deleted?

    Hi,
    It was never completely clear whether it was just hidden or whether Apple ran a download page for iChat 6.
    As the Download for Messages Beta was separate and "Deleted" iChat it would seem it would be another download for iChat 6.
    iMessages will not function as it is only an Account type within Messages and iChat 6 does not have it.
    Therefore messages on the iPhone will not sync to the Mac. (until you get Mountain Lion and Messages in that OS X version).
    Mountain Lion and it's full version of Messages will not sync the iMessages that have happened in between the 14th December 2012  (end date of Messages beta) and the Install of Mountain Lion if you decide on that route.
    8:51 PM      Sunday; May 5, 2013
      iMac 2.5Ghz 5i 2011 (Mountain Lion 10.8.3)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
     Couple of iPhones and an iPad
    "Limit the Logs to the Bits above Binary Images."  No, Seriously

  • Hi my iPhone 4 is stolen, I ve on it Igotya app. It sent me the pic and location of the *******. I don't know what to do next; a question plz does the phone get locked after 3 times of entering wrong password lock, thanks

    Hi my iPhone 4 is stolen, I ve on it Igotya app. It sent me the pic and location of the *******. I don't know what to do next; a question plz does the phone get locked after 3 times of entering wrong password lock, thanks

    What To Do If Your iDevice Is Lost Or Stolen
    If your iPhone, iPod, iPod Touch, or iPad is lost or stolen what do you do? There are things you should do in advance - before you lose it or it's stolen - and some things to do after the fact. Here are some suggestions:
    Reporting a lost or stolen Apple product
    What-To-Do-When-Iphone-Is-Stolen
    Lost or Stolen iPhone? Here’s What to do.
    6 Ways to Track and Recover Your Lost/Stolen iPhone
    It pays to be proactive by following the advice on using Find My Phone before you lose your device:
    Find My iPhone
    Setup your iDevice on MobileMe
    How To Set Up Free Find Your iPhone (Even on Unsupported Devices

  • This is a two part question about the creative 16gb Zen?

    8This is a two part question about the creative 6gb Zen? First of all, my battery life dropped very suddenly. One charge I was getting the full 30 hour battery life and the next it dropped to under ten. I tried using their tips on how to extend the battery life and I am still getting less than 0 hours of battery life. Why would it dropped more than half the amount between charges? I tried recharging it after it ran out and still the same thing. Any help?
    Second, (I am adding this question because it might relate to the first in some way) my mp3 player has been behaving strangely lately. For example, some artists sometimes have letters removed or all but the first end up being removed. But, if you reset the player, the artists go back to the full name. Also, my player has been taking a little longer than usual to turn on. It takes about 30 seconds to turn on instead of the 5-0 that I'm used to. Does anyone know why this might be happening?
    My Zen is only 4 months old, and I would be very upset it it's breaking already. Please, if you have any suggestions on how I can fix what's happening, post them. (Even if they?probably won't work, they're worth a try.)

    < This is an unusual one; never heard of it before. All I can suggest is cleaning up and perhaps reflashing the firmware. If it still is doing this, then get the thing exchanged pronto.
    My guess is that the problems are indeed closely related.

  • Where does the data get saved from (notepad) or Notes on Windows Mobile 5?

    Where does the data get saved from (notepad) or Notes on Windows Mobile 5?
    (ON the Phone)  Sticky note like program WM5
    I ask because I synced my Blackjack 1 to my pc after about a year and MANY notes later, All the notes from the PC remained but ALL new notes on phone (a years worth) were deleted from the phone.
    I would like to attempt a data recovery on my mobile device- that was an insane endeavor but i got it to work now i just need to know what to look for (what type of files to recover) and or where to recover from?
    I did make the phone a drive already and have data recovery software that can pull deleted files from the phone in fat or raw data format.
    Thanks.

    Hi,
    I think this is not the best forum for your question. This forum is for Microsoft Exchange Server's mobile connectivity issues.
    Regards,
    Zoltán
    http://www.clamagent.org - Free Antivirus for Exchange
    http://www.it-pro.hu
    http://emaildetektiv.hu

  • How to get indesign from iMac to mac powerbook which does not have cd slot?

    how to get indesign from iMac to mac powerbook which does not have cd slot?

    That will not work!
    You cannot copy or migrate Adobe applications from computer to computer. There are a whole host of files in different locations which have to be installed, and copying will not do it.
    In fact, you'll now have to use the Adobe Cleaner tool to remove the mess you created. You can get to it here:
    Use the CC Cleaner Tool to solve installation ... - Adobe

  • Hi, I have a question, I would like to ask how to get into Photoshop CC 2014 English language? Thank you Dana

    Hi, I have a question, I would like to ask how to get into Photoshop CC 2014 English language? Thank you Dana

    First, download and install the Creative Cloud Desktop Manager if it is not in your computers Programs list since your are a CC member.
    Free Creative Cloud | Download Adobe Creative Cloud free trial
    Then launch it, click on Apps. Then from the menu, select Preferences.

  • Where does CustomIDocumentPlugin:identifyIncomingDocument get doctype from

    When handling positional flat files it looks like doctype is not defaulting from B2B setups for oracle.tip.adapter.b2b.document.custom.CustomIDocumentPlugin:identifyIncomingDocument
    oracle.tip.adapter.b2b.document.custom.CustomIDocumentPlugin:identifyIncomingDocument Enter
    oracle.tip.adapter.b2b.document.custom.CustomIDocumentPlugin:identifyIncomingDocument non-XML Payload
    oracle.tip.adapter.b2b.document.custom.CustomIDocumentPlugin:identifyIncomingDocument iDoc ECS = xyzECS.ecs
    oracle.tip.adapter.b2b.document.custom.CustomIDocumentPlugin:identifyIncomingDocument start pos = 71
    oracle.tip.adapter.b2b.document.custom.CustomIDocumentPlugin:identifyIncomingDocument end pos = 75
    oracle.tip.adapter.b2b.document.custom.CustomIDocumentPlugin:identifyIncomingDocument key = [METH]
    oracle.tip.adapter.b2b.document.custom.CustomIDocumentPlugin:identifyIncomingDocument value = [METH]
    oracle.tip.adapter.b2b.document.custom.CustomIDocumentPlugin:identifyIncomingDocument target = [METH]
    oracle.tip.adapter.b2b.document.custom.CustomIDocumentPlugin:identifyIncomingDocument doctype = xyz, doctype revision = 1.0
    oracle.tip.adapter.b2b.document.custom.CustomIDocumentPlugin:identifyIncomingDocument Exit
    the doctype that I have defined in B2B is different than what's being identifyed by CustomIDocumentPlugin
    message only gets processed if I go and change my doctype name to whats in the log.

    I understand start and end position, they are matching. but its identifying the doc type as lets say "xyz" and revison 1.0 , where as there is no such setup in Oracle B2B. my question was where is it getting "xyz" and 1.0. it always defaults to doc type as "xyz" and revision 1.0
    If I go and change my B2B setups (doc type as "xyz") only then the document gets processed or else it errors saying agreement not found.
    This is very strange , is it possible that the doc type is somehow getting derived from ecs and not B2B setups ?

  • Does anyone know how to get books from macbook (ibooks) to ipad (ibooks)?

    Since updating my macbook I don't know how to get my books from macbook (ibooks) to my ipad. In itunes was easier to place books to ipad.
    Thanx for any reaction.

    That is incorrect information. The poster is asking how to move music that is on the the phone to the computer/iTunes. iTunes does not sync from the phone to the computer with music, excpet for things purchased in iTunes. Music that has been placed on the phone would have to have been synced from the iTunes library and should be on the phone. However if you lose a hard drive due to a crash, then you would either have to restore your backup on the computer, or purchase 3fd party software to make the move. Music not purchased from iTunes will not sync back to iTunes from the phone.

  • I set up two identities, the default & one more. How to get mail from the second one?

    I have two different e-mail addresses that I want to get mail from. So the main/default one worked just fine. So I went to options, account settings, identities and set up the second one. But this second one doesn't appear on the start page and still when I Get Mail, it only brings in the mail from the default one. So what do I do?

    You do not place your second account in Identities.
    You go to the Menu Bar and select '''File-New-Existing Mail Account''' and add it there.
    No Menu Bar? Press the alt key.
    If using the '''AppMenu button''', click that and select''' New Message-Existing Mail Account'''

  • How to get tables from at a time two database connections

    dear all ,
    i have get two table information these two table are in two diffrent db(like different conncections username ,password,portno... these r differnt)so how to get at a time that two table inforamtions
    Edited by: user13092208 on Dec 28, 2010 10:42 PM

    repost

  • RFx Response - How to get answers from questions

    Hey,
    I would like to know how to get the answers from questions ( by IAPI or table where they are stored ) and if i can manipulate them.
    Thanks!

    Hey,
    well, about manipulating answers, because we need to perform some calculations on scripting that afterwards will be shown as an answer. But it is not mandatory, so i am not worried about it.
    I already checked that table, but i didn't find the field which returns the answer. i guess is somewhere around in other table...
    Thanks!

  • Newbie pixelation two-part question

    I want to create video mash-ups from various sources including public domain material. I am finding that a lot of what seems readily available online is  pixelated-looking, even stuff that has had attention paid to it, i.e. made available in multiple formats such as this one - http://www.archive.org/details/Night.Of.The.Living.Dead_1080p
    1st Question - Is anyone aware of the best way to obtain good copies of public domain materials - wether it be sites such as archive.org, torrents, or ripping from dvd's? I have used the .m2ts version of the Night of the Living Dead video available from the Internet Archive (archive.org), and it has a pulsing blocky pixelation effect within Premiere Pro that I managed to get rid of once by saving and rendering, but has returned. It is a rhythmic pulsing of random areas which show either black or white in large pixelated blocks.
    The second part has to do with matching that sort of public domain footage up with my own footage taken with a canon 7d and also with the sequence settings within premiere pro cs5.5. I'm going for a wild and chaotic atmosphere in my video, so there is room for some roughness, but I'm wondering what the best approach would be to start with. i would want to start with the best quality possible.
    2nd Question - Can a mash-up project like I'm talking about be produced to a relatively professional level from these non-licensed non-official online sources? The final export looking good and non-pixelated is my main concern.
    Camera - canon 7d
    Computer - mac pro
    Software - adobe premiere, after effects, soundbooth
    Goal - producing a variety show made up of old film clips and new footage.

    Hi,
    It was never completely clear whether it was just hidden or whether Apple ran a download page for iChat 6.
    As the Download for Messages Beta was separate and "Deleted" iChat it would seem it would be another download for iChat 6.
    iMessages will not function as it is only an Account type within Messages and iChat 6 does not have it.
    Therefore messages on the iPhone will not sync to the Mac. (until you get Mountain Lion and Messages in that OS X version).
    Mountain Lion and it's full version of Messages will not sync the iMessages that have happened in between the 14th December 2012  (end date of Messages beta) and the Install of Mountain Lion if you decide on that route.
    8:51 PM      Sunday; May 5, 2013
      iMac 2.5Ghz 5i 2011 (Mountain Lion 10.8.3)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
     Couple of iPhones and an iPad
    "Limit the Logs to the Bits above Binary Images."  No, Seriously

  • Newbie Question: What happens if I get a new PC?

    I just received a black video iPod for Christmas. So far, I've been able to buy, download and watch some TV shows and music from iTunes, and transfer some audio books from CDs and I love it. I have everything on a manual setting.
    The problem is my PC is several years old now, is very slow, doesn't have enough memory, and the CD drive sometimes is flakey, so I am planning to replace the PC soon.
    However, I've been told that everything on your PC has to match everything on your iPod, or else it'll overwrite everything.
    Is this true even in manual mode? I don't want to lose everything I already have when I get my new PC, so do I have to transfer everything from the old to the new? How would I do that, since many of these files are huge and, as I said, the CD drive doesn't always work properly? What do people do if their PC crashes completely and one is no longer able to access the hard drive?
    Compaq Notebook   Windows XP   Plan to replace soon

    Thank you -- that is helpful.
    I guess my question is twofold. First, how do you transfer to a new computer, which you've answered. The other part of the question, which I didn't really ask explicitly, is to do with manual vs. automatic syncing. It sounds like if it's on manual syncing, then one's iPod is not going to be overwritten by iTunes and you do not have to maintain everything on the PC the same as it is on the iPod. Is that correct?
    Also, can I download to my iPod from two different PCs? For example, because my CD drive doesn't always work, I'd like to use my boyfriend's PC to upload my CDs. Since I won't be getting my new PC immediately (need to recover from Christmas first), is it possible for me to set up my iTunes account on his PC as well as on my own?
    The person I talked to at the Apple Store told me that you can only use your iPod with one computer at a time and that it was something about copyright. Also, if you sync things manually Apple can't help with any support issues.
    Compaq Notebook   Windows XP   Plan to replace soon
    Compaq Notebook   Windows XP   Plan to replace soon

  • Two-Part Question (Other & USB 2.0 Cardbus)

    I've been having some minor synching issues when connecting iPhone to my Titanium Powerbook. It only has a USB 1.0 port, but have had many successful syncs. At times iTunes does not see iPhone and I need to power it down and start up a again for it to show up. Going through some troubleshooting with an Apple tech and have possibly discovered that the cable or dock may be the culprit.
    In experiencing this problem, I've had my content oddly wiped from the iPhone twice but not my settings. After I re-synched everything again last night, I now notice that I have approx 2.6GB of "other" files on the iPhone outside of photos and music. I suspect that it is my original batch of photos and music that appeared to be gone as I have not loaded anything substantial beyond that.
    My first question is: How can I wipe just the "other" info without having to start from scratch (assume that's what a Restore will do?)
    Second problem/question: I bought an ADS TECH USB 2.0 hi-speed cardbus for the PCMCIA slot. Plugged it in hoping to achieve 2.0 speed, but upon connecting iPhone, I get the gray restart screen. ADS has no driver for USB beyond those needed for OSX 10.2x.
    Has anyone had success with PC cards to achieve USB2.0 and what brand is it?
    Titanium Powerbook G4 550 MHz   Mac OS X (10.4.10)  
    Titanium Powerbook G4 550 MHz   Mac OS X (10.4.10)  
    Titanium Powerbook G4 550 MHz   Mac OS X (10.4.10)  

    Hi, Rick. Cardbus adapters for FW and USB 2 can't provide power to connected devices the way the built-in USB and FW ports do. Therefore, it's best to connect only externally-powered devices to them. The cable link you mention that runs from one of your USB ports to the adapter card is supposed to provide some power to the ports on the card, but if even externally-powered devices like ytour iPod (its battery was charged up, wasn't it?) aren't working properly, then it sounds as though you probably have some other problem.
    Googling "Q-STOR QU2FCB" turns up quite a few hits containing absolutely no good news. If I were you, I'd return the card for a refund.

Maybe you are looking for

  • HT5622 How do i remove a credit card from my apple id billing purchases?

    How do i remove a credit card from my apple id billing purchases?

  • Differences in Date/Time info between FCP 7 and FCP X?

    Please bear with me as I have hardly touched FCP 7 in the past 2 years, so most of what little I knew has now been forgotten! Yesterday I captured an old 2002 Mini-DV PAL tape into FCP X. The tape consisted of:- 1. Some original clips as they were sh

  • Fixed Column Header

    Currently I'm using 2 RTF templates . The first one (called header) have special conditions that will be used to call certain tables of the second template (called detail). Here is the code that is used in the first RTF: <?import:file:///C:/MLE/Repor

  • Is a Cintiq 24HD touch overkill if Illustrator/Photoshop is a hobby?

    Is it overkill? I enjoy these programs very much, but I'm wondering if it's ridiculous to invest in something that large and complex (but oh so cool), or in one of the MANY Intuos pads I know little to nothing about. Any suggestions/ comments?

  • Re: structure names

    hi experts, i want to prepare a query in sqvi for following fields. asset, retirement (cost of disposal value) , depr retired, ret book value, ret revenue, gain or loss. so i want to create a quickviewer in sqvi can anybody give me the structure name