forum.boolean.name

forum.boolean.name (http://forum.boolean.name/index.php)
-   Основной форум (http://forum.boolean.name/forumdisplay.php?f=49)
-   -   аналог imagefromimage (http://forum.boolean.name/showthread.php?t=1333)

Eddy 19.08.2006 19:51

аналог imagefromimage
 
Здрасте!вопрос, в принципе, к хорошо знающим ява.
Вот в паскале есть имажефромимаже,которая как известно не может вырезать с прозрачностью.Конечно есть либа от pilgrim'а...Но!она рисует,а мне нужно именно чтоб создалась картинка.
Так вот вопрос.Можно ли как-нить реализовать прозрачность на мидп1?Т.е. либу на ява,типа как имажефромимаже,только не создавать рисунок(смотрел через декомпилятор), а подгрузить прозрачный рисунок и уже на него копировать часть нужного?

Piligrim 20.08.2006 11:29

Re: аналог imagefromimage
 
Images are either mutable or immutable depending upon how they are created. Immutable images are generally created by loading image data from resource bundles, from files, or from the network. They may not be modified once created. Mutable images are created in off-screen memory. The application may paint into them after having created a Graphics object expressly for this purpose. Images to be placed within Alert, Choice, Form, or ImageItem objects are required to be immutable because the implementation may use them to update the display at any time, without notifying the application.

An immutable image may be created from a mutable image through the use of the createImage method. It is possible to create a mutable copy of an immutable image using a technique similar to the following:

Image source; // the image to be copied
source = Image.createImage(...);
Image copy = Image.createImage(source.getWidth(), source.getHeight());
Graphics g = copy.getGraphics();
g.drawImage(source, 0, 0, TOP|LEFT);


It is also possible to use this technique to create a copy of a subrectangle of an image, by altering the width and height parameters of the createImage() call that creates the destination image and by altering the x and y parameters of the drawImage() call.

Eddy 20.08.2006 21:42

Re: аналог imagefromimage
 
да,help я читал.и про этот способ тоже.но ведь мутабл картинки не прозрачные и когда на них(1) "копируешь" прозрачную картинку(2), то (1) остается белая...Или я ошибаюсь?

Piligrim 20.08.2006 23:17

Re: аналог imagefromimage
 
наоборот immutable теряют прозрачность


Часовой пояс GMT +4, время: 19:45.

vBulletin® Version 3.6.5.
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Перевод: zCarot