Problem in encodedimage

Hi I want to display 20 frames encoded using the domain network manager.

Here's the code...

GridFieldManager grid;
grid = new GridFieldManager (5,4,0);
        
E [] EncodedImage = new EncodedImage [20];
for (int i = 1; i)<>
{
e [i] .getEncodedImageResource ("1.jpg");
            
}
for (int i = 1; i)<>
{
Grid.Add (new BitmapField (e [i] .getBitmap (())); error in this
}
Add (Grid);

can someone tell me the problem. ??

I would have coded this:

e [i] .getEncodedImageResource ("1.jpg");

like this:

e [i] = EncodedImage.getEncodedImageResource ("1.jpg");

In fact I would have created a Bitmap rather than a table of EncodedImage and used

Bitmap.getBitmapResource (...);

but I think that either will work.

Tags: BlackBerry Developers

Similar Questions

  • Problems to make my first application work

    Hello, I am new in the development of blackberry applications, but not new in development (C++, C, c#, JAVA).

    I am facing some problems with my first development for the blackberry in JAVA platform.

    MyScreen code:

    public final class MyScreen extends MainScreen
    {
    
        EncodedImage mImage = EncodedImage
                .getEncodedImageResource("icon.png");
        ApplicationIcon mIcons = new ApplicationIcon(mImage);
    
        ApplicationIcon mIcon = mIcons;
    
        private static Date cDate;
        private String lefteds = "";
        private  LabelField leftd = new LabelField("Not set");
        private TextBoxField tbf = new TextBoxField(200, 30);
       // private GridFieldManager grid = new GridFieldManager(3,3,1);
        //private VerticalFieldManager _manager;
        private LabelField Leftd2 = new LabelField("Not set");
        private int Inum = -1;
    
        //-----------------------------------------------
        private static PersistentObject store = PersistentStore.getPersistentObject(0x1dfc10ec6454eb14L); 
    
        public void saveUserInfo(){
            synchronized(store) {
                store.setContents(leftd);
                store.commit();
            }
        }
    
        public LabelField getlefted() {
            LabelField leftd;
            synchronized(store) {
                leftd = (LabelField)store.getContents();
                if(leftd == null) {
                    leftd = new LabelField("Not Set!");
                }
            }
            return leftd;
        }
        //-----------------------------------------------
    
        MenuItem menuRegister = new MenuItem("Add status icon", 0, 0) {
            public void run() {
                registerIndicator();
            };
        };
    
        MenuItem menuUnregister = new MenuItem("Remove status icon", 0, 0) {
            public void run() {
                unregisterIndicator();
            };
        };
    
        protected void makeMenu(Menu menu, int instance) {
            super.makeMenu(menu, instance);
            menu.add(menuRegister);
            menu.add(menuUnregister);
        }
    
        private void registerIndicator() {
            try {
                ApplicationIndicatorRegistry reg = ApplicationIndicatorRegistry
                        .getInstance();
                ApplicationIndicator indicator =
                        reg.register(mIcon, false, true);
                indicator.setVisible(true);
            } catch (Exception e) {
            }
        }
    
        private void unregisterIndicator() {
            try {
                ApplicationIndicatorRegistry reg = ApplicationIndicatorRegistry
                        .getInstance();
                reg.unregister();
            } catch (Exception e) {
            }
        }
    
        void updateValue(int value) {
            try {
                ApplicationIndicatorRegistry reg = ApplicationIndicatorRegistry
                        .getInstance();
                ApplicationIndicator appIndicator =
                        reg.getApplicationIndicator();
                appIndicator.setValue(value);
            } catch (Exception e) {
            }
        }
    
        void updateIcon(ApplicationIcon icon) {
            try {
                ApplicationIndicatorRegistry reg = ApplicationIndicatorRegistry
                        .getInstance();
                ApplicationIndicator appIndicator =
                        reg.getApplicationIndicator();
                appIndicator.setIcon(icon);
            } catch (Exception e) {
            }
        }
    
        //--------------------------------------------------
    
        public MyScreen()
        {
            try
            {
            this.Leftd2.setText(getlefted().getText());
            }
            catch (Exception e)
            {
    
            }
    
             Background bg = BackgroundFactory.createSolidBackground(Color.LIGHTGRAY);
             setBackground(bg);
    
               XYEdges edges = new XYEdges(20, 20, 20, 20);
               Border border = BorderFactory.createBevelBorder(edges);
    
            // Set the displayed title of the screen
             setTitle("CountDown");
             ButtonField b = new ButtonField("Set CountDown", ButtonField.CONSUME_CLICK);
    
             b.setChangeListener(customListener);
             add(b);
    
             this.tbf.setText("Days to go!");
             add(Leftd2);
    
             add(this.tbf);
    
             if (this.Leftd2 == null)
             {
             saveUserInfo();
             }
    
        }
    
        public void calculate()
        {
            Calendar c = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
            c.setTime(new Date(System.currentTimeMillis())); //now
    
            Date currentdate = c.getTime();
    
            int lefted = (int)((cDate.getTime() - currentdate.getTime()) / (1000 * 60 * 60 * 24)) + 1;
            lefteds = lefted + "";
            leftd.setText(lefted + " " + this.tbf.getText());
            Leftd2.setText(lefted + " " + this.tbf.getText());
            saveUserInfo();
            this.Inum = lefted;
            updateValue(lefted);
    
        }
    
          FieldChangeListener customListener = new FieldChangeListener() {   
    
                public void fieldChanged(Field field, int context) {    
    
                     DateTimePicker datePicker = DateTimePicker.createInstance();
                     datePicker.doModal();
                     Calendar cal = datePicker.getDateTime();
                     Date date = cal.getTime();
                     MyScreen.cDate = date;
                     calculate();
                }
                 };
    
        }
    

    It's part * beep * ugly code and also, my application

    There are some problems with it (apart from the fact that its badly coded, etc.).

    Why is my device reboots as a minute after I launch my app (while the app completely closed)?

    Is why I set the status bar would not appear as it should?

    I hope that someone here would be able to help me, I'm sort of stuck... I must be trying to include to the top of my own for almoste time.

    Thank you very much.

    "I have being trying to understand by myself for almost an hour."

    What - only an hour?

    There is a little run before you can walk through this code, suggest a slightly lower rate.

    Two things that I would look at first.

    (1) but first reboot the device.  I'm guessing that you have an older device and you compile using a more recent environment.  Do not forget the applications being forward but not backward compatible, you should develop with a JDE older than the operating system on your device.

    Allied to this I'll make sure your app is not started automatically.

    (2) you seem to try to persist a LabelField:

    public void saveUserInfo() {}
    {Synchronized (Store)}
    store.setContents (leftd);
    Store.Commit ();
    }
    }
       
    public getlefted() {} LabelField
    LabelField leftd;
    {Synchronized (Store)}
    leftd = (LabelField) store.getContents ();
    if(leftd == null) {}
    leftd = new LabelField ("Not Set!");
    }
    }
    Return leftd;
    }

    To be persistent, an object must implement Persistable.  LabelField doesn't do this.  If you want to save a LabelField, what you save is the text (a string that is persistent) and recreate it.

    See how you go after looking through this.  But I recommend to start simple (just count) before adding things as indicators and persistentStore.

  • Animated GIF problem

    Hello

    I use a GIF image for the design of the loading bar

    The image is a black & white gif image that is his black image with white animation on it. but the problem is when I tried to load the image in the encodedImage holding corruption when shading is displayed. I tried the app with thread of animation. Also, I tried to draw the picture in a class that extends BitMapField. the problem still persists. Any idea on a question also

    This is the code that I had to use for gifs:

    Standard paint:

        protected void paint(Graphics graphics)
        {
            //Call super.paint. This will draw the first background
            //frame and handle any required focus drawing.
            super.paint(graphics);
    
            //Don't redraw the background if this is the first frame.
            if (_currentFrame != 0)
            {
                //Draw the animation frame.
                graphics.drawImage(_image.getFrameLeft(_currentFrame), _image.getFrameTop(_currentFrame),
                    _image.getFrameWidth(_currentFrame), _image.getFrameHeight(_currentFrame), _image, _currentFrame, 0, 0);
            }
        }
    

    The paint that I used:

        protected void paint(Graphics graphics)
        {
            for ( int i = 0; i <= _currentFrame; i ++ ) {
                graphics.drawImage(_image.getFrameLeft(i),
                                   _image.getFrameTop(i),
                                   _image.getFrameWidth(i),
                                   _image.getFrameHeight(i),
                                   _image,
                                   i,
                                   0, 0);
            }
        }
    
  • Problem chart/getting updated when you press on the background thread notification dialog box

    I have a user who is graphical reports strange behviour after our request and only under the following condiitions alarms:

    1 sets of users clock back to trigger the alarm

    2 user locked the BB

    3. the user receives alarm 1 minute later

    4. the user unlocks the BB

    The strange behavior is that the background seems to resemble a back buffer bland with a rectangular hole where the notification dialog box should be.  The user clicks then the graphics and where the button should be back to normal.

    The question is not if the user does not lock the BB first - it's only under the condition of deadlock that the problem occurs.  The user statement also sometimes see a dialog "Please wait" when running our application after unlocking, but never when our application is stopped.

    Model is 8310 with 4.5 and approximately 3 MB of free space depending on the situation-> filefree.

    The dialog box is to be generated and added to the queue by a background thread using the following method:

        private void notifyUser(String msg) {
            UiEngine ui = Ui.getUiEngine();
            EncodedImage icon = Theme.getIcon(false, true);
            Bitmap bm = null;
            if (icon != null) {
                bm = icon.getBitmap();
            } else {
                bm = Bitmap.getPredefinedBitmap(Bitmap.EXCLAMATION);
            }
            synchronized (Application.getEventLock()) {
                Screen screen = new Dialog(Dialog.D_OK, msg, Dialog.OK, bm, Manager.VERTICAL_SCROLL);
                ui.pushGlobalScreen(screen, 1, UiEngine.GLOBAL_SHOW_LOWER);
            }
        }
    

    I checked the problem does not occur on the "BOLD", Pearl Flip, or 8100 with real hardware.  The problem never happens in simulators (tried about 6 models).

    Any thoughts?  Is there something wrong with the code above or spark a dialogue for a non-event like this thread?

    Thanks in advance...

    The workaround for the "locked" State is to implement MemoryCleanerListener in your main application class. This listener is notified when the device is locked. We define a property here "deviceWasLocked", then query this property of our custom popup dialog to determine if we arrive on a locked screen.

    Then we switch our application in the foreground (requestForeground) that clears up this particular issue, and any event goes well.

    The problem of 'missed calls' is a little more complicated, unfortunately, but you're not complaining that one!

    Having said all this, I'd love to see other ideas on how to solve this problem. We strugggled for several weeks with this problem when the 4.3 is released.

  • Photo of BlackBerryContact at EncodedImage

    Hi, I want to get a byte [] photo EncodedImage in the BlackBerryContact, how can I do this?

    When I try to do, an illegal argumet exception is thrown by the createEncodedImage (byte [] b, int offset, int length);

    I call it like that

    byte[] binary = contact.getBinary(BlackBerryContact.PHOTO, BlackBerryContact.ATTR_NONE);
    
    EncodedImage imagen=EncodedImage.createEncodedImage(binary,0,binary.length);
    

    Thank you

    This is due to a problem with the BlackBerry device software.  It was resolved in the version of terminal software BlackBerry 4.5.0.28 and higher.

  • Another problem in the BLOB view

    Hi all

    I have a problem in the image display on the screen. Here's my situation: I have an Oracle table, consists of string, CLOB and BLOB. I also have a web application using JSP and Servlet. My Blackberry application will access the servlet to get the data in my table. Returns an XML file, not a file JSP, servlet, then my Blackberry application will read this file, it displays on the screen. I use not BrowserField.

    My problem is... How can I display the image?

    I have tried to convert byteArray BLOB, and then again to convert to a string, inserting it into my XML. In my Blackberry app, get the string and convert it to byteArray and then use

    Bitmap.createBitmapFromBytes to get the Bitmap image. But it gives me nothing.

    Can someone help me?

    Thank you much in advance.

    Kind regards

    Novan Ananda

    I offer two General options:

    1 generate and send an image url to the XML format. Request per second to get the bytes of the images to the server. Server can presave the image in a temp folder or get the blob of the DB directly.

    2 send the image data as xml encoded in base64. Decode the device and view EncodedImage.

    I prefer the method if you send pictures not only in response. Can see the context for your asynchronous image download information.

    Thank you

    Eugen

  • EncodedImage does not work

    I'm trying to load the image of the envoirnment multithreading server:. I have 200. ResponseCode and receive the byte array. No.:

    but my I am unable to create EncodedImage

    HttpConnection httpConnection = null;

    InputStream httpInput = null;
    int responseCode;

    try {}

    httpConnection = ConnectionFactory () .getConnection (url) (new) (HttpConnection) .getConnection;
    httpConnection.setRequestProperty ("User-Agent", "' Profile / MIDP - 1.0 Configuration/CLDC - 1.0" ");
    httpConnection.setRequestMethod (HttpConnection.GET);
    responseCode = httpConnection.getResponseCode ();
    If (responseCode! = HttpConnection.HTTP_OK) {}
    throw new IOException ("HTTP response code:" + responseCode);
    }
    httpInput = httpConnection.openInputStream ();

    Byte [] b = IOUtilities.streamToBytes (httpInput);

    problem is here this line does not run
                        EncodedImage bitmap = EncodedImage.createEncodedImage (b, 0, b.length, "image/png");
    {if(bitmap!=)}
    int dw = Fixed32.toFP (Display.getWidth ());
    int iw = Fixed32.toFP (bitmap.getWidth ());
    int sf = Fixed32.div (iw, dw);
    final EncodedImage bitmap.scaleImage32 (sf * sf 4 * 4) = bitmap2;

    storeCacheData (url, bitmap2);
    UiApplication.getUiApplication () .invokeLater (new Runnable() {}

    public void run() {}
    if(bitmap2!=null)
    Load.Download (bitmap2);
    }

    });
    }

    } catch (Exception e) {}
    allow the thread exits
    e.printStackTrace ();
    }

    } catch (Exception e) {}
    e.printStackTrace ();
    } //end wrestling
    }

    }

    When you debug this, I presume that that line is executed

    EncodedImage = bitmap

    but the following lines are not.  It's definitely because it threw an exception.  Unfortunately your captures, which to do this:

    } catch (Exception e) {}
    allow the thread exits
    e.printStackTrace ();
    }

    will not show anything because the only way out a printStackTrace in BlackBerry is to catch a Throwable, for example:

    } catch (Throwable t) {}
    allow the thread exits
    t.printStackTrace ();
    }

    I put better connect your exception catch (everywhere, not just here) and make sure that you see something.

    So the question is why this conversion is throw an exception.  If you print the exception detail message, then this will probably help you understand this.

    Probably that's because the data that you receive are not what you expect.  The best thing to do is to compare the contents of bytes you received and what you expect to get at the byte level.  Make sure that it is actually a png file.

  • Bugs in EncodedImage and BitmapField

    Hi guys,.

    I was badly put to scale down a large image (1600 x 1200) taken

    w / BB to fit on the Pearl camera. I use api EncodedImage for scale

    and send it to BitmapField. But this cause a system reboot. When I

    use BitmapField with the image without scaling, I will get an out of memory

    exception and my app will not work again.  BitmapField will work only w /.

    small images.

    I had a problem with that, and it seems that, on some devices, an error arithmatic will cause the device to reboot. This is probably due to an argument of the wrong size on the Bitmap you generate. Values getWidth() and getHeight() will return a value of Fixed32 with some height and the width of the image resizing product (even if it is false). I solved the problem by encapsulating all the numbers in a Fixed32 object and using the Fixed32.div () method.

    E.g.

    Bitmap b = EncodedImage.getEncodedResource("myImage.png").scale32 (Fixed32.div (Fixed32.toFP (1600), Fixed32.toFP (w_scale)),)

    Fixed32.div (Fixed32.toFP (1200), Fixed32.toFP (h_scale)));

  • How to convert byte [] EncodedImage rgb565 or bitmap data

    Hi all I am playing a video and I want to get snapshot of video as

    Byte [] byteArr = videoControl.getSnapshot ("encoding = rgb565");

    I try to get the Bitmap as

    image = EncodedImage.createEncodedImage (byteArr, 0, byteArr.length);

    image bitmap = image.getBitmap ();

    but she throws an Exception as IllegalArgumentException.

    I get a table of double length than screenWidth * ScreenHeight, perhaps because of the rgb565

    How can I convert a byte [] bitmap.

    I solve the problem to get the bitmap by building as

    image bitmap = new Bitmap (Bitmap.ROWWISE_16BIT_COLOR, Graphics.getScreenWidth (), Graphics.getScreenHeight (), byteArr);

  • Problem with PersistentObject.

    Hi all

    I am new to the BB and bad English (I'm Thai), sorry if you confuse in my words. I have a project that has thead to download the server image and record in PersistentObject using my CustomHashTable. The problem is that I have an error message "NonPersistableObjectException", which is based on the method "persistentObject.commit ();" in "getEncodedImage()" when I debug, here is my code.

    public class TestApp extends UiApplication{
    
        public static void main(String[] args) {      UiApplication app = new TestApp();        app.enterEventDispatcher();   }
    
      TestApp(){        pushScreen(new TestScreen()); }}
    
    public class TestScreen extends MainScreen{
    
       EncodedImage encodedImage;    CustomHashTable persistentHashtable;  private DataInputStream dis;  private byte[] encodeData;    private ByteArrayOutputStream byteStream; PersistentObject persistentObject = PersistentStore.getPersistentObject(0x61a0ab9f850b5c9bL);
    
      TestScreen(){     super();      if (persistentObject.getContents() == null) {         persistentHashtable = new CustomHashTable();          persistentObject.setContents(persistentHashtable);            persistentObject.commit();        }else {           persistentHashtable = (CustomHashTable)persistentObject.getContents();        }     encodedImage = getEncodedImage("http://download.magikmobile.mobi/scodp/mpreview.do?idc=683979&size=140x90&","4952","hot");       encodedImage = scaleImage(encodedImage);
    
          this.setTitle("Test my app");     this.add(new BitmapField(encodedImage.getBitmap()));  }
    
      public EncodedImage scaleImage(EncodedImage image) {      int displayWidth = Fixed32.toFP(Display.getWidth());      int imageWidth = Fixed32.toFP(image.getWidth());      int scalingFactor = Fixed32.div(imageWidth, displayWidth);        EncodedImage scaledImage = image.scaleImage32(scalingFactor, scalingFactor);      return scaledImage;   }
    
      public EncodedImage getEncodedImage(String url, String id, String catagory) {
    
           EncodedImage enc = null;      if (persistentHashtable.containsKey("EncodeImage01")) {           enc = (EncodedImage)persistentHashtable.get("EncodeImage01");     }
    
            if (enc != null) {          System.out.println(">>>>>  image not null");            return enc;        } else {            System.out.println(">>>>>  image null");            try {                String newURL = null;                while (url.indexOf("&") > 0) {                    newURL = url.substring(0, url.indexOf("amp;"));                    url = url.substring(url.indexOf("amp;") + 4);                    url = newURL + url;                }
    
                    newURL = null;                String suffix = "";                HttpConnection httpConnection = (HttpConnection) Connector.open(url+suffix);                httpConnection.setRequestMethod(HttpConnection.GET);                if (httpConnection.getResponseCode() == 302) {                   boolean b = true;                    while (b) {                        if (httpConnection.getResponseCode() == 200) {                            b = false;                            break;                        }                        httpConnection = (HttpConnection) Connector.open(httpConnection.getHeaderField("Location"));                    }                }                dis = httpConnection.openDataInputStream();                int length = (int) httpConnection.getLength();                if (length > 0) {                    encodeData = new byte[length];                    dis.readFully(encodeData);                } else {                    byteStream = new ByteArrayOutputStream();                    int ch;                    while ((ch = dis.read()) != -1) {                        byteStream.write(ch);                    }                    encodeData = byteStream.toByteArray();                    byteStream.close();                    byteStream = null;                }                dis.close();                dis = null;                httpConnection.close();                httpConnection = null;                try {                    enc = EncodedImage.createEncodedImage(encodeData, 0, encodeData.length);                } catch (OutOfMemoryError e) {                  System.out.println(">>>>  OutOfMemoryError");                    e.printStackTrace();                    return null;                } catch (NullPointerException e) {                 System.out.println(">>>>  NullPointerException");                    e.printStackTrace();                    return null;                } catch (IllegalArgumentException e) {                 System.out.println(">>>>>  IllegalArgumentException");                    e.printStackTrace();                    return null;                } catch (ArithmeticException e) {                  System.out.println(">>>>  ArithmeticException");                    e.printStackTrace();                    return null;                }                encodeData = null;                persistentHashtable.put("EncodeImage01", enc);                persistentObject.commit();                catagory = null;                id = null;                url = null;                return enc;            } catch (SecurityException ex) {                ex.printStackTrace();                return null;            } catch (IOException ex) {                ex.printStackTrace();                return null;            }        }    }
    
    }
    
    public class CustomHashTable extends Hashtable implements Persistable{
    
    }
    

    What should I do?

    Thank you very much

    ~ MazMellow ~.

    I see no problem here, hashtable will have any object as second parameter to the function, so you can put hashtable in storage of place (it is supported and commonly used):

    Hash hash = new Hashtable();

    data Byte [] = image.getData ();

    Hash.put ("first", data);

    ....

    ...

    ...

    ....

    data Byte [] (byte []) = hash.get ("first");

    image = EncodedImage.createEncodedImage (data,...);

  • Problem with adding a background - please help!

    Hi all

    I try to create my first BB app and run into a few problems with the addition of a background image on my screen.  I try to activate the background on my request without using the class BackgroundFactory I need this works for older BB models.

    I use EncodedImage so that I can to scale the context in which any size of BB.  I am aware of the loss of the aspect ratio, this isn't a problem for me.

    Here is my code:

    The background image.
    backgroundImage = EncodedImage.getEncodedImageResource("img/image.png");
           
    int currentWidthFixed32;
    int currentHeightFixed32;
    int requiredWidthFixed32;
    int requiredHeightFixed32;
    int scaleXFixed32;
    int scaleYFixed32;
           
    Get the dimensions of the current image in fixed-point number
    currentWidthFixed32 = Fixed32.toFP (backgroundImage.getWidth ());
    currentHeightFixed32 = Fixed32.toFP (backgroundImage.getHeight ());
           
    Get the dimensions of the image necessary in fixed-point number
    requiredWidthFixed32 = Fixed32.toFP (Display.getWidth ());
    requiredHeightFixed32 = Fixed32.toFP (Display.getHeight ());
           
    Calculate the scale factor
    scaleXFixed32 = Fixed32.div (currentWidthFixed32, requiredWidthFixed32);
    scaleYFixed32 = Fixed32.div (currentHeightFixed32, requiredHeightFixed32);
           
    Resize the image
    backgroundImage = backgroundImage.scaleImage32 (scaleXFixed32, scaleYFixed32);
    Imagearriereplan = backgroundImage.getBitmap ();

    Display display = new MainScreen();

    VerticalFieldManager verticalFieldManager = new VerticalFieldManager)
    VerticalFieldManager.USE_ALL_WIDTH |
    VerticalFieldManager.USE_ALL_HEIGHT |
    VerticalFieldManager.NO_HORIZONTAL_SCROLLBAR |
    VerticalFieldManager.NO_VERTICAL_SCROLLBAR |
    VerticalFieldManager.NO_HORIZONTAL_SCROLL |
    VerticalFieldManager.NO_VERTICAL_SCROLL) {}

    Override the paint method to draw the background image.
    {} public void paint (Graphics graphics)
    Draw the background image, then paint.
    graphics.drawBitmap (0, 0, backgroundBitmap.getWidth (), backgroundBitmap.getHeight (), Imagearriereplan, 0, 0);
    Super.Paint (Graphics);
    }
    };
    Add the handler to the screen.
    mainScreen.add (verticalFieldManager);
           
    VerticalFieldManager vfm2 = new VerticalFieldManager)
    VerticalFieldManager.NO_HORIZONTAL_SCROLLBAR |
    VerticalFieldManager.VERTICAL_SCROLLBAR |
    VerticalFieldManager.NO_HORIZONTAL_SCROLL |
    VerticalFieldManager.VERTICAL_SCROLL);
           
    verticalFieldManager.add (vfm2);
           
    The LabelField will be visible through the transparent image.
    LabelField labelField is new LabelField ("is a label");.
    ButtonField buttonField = new ButtonField ("asdf");

    Add the fields to the Manager.
    vfm2. Add (labelField);
    labelField = new LabelField ("this is a label");
    vfm2. Add (labelField);
    labelField = new LabelField ("this is a label");
    vfm2. Add (labelField);
    labelField = new LabelField ("this is a label");
    vfm2. Add (labelField);
    labelField = new LabelField ("this is a label");
    vfm2. Add (labelField);
    labelField = new LabelField ("this is a label");
    vfm2. Add (labelField);

    vfm2. Add (buttonField);
    buttonField = new ButtonField ("asdf2");
    vfm2. Add (buttonField);
    buttonField = new ButtonField ("asdf3");
    vfm2. Add (buttonField);
    buttonField = new ButtonField ("asdf4");
    vfm2. Add (buttonField);
    labelField = new LabelField ("this is a label");
           
    Tap on the screen.
    pushScreen (mainScreen);

    I want the "image.png" to act as a 'real' background, however, when I run the above code, the image.png appears in the form of the background, but when I scroll down, the background scrolls as well, and I see a white space.  I want to have "image.png" would you like the background permanently and add another manager who would be scrolling if scrolling is required.

    What I'm doing wrong here?  Why I can't see the vertical scroll bar and why the background is not scrollable?

    Any help is appreciated!

    See you soon!

    Make sure that you set the FullScreen.DEFAULT_MENU property - this will give you the default system menu items.

    You add your menu items by substituting makeMenu().

  • Problem on the picture of the burden of the SD card

    I load the jpg from SD card. but just show a part of this image. (the image too large to show?) the code below:

    data Byte [] = null;
    try {}
    FileConnection fconn = (FileConnection) Connector.open (uriString);
    If (fconn. Exists())
    {
    InputStream input = fconn.openInputStream ();
    ByteArrayOutputStream Baos = new ByteArrayOutputStream();
    int j = 0;
    While ((j = Input.Read ())! = - 1) {}
    Baos.Write (j);
    }
    data = baos.toByteArray ();
    Input.Close ();
    fconn. Close();
    }
    } catch (Exception e) {}
    e.printStackTrace ();
    }

    EncodedImage image = EncodedImage.createEncodedImage (data, 0,
    Data.Length);
    Image bitmap bitmap = image.getBitmap ();
    MapField = new BitmapField (bitmap);

    No problem with your code above.

    If the image is larger than the resolution of the screen then BitmapField will show only a part of the image that fits into the screen from the top left of the image.

    So you can either resize the accroding to the width of the screen image * height or you can add the image to the screen with scroll effect.

    Concerning

    Bika

  • Take an EncodedImage data

    Is it possible to get the data for the smallest coded image?

    Calling on the EncodedImage GetData and GetData on an image scalled to a smaller return equal size berries.

    Basically, I'm trying to take the 2 MP image captured by the camera, resize it to 480 px wide and throw all the extra data.

    Earl

    Thank you.  I had this problem by converting the scalled down JPEG bitmap and then convert to JPEG.

    Earl

  • Unable to Scan to the computer after downloading macOS Sierra. Is this a software problem?

    How can I scan from HP Envy 4500 to computer after downloading macOS Sierra?

    Hello wdemetris,

    Thanks for asking for scanning helps here in the Apple Support communities. I understand how it is important to have access to your scanner and am happy to offer help for this.

    As a precaution, we always recommend that you have backups to make sure that all your data is safe. You can perform a backup using Time Machine and an external hard drive. Use this article to help make a backup of your Mac: use Time Machine to back up or restore your Mac.

    Then, in accordance with article help: printer and scanner for Sierra, El Capitan, Yosemite, and the Mavericks macOS software, the HP Envy 4500 e-all-in-one is supported for printing and scanning. The drivers must be installed, but if not, if it please go to the App Store and check the updates tab to see if there are updates for HP. If there is, please install.

    If you have only general questions about how to get your updated scanner in place or how to scan pictures, please check out these two articles: macOS Sierra: implement a scanner & macOS Sierra: scan images or documents. If everything is configured correctly and you still have problems scanning, please visit this help article: macOS Sierra: scanning troubleshooting.

    Thanks again and have a great rest of your day.

  • My iPhone 6 installed 10.0.2 stops when it gets to 40% of autonomy.  In addition, it seems to pass power WAY to fast with the new software.  Does anyone else have this problem?

    My iPhone 6 installed 10.0.2 stops when it gets to 40% of autonomy.  In addition, it seems to pass power WAY to fast with the new software.  Does anyone else have this problem?

    Hello brooksm549,
    Thank you for using communities of Apple Support.

    I got your message which, since updating your iPhone 6 to iOS 10.0.2 your iPhone stops when it is 40% and the power to empty very quickly. I understand your concern with the iPhone turn off and drains the battery. I recommend you to review the use of the battery to see what app contributes more to the battery drain. The following article will provide you with steps on how to check the use of the battery:

    On the use of the battery on your iPhone, iPad and iPod touch

    When you know about the soft uses more battery, you can change your settings in order to optimize the battery life:

    Maximize the life of the battery and battery life

    Best regards.

Maybe you are looking for