Click here to Skip to main content
15,886,422 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how can i create a new image icon from 5 (for example) image icon?

BufferedImage bi = new BufferedImage( 100 ,100 , BufferedImage.TYPE_INT_ARGB);
Graphics2D g = bi.createGraphics();
ImageIcon ur = new ImageIcon(getClass().getResource("/images/UR.png"));
ImageIcon ul = new ImageIcon(getClass().getResource("/images/UL.png"));
ImageIcon dr = new ImageIcon(getClass().getResource("/images/DR.png"));
ImageIcon dl = new ImageIcon(getClass().getResource("/images/DL.png"));
g.drawImage(ur.getImage(), 0, 0, this); g.drawImage(ul.getImage(), k/2,0,this);
g.drawImage(dr.getImage(), 0,k/2 ,this); g.drawImage(dl.getImage(), k/2,k/2 ,this);
g.drawImage(ul.getImage(), x, y, this); imageicon ret = new ImageIcon(bi);
Posted
Updated 23-Mar-13 11:51am
v3
Comments
[no name] 23-Mar-13 15:50pm    
Your problem might become clearer if you post the code that you have tried that demonstrates your problem.
Coder93 23-Mar-13 16:05pm    
its my code :
BufferedImage bi = new BufferedImage( 100 ,100 , BufferedImage.TYPE_INT_ARGB);
Graphics2D g = bi.createGraphics();
ImageIcon ur = new ImageIcon(getClass().getResource("/images/UR.png"));
ImageIcon ul = new ImageIcon(getClass().getResource("/images/UL.png"));
ImageIcon dr = new ImageIcon(getClass().getResource("/images/DR.png"));
ImageIcon dl = new ImageIcon(getClass().getResource("/images/DL.png"));
g.drawImage(ur.getImage(), 0, 0, this);
g.drawImage(ul.getImage(), k/2,0,this);
g.drawImage(dr.getImage(), 0,k/2 ,this);
g.drawImage(dl.getImage(), k/2,k/2 ,this);
g.drawImage(ul.getImage(), x, y, this);
imageicon ret = new ImageIcon(bi);
[no name] 23-Mar-13 16:12pm    
And what is the problem that you have with your code?
Coder93 23-Mar-13 16:36pm    
i found one of my problem :
how can i chane the imageicon size ?(if the size is'nt an integer number)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900