Can't get RescaleOp to retain transparancy (it sets alpha to black)

Got my code here, the operation fills in the transparancy with black:
public static BufferedImage brighten(BufferedImage bi) {
            RenderingHints hints = new RenderingHints(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_QUALITY);
         RescaleOp op = new RescaleOp(scaleFactor, 0, hints);
         BufferedImage copy = op.createCompatibleDestImage(bi, bi.getColorModel());
         op.filter(bi, copy);
         return copy;
}Ive looked on the web, but i only found one reference to this here - http://forums.sun.com/thread.jspa?threadID=568146 - , and I tried doing what solved it for them (as far as i can tell setting the source and destination to the same thing) but that didn't work - any help would be much appreciated!
Joe
Edited by: 794057 on 27-Oct-2010 06:36
for some reason links arnt working
Edited by: 794057 on 27-Oct-2010 06:38
actually they are - just not if you use the "link" button! crazy

I think I was passing it an incorrect image, but now i get an empty image:
        public static ImageIcon changeBrightnessContrast(Icon icon, float brighness, float contrast)
          ImageIcon ret = new ImageIcon();
          BufferedImage image = (BufferedImage) iconToImage(icon);
          BufferedImage imagecopy = copy(image, BufferedImage.TYPE_INT_RGB);
        image = brighten(imagecopy);
        ret.setImage(image);
          return ret;
        public static BufferedImage copy(BufferedImage bi, int type) {
          BufferedImage result = new BufferedImage(bi.getWidth(), bi.getHeight(), type);
          Graphics2D g = result.createGraphics();
          g.drawRenderedImage(bi, null);
          g.dispose();
          return result;
        public static BufferedImage brighten(BufferedImage bi) {
          float scaleFactor = 1.2f;
          //RenderingHints hints = new RenderingHints(RenderingHints.KEY_ALPHA_INTERPOLATION, RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY);
          RescaleOp op = new RescaleOp(scaleFactor, 0, null);
          BufferedImage copy = op.createCompatibleDestImage(bi, bi.getColorModel());
          op.filter(bi, copy);
          return copy;
     }here is how I use it, the above code set transparancy to black (understandably, as the image its copying to has no alpha channel) however, if i set it to have one:
BufferedImage imagecopy = copy(image, BufferedImage.TYPE_INT_ARGB);
the image I get not is not there! (or all transparent??)
Edited by: 794057 on 27-Oct-2010 06:58
for some reason chanel is ***** out C H A N E L (as a misspelled channel)
Edited by: 794057 on 27-Oct-2010 07:01

Similar Messages

  • HT201441 i have bought a second hand iphone 4s which is stilllinked to previous owners itunes ID.I cant get his details off him as he has his money and is blanking me. I can't get anything on the phone after setting up the language.HELP!!

    I cannot activatea second hand iphone 4s as i don't have previous owners itunes ID. I can't get anything on the phone after setting the language as its asking for activation. Please can anyone help ???? Ideally i would like to get it back to factory settings and start afresh but right now i would settle for anything. Should say i only have the phone and charger, no box so no details

    Unfortunately, the only one who can help is the previous owner.  Otherwise you will not be able to activate and use the phone.  Apple can't/won't help you with this either.

  • Since I have synced my contacts with Hotmail, I can no longer use relationships. How can I get this back without having to set up another email account?

    I am currently using Hotmail with syncing enabled for mail and contacts. However, I cannot find or add the fields for family members or any relationship other than manager and assistant. I cannot add the fields manually, nor can I get Siri to assign the proper relationship to the right person (everyone defaults to manager or assistant).
    I'd really prefer not to have to use a different email address just to be able to use the phone; however, up until I synced the accounts I was able to edit relationships. Can anyone help me out?

    This is a limit with an Exchange account.

  • My Facebook account has bein deleted how can I get it back to my iPad setting

    My Facebook account has bein deleted how can I get it back to my iPad setting

    Apple ID: "This Apple ID has been disabled for security reasons" alert appears
    http://support.apple.com/kb/ts2446
    Contact Apple Support
    https://expresslane.apple.com/GetproductgroupList.action
     Cheers, Tom

  • HT202649 Hello, I just bought a used iPhone 4S but can't get past the ID to continue set up. I went to iforgot as requested to reset my password to my existing account. Still can't get past the ID.

    Hello,
    I am having setup issues with a used 4S iphone. I can't get past the Apple ID step.
    First it said it was an existing ID and I should go to iforgot and reset my password.
    I did, but still keep getting the error message.
    Then I entered the serial number online support and it said the ID was another account. Would that be the seller?
    Do I need to get them to unregister under their name before I can proceed? Or...
    Please help. I start  new job on Monday that required me to have a smartphone. I need it up and running.
    Thank you
    R

    Yes, you have encountered Activation Lock (Find My iPhone Activation Lock - Apple Support). The only way that phone will ever be usable is if the owner the phone is locked to releases it (see: Find My iPhone Activation Lock: Removing a device from a previous owner’s account - Apple Support). If you are lucky the phone is locked to the seller, so you can ask them to unlock it. If the seller is merely a middleman and the previous owner is not the seller it gets much more complicated. It's even possible that you bought a stolen phone, in which case you will never be able to use it and you should return it for a refund.

  • Can't get Send Video Message under conversation tab to be black

    Put in new contact and when I try to video call can't get thru...I see under the conversation tabb that Send Video Message is greyed out.  How do I get it to black to be able to send a message?

    It seems to be an ongoing issue the last couple of days..there's a few posts already discussing it in the forum. I found that if I sent the photos from my verizon acct on the iphone, it uploaded to the gallery fine..so it's a .mac account problem i think. Try it through another acct and I don't think you'll have a problem. It had always worked fine for me sending from my mac account until this weekend.

  • I can not get into safari, i have re set my password and it still wont let me on

    i was able to get to safari then it asked me for id, i emailed myself the id it still wont let me onto safari?

    The general instructions here should work, if you choose the Gmail account type:
    http://support.apple.com/kb/ht1385
    However, make sure you're using the entire email address as your "username." Simply using the first part is not sufficient.
    If you still can't get in, I'd recommend contacting your sys admin, or Google support.

  • I have a  ipad 64GB Wifi 3G and i can not get onto the internet, i have  set up wifi but it wont get on the net

    i have a  ipad 64GB Wifi 3G and i can not get onto the internet, i dont have a data plan yet & i have  set up wifi but it wont conect to the internet

    From your description above I conclude that the WiFi transmitter and receiver of your iPad appear to be working, but I abviously cannot tell how well they are working.
    Have you reset your iPad already?
    Press the Home and sleep/wake buttons simultaneously until only the white Apple logo appears on the screen - usually 10 to 15 seconds - ignore anything else.
    Genius Bar: http://www.apple.com/retail/geniusbar/

  • How can I get rid of that annoying white circle in that black square

    Since Oct. 7 last I have a 5S. Before had a 4S. About 4S no complaints, so the 5S maybe faster, better cam and so on but what I really hate it that stupid white circle in a black square you can move around on your screen. However when you want to open, for instance <messages> and that white circle is very near, messages will not be opened but a uselless black sub scrn with favorites, Siri, Device, Home. How can I get rid of that or delete or move it, it will no longer be visible on my scrn.

    Yes, you are right. I must have done it myself during the first days while exploring the many options after the initial set up was done. On the 4S, I still have, and also running under OS7, it was disabled that's why I thought it was default in the 5S; wrong thinking. Thanks a lot for your great help.

  • How can I get rid of the transparency in the Tab bar and get a solid colour

    I have upgraded to Firefox 4 and because the menu bars were 'ugly' put in a persona.
    Now I find that the Tab bar is transparent, which makes it hard to read.
    How can I change the Tab bar to a solid colour and still keep the persona.
    And if there is a solution can it please be put into simple terms for someone who only has a bit of computer skill.
    thanks :)

    You can try a solid persona.
    *Solid Gallery: http://www.getpersonas.com/en-US/gallery/Solid

  • How can I get graphics to stay transparent?

        I use a lot of clip art & buy digital scrap kits, when I'm working on a design & save my work for the night, close the program to shutdown my computer, The next time I open that design and edit anything, rotate, resize, etc.  It changes the background to white.
    It's VERy frustrating because a lot of times I have to go back & re-do all the layer styles and all that to make it look like it did & it's very time consuming at times.... So I end up leaving my computer on all night which my husband hates... it hibernates but still...  Is there a way to make it stay transparent? Thanks so much if you can help me!!

    And I can still edit it that way in photoshop?
    I know how to save as a png to keep it transparent, but I'm talking about when I'm still editing a design.

  • How can i get FF to retain a username only?

    IE will retain my usernames for at least several days on one of my email account servers. FF does not. I only want it to give me an option to keep usernames, not passwords.

    Hello jimstr, to keep only usernames then you have to go to Tools > Options > Privacy panel > History > Firefox will > choose '''Use custom settings for history''' > check '''Remember search and form history''' [v] > click OK to save that.
    Remember to '''UN'''check in Tools > Options > Security panel > Passwords >Remember passwords for sites [ ].
    thank you

  • How can I get Numbers to retain last opened position across my devices?

    I am a regular user of Numbers on my iMac (mid-2010), my iPad v3 and iPhone 5s.
    Ever since Mavericks came in and the many iWork updates that happened alongside it I have been unable to keep the same cell position in sync across my devices. So when opening one of my main spreadsheets it always opens at the top and I always have to scroll down to update my data.
    I don't remember this being a problem between iOS devices before that, it always went to the correct location. Until Mavericks I didn't sync with the Mac version as it was too clunky. They did a great job of fixing the sync part but lost this feature.
    Hope this makes sense. To summarise, my use case is that I open a large spreadsheet on any device to update it but it does not take me to my last entry, it goes to the top of the spreadsheet. That is not helpful to me, I want the last entry point regardless of idevice used to access it.
    Hope someone has an answer!
    Thanks.

    you cannot delete a post yourself.  You can flag the post an request a moderator remove.

  • Can we get value in  Interceptor which we set in afterAction() of JPF

    hi ,
    we are setting some value/object in HttpResponse object in to a afterAction() of JPF in wsrp .and we are try to get this value/object in Postinvoke() of Interceptor in wsrp.
    (In short we want to pass some value from producer to consumer).
    Are we going with right approach , cos as far my thinking we can set value
    in HttpResponse into afterAction() of JPF .
    if we can which Interceptor type (IGet/IBlocking/...) we should use to Intercept the response from producer using post Invoke() .
    Thanks in advance

    Hi Petri ,
    its like "pass data from a pageflow running on a producer to another pageflow/session running on the consumer"type case.
    according to our need we have to perform action in afterAction() method of JPF in weblogic 9.2 .cos its afterAction() we are not able to raise event and not able to add that data in response object .So we are not able to send data back to consumer side .
    let me know if any query and suggest me right way .
    regards

  • How can i get secuirty code to reset factory setti...

    Please help me out.
    Thank you

    12345 is the default security code unless it was changed. If you changed it and can't remember it then you can get it reset at your local Nokia Care Point. You need to bring proof of purchase with you.
    You can locate your nearest care point using the link below.
    ww.nokia.com/support

