I have like this problem and I know that depends on the size of the gif 
image but what the solution for that.
 I need to load and show 1000kb GifImage without seeing black screen  Or 
anything fishy. 

On Tuesday, July 24, 2018 at 3:51:45 AM UTC+3, rdvg...@gmail.com wrote:
>
> Excuse me, I discovered the problem
>
> Thanks.
>
>
> On Monday, July 23, 2018 at 7:20:11 PM UTC-5, rdvg...@gmail.com wrote:
>>
>> Hi,
>>
>> Hello,
>>  
>> I have an app that shows an ad matrix (buttons). For each ad there is a 
>> different link. When a link with a gif animation is activated, only a black 
>> screen is displayed, otherwise the page will be displayed without any 
>> problem.
>>
>>
>> <https://lh3.googleusercontent.com/-ETFZOX5Oelc/W1Zva8PyI4I/AAAAAAAAAOg/hNI6zQlB2Rw99c116LfRpctpUzf_Fi0VwCLcBGAs/s1600/CodenameOne%2BScreenshot%2B25.png>
>>
>>
>> My code.
>>
>>     private void muestraOfertas(Container cnOfertas, Vector vAnuncios) {
>>
>>         cnOfertas.removeAll();
>>         cnOfertas.setScrollableY(true);
>>         Container cntB = new Container();
>>         int size = Display.getInstance().convertToPixels(15);
>>         int ancho = Display.getInstance().getDisplayWidth();
>>         ancho = (int) (ancho - (ancho * 0.03d));
>>         boolean ciclo = true;
>>         int c = 2;
>>         while (ciclo) {
>>             c++;
>>             size = (int) (ancho / c);
>>             int r = ancho % c;
>>             if (r <= 0 || c >= vAnuncios.size()) {
>>                 ciclo = false;
>>             }
>>         };
>>         vAnuncios = priorizaCampanas(vAnuncios);
>>         Button bt[];
>>         bt = new Button[vAnuncios.size()];
>>         for (int i = 0; i < vAnuncios.size(); i++) {
>>             Campana1 cM1 = (Campana1) vAnuncios.elementAt(i);
>>             bt[i] = new Button();
>>             bt[i].setUIID("Label");
>>             Image img;
>>             if (cM1.getRutaLogo().equals("") || 
>> cM1.getRutaLogo().equals("null")) {
>>                 img = res.getImage("promo.png").scaled(size, size);
>>             } else {
>>                 EncodedImage lugar = 
>> EncodedImage.createFromImage(Image.createImage(size, size, 0xffcccccc), 
>> true);
>>                 img = URLImage.createToStorage(lugar, 
>> Integer.toString(cM1.getCampana()), cM1.getRutaLogo());
>>             }
>>             bt[i].setIcon(img);
>>             cntB.addComponent(bt[i]);
>>
>> *            bt[i].addActionListener(new ActionListener() {*
>> *                public void actionPerformed(ActionEvent ae) {*
>> *                    Display.getInstance().execute(cM1.getEnlace());*
>> *                }*
>> *            });*
>>         }
>>         Container cnCentro = new Container(new 
>> BoxLayout(BoxLayout.Y_AXIS)).add(cntB);
>>         cnOfertas.add(BorderLayout.CENTER, cnCentro);
>>     }
>>
>> How can i solve this problem?
>>
>> regards
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to codenameone-discussions+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/ef35644a-690a-48d1-b4e0-401893f978c1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to