|
|
|
Как в JPanel вывести (нарисовать) имадж?
|
|||
|---|---|---|---|
|
#18+
<subj> спасиба! ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 04.09.2005, 19:46 |
|
||
|
Как в JPanel вывести (нарисовать) имадж?
|
|||
|---|---|---|---|
|
#18+
на всю Jpanel ? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 05.09.2005, 11:32 |
|
||
|
Как в JPanel вывести (нарисовать) имадж?
|
|||
|---|---|---|---|
|
#18+
Самый примитивный способ - это кинуть на нее JLabel, а лейблу назначить иконку. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 05.09.2005, 11:36 |
|
||
|
Как в JPanel вывести (нарисовать) имадж?
|
|||
|---|---|---|---|
|
#18+
Cпасиба. А как потом поверх этого имаджа, в той же панели, наложить наверх, другие имаджи? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 05.09.2005, 11:57 |
|
||
|
Как в JPanel вывести (нарисовать) имадж?
|
|||
|---|---|---|---|
|
#18+
int width = 100; int height = 100; // Create buffered image that does not support transparency BufferedImage bimage = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); // Create a buffered image that supports transparency bimage = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB); These examples create buffered images that are compatible with the screen: GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); GraphicsDevice gs = ge.getDefaultScreenDevice(); GraphicsConfiguration gc = gs.getDefaultConfiguration(); // Create an image that does not support transparency bimage = gc.createCompatibleImage(width, height, Transparency.OPAQUE); // Create an image that supports transparent pixels bimage = gc.createCompatibleImage(width, height, Transparency.BITMASK); // Create an image that supports arbitrary levels of transparency bimage = gc.createCompatibleImage(width, height, Transparency.TRANSLUCENT); A screen compatible buffered image can also be created from a graphics context: public void paint(Graphics g) { Graphics2D g2d = (Graphics2D)g; int width = 100; int height = 100; // Create an image that does not support transparency BufferedImage bimage = g2d.getDeviceConfiguration().createCompatibleImage( width, height, Transparency.OPAQUE); // Create an image that supports transparent pixels bimage = g2d.getDeviceConfiguration().createCompatibleImage( width, height, Transparency.BITMASK); // Create an image that supports arbitrary levels of transparency bimage = g2d.getDeviceConfiguration().createCompatibleImage( width, height, Transparency.TRANSLUCENT); } ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 05.09.2005, 12:11 |
|
||
|
|

start [/forum/topic.php?fid=59&fpage=785&tid=2151585]: |
0ms |
get settings: |
7ms |
get forum list: |
10ms |
check forum access: |
2ms |
check topic access: |
2ms |
track hit: |
30ms |
get topic data: |
7ms |
get forum data: |
2ms |
get page messages: |
33ms |
get tp. blocked users: |
1ms |
| others: | 253ms |
| total: | 347ms |

| 0 / 0 |