Maybe you are looking for

  • How can I display my macbook to ipad(s) using mirroring

    There are plenty of times when I want to show the people in a meeting what i'm looking at or doing on my laptop. If they have an ipad, is there a way to "mirror" my macbook to their ipad(s) directly without signing in to skype/google+/any other video

  • [SOLVED] Suddenly unable to mount samba share using cifs

    I have a home server running ArchLinux, hosting an SMB share. My client box is also ArchLinux, both are up to date, running Linux-ck 3.9.2-2-ck. Prior to rebooting both machines around twenty minutes ago, the share mounted fine for months. Here is th

  • Customization of reports

    Hi, In case of customisation of a report SAP FI Functional consultant has to work with ABAP people... Can anyone please let me know with an example, how a FI Functional Consultant discuss about the new report requirement with ABAP team? I mean for th

  • Can't get AS3 KeyboardEvent to work

    When I use the code below to capture a KeyBoard event I get the following error: TypeError: Error #1009: Cannot access a property or method of a null object reference. at Racer$iinit() at MyMain$iinit() Can anyone tell me why? -----Code------ package

  • HT4970 How do you set a reminder for only you when you are also sharing?

    How do you set a reminder for only you when you are also sharing? I want to share the grocery list with my wife but she don't want to be reminded for me taking my medicine.