We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexDiscussionGeneral Discussion,  Status › Change Processing Icon
Page Index Toggle Pages: 1
Change Processing Icon (Read 2088 times)
Change Processing Icon
Feb 18th, 2009, 9:27am
 
Hi there

I was wondering if I could post that, so I'm asking your advice.

I found a way to change the little 16x16 processing icon that appears in the taskbar and such on windows when running an applet / application made with processing.

I just wanted to know if I could post it to the processing:hacks wiki, or if it would be better not to spread the info ^^

Thanks
Re: Change Processing Icon
Reply #1 - Mar 29th, 2009, 7:17am
 
I'd like to know. Post!
Re: Change Processing Icon
Reply #2 - Mar 30th, 2009, 2:52am
 
I found this some time ago.
This is changing the applet icon/title (but not the taskbar icon, you'll have to check more, maybe looking around setIconImage -> setIconTaskbar/setTaskbarImage/... ?). Or maybe setting the icon in Setup as for this sketch I have a black taskbar icon which might be the one set in setup.


Code:

/**
fun-with-the-frame-object taken from http://processinghacks.com/hacks:fun-with-the-frame-object
@author Manic
*/
//the mouse X&Y controls the brightness and hue shift of the icon image
//you can resize the frame by dragging its corners

PGraphics icon;

void setup() {
 size(400,200);
 icon = createGraphics(16,16,JAVA2D);

 frame.setResizable(true);
}

void draw(){
 frame.setTitle("Frame Number "+str(frameCount));
 icon.beginDraw();
 //icon.background(102);
 icon.colorMode(HSB);
 for(int x=0;x<icon.width;x++){
   for(int y=0;y<icon.width;y++){
     icon.stroke((mouseX+(x*icon.width))%255,y*icon.height,constrain(mouseY,0,255));
     icon.point(x,y);
   }
 }
 icon.endDraw();
 frame.setIconImage(icon.image);
 ellipseMode(CORNERS);
 ellipse(0,0,width,height);
}

Re: Change Processing Icon
Reply #3 - Mar 30th, 2009, 3:38am
 
I tried the same trick:
Code:
void setup()
{
 size(200, 400);
 background(100);
 frame.pack();  // Get insets. Get more!
 insets = frame.getInsets();
 
 PGraphics icon = createGraphics(16, 16, JAVA2D);
 icon.beginDraw();
 icon.noStroke();
 icon.fill(#55AAFF);
 icon.ellipse(8, 8, 16, 16);
 icon.fill(#FFEE22);
 icon.ellipse(9, 6, 8, 6);
 icon.stroke(#FFEE22);
 icon.strokeWeight(3);
 icon.line(6, 6, 6, 12);
 icon.endDraw();
 frame.setIconImage(icon.image);
}

and on my Windows XP Pro SP3 system, Java 1.6.0_11, it changed both the frame icon and the taskbar icon. It even appears in the task manager.
Page Index Toggle Pages: 1