Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Dock Icon Overlays via Java? Possible?

Dock Icon Overlays via Java? Possible?
Thread Tools
RevEvs
Mac Elite
Join Date: Feb 2001
Location: Sitting in front of computer
Status: Offline
Reply With Quote
May 13, 2004, 10:12 AM
 
Does anyoen know if its possible to do the dock icon overlays (ala mail.app) with a java app? ive had a few quick looks at the apple java api's but have not been successful..

any help appreciated
I free'd my mind... now it won't come back.
     
thefamousmred
Junior Member
Join Date: Mar 2002
Status: Offline
Reply With Quote
May 13, 2004, 11:57 AM
 
Originally posted by RevEvs:
Does anyoen know if its possible to do the dock icon overlays (ala mail.app) with a java app? ive had a few quick looks at the apple java api's but have not been successful..

any help appreciated
Code:
NSImage nsImage = new NSImage(); NSBitmapImageRep rep = new NSBitmapImageRep(width, height, 8, 3, false, false, NSGraphics.DeviceRGBColorSpace, 0, 0); // 8bpp, 3bytes/pixel, no alpha rep.setBitmapData(bytes); nsImage.addRepresentation(rep); NSApplication.sharedApplication().setApplicationIconImage(nsImage);
Where bytes is a byte array describing the image. You'll need to load the image and perform the overlay in Java, then convert the Java representation of the image into the byte array in the format that the NSBitmapImageRep expects.
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 03:39 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,