Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!

Aayush Patel

Greenhorn
+ Follow
since Apr 26, 2001
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Aayush Patel

I had created an int array from an image from the following code..
public void createImage(Image serverlateImage)
{int iw=0;
int ih=0;
int i=0;
try{ iw=serverlateImage.getWidth(null);
ih=serverlateImage.getHeight(null);
pixels=new int[iw*ih];
PixelGrabber pg=new PixelGrabber(serverlateImage,0,0,iw,ih,pixels,0,iw);
pg.grabPixels();
}catch(InterruptedException ie){}
}
now if i had created perfect int array then i m creating an image from this array...and code is following..
PrintFrame(int []pixels)
{System.out.println("size of array at printframe "+pixels.length);

Dimension d=getSize();
int w=(int)(d.getWidth());
int h=(int)(d.getHeight());
int al = 0,
rd = 0,
gr = 0,
bl = 0,
avg = 0;
int grayMap[] = new int[w*h];
// im=createImage(pixels,w,h);
// if(im!=null)
{for (int i = 0; i < h; i++)
{
for (int j = 0; j < w; j++)
{
al = (pixels [(i*w)+j] & 0xff000000)>>24;
rd = (pixels [(i*w)+j] & 0x00ff0000)>>16;
gr = (pixels [(i*w)+j] & 0x0000ff00)>>8;
bl = (pixels [(i*w)+j] & 0x000000ff);
avg = (rd+gr+bl)/3;
grayMap [(i*w)+j] = ((al <<24) |(avg <<16)|(avg<<8)|avg);
}
}
im=createImage (grayMap,w,h) ;
}
public static Image createImage(int [] pixels, int width, int height)
{
MemoryImageSource imageSource = new MemoryImageSource(width,height,pixels,0,width);
return Toolkit.getDefaultToolkit().createImage(imageSource);
}
now can somebody tell me whats the problem with this code...y i am not able to get image....thnx in advance
18 years ago
I want to make print of an applet in BROWSER...not from frame....
18 years ago
I am adding labels in one applet and storing that objects of labels in one vector ..after that i want to remove one or two specific labels..now it will be remove from vector but how can i remove it from an applet....i mean object of label how can i remove....
18 years ago
i want to remove label..can anybody guide me...
18 years ago
Can someone tell me how can i change background color by clicking on label
18 years ago
hello everybody..i want to protect my java code..so nobody can access my java code even after decompilation...can anybody help me in this regards....thnx in advance...
19 years ago
i had done one applet...when i am running in internet explrer than it will run fine and cpu usage is about max 20%...but when i am running in netscape than i will get 100 % cpu usage...can someone tell me the solution for the above applet
19 years ago
i want to make color through hexadecimal value....can anybody help me...means i want color through hexadecimal value which is passed in applet code.....
19 years ago
hi shaunak,
in applet whenever we drawn component it will draw directly on screen..while in swing it will create one canvas (screen)automatically and drawn component on that screen..so in awt we are facing flickering problem..and we had solved it through double buffering...so check it out double buffering
19 years ago
I have an array of dates...now i want the day against of each date..means sunday,monday,tuesday.....
19 years ago
hi,
sorry i m not getting your answer..can u explained me in detail ...if u so then its good for me...
19 years ago
i had written in programme using swing..now when i run through normail applet then it will gives me flickering...i had used Applet and Panel instead of JPanel and JApplet...If i m using Swing then it will run fine...but gives me problem in applet...and i have to run that programme in Browser...so i must have to use AWT instead of Swing..So please help me in this regards...
19 years ago
hello mr.nate..
as per your suggestion image will be displayed on applet not in background..and i want in background.....
19 years ago
i had one programme with AWT and Swing ..but now if i m trying to use browser or appletviewer it gives security excepation and in programme i had used net..url is passed which fatches data from database..so i have to run that programme as an application so anybody can help me in this regards...
19 years ago
Can anybody help me for finding maximum value and minimum value from an array of double values..i mean suppose there is an array of double values and now i want to find max and min value then is there any readymade method in double class or we have to define with our own...
19 years ago