|
|
Dock Icon Overlays via Java? Possible?
|
|
|
|
Mac Elite
Join Date: Feb 2001
Location: Sitting in front of computer
Status:
Offline
|
|
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.
|
|
|
|
|
|
|
|
Junior Member
Join Date: Mar 2002
Status:
Offline
|
|
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 Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|