Show image of suitable size.

Hello friends,

I am new to the blackberry development. I want to show an image that I get from the http connection.

My problem is that I want to show this image format. Means a width and height of the image I'm so it will show great. I wan to correct this image size.

means that if the server return any image size I want to show in a format. Is it possible?

I use a bitmap file to show this image

 public static BitmapField Bfimage=new BitmapField()     {        protected void invalidate()          {            super.invalidate();         }         protected void paint(Graphics g)         {             g.clear();            int _x_shift = 10;            g.drawRect(_x_shift, 0, getBitmapWidth()+_x_shift, getBitmapHeight()+3);            super.paint(g);         }

     };

if(image_data==1) {
    InputStream in_i = conn.openInputStream();
       final byte[] output=IOUtilities.streamToBytes(in_i);
       in_i.close();       EncodedImage image= EncodedImage.createEncodedImage(output, 0,output.length);       int currentWidthFixed32 = Fixed32.toFP(image.getWidth()); int currentHeightFixed32 = Fixed32.toFP(image.getHeight());   int width = image.getWidth() /5;// here i chage the width.       int height = image.getHeight() /5;
    int requiredWidthFixed32 = Fixed32.toFP(width);
    int requiredHeightFixed32 = Fixed32.toFP(height);
    int scaleXFixed32 = Fixed32.div(currentWidthFixed32, requiredWidthFixed32);
    int scaleYFixed32 = Fixed32.div(currentHeightFixed32, requiredHeightFixed32);
    image = image.scaleImage32(scaleXFixed32, scaleYFixed32);
    Bfimage.setImage(image);
    image_data=0;
  }

How to fix the size of the image? This Bfimage object, I add in the optimization of resources. Tel me what should I do to fix the prob?

Thank you

Ajay

Hello

What is the minimal operating system to use for your application?

If his 5.0 then why don't you use the scaleinto method?

http://www.BlackBerry.com/developers/docs/6.0.0api/net/RIM/Device/API/System/bitmap.html#scaleInto (net.rim.device.api.system.Bitmap, int)

Tags: BlackBerry Developers

Similar Questions

  • Photo size under > image > image shows 3.1 GB size.  However save as tiff saying more 4.00 GB will not limit?

    Photo size under > image > image shows 3.1 GB size.  However save as tiff saying more 4.00 GB will not limit?  It makes no sense at all.  What is the problem?

    The image size dialog box includes no additional layers.

    So if you have more than one layer, it will probably be more than 4 GB. In this case, you will need to save as psb.

  • PSC 1610 began to print images of small size

    When you try to print a picture this morning the printed image is greatly reduced in size, about 2 "x 3". To the best of my knowledge, we did nothing else by stopping last night. This e-machine, running windows XP and printer led major for two years. Microsoft automatically installs updates from time to time, there may be something they did.

    I tried to solve the problems/correct the problem, but being a novice in computer science I quickly overwhelmed my meagre understanding of this new stuff. Check other posts leads me to believe that it is a software problem, maybe a setting has been changed. This understanding is the limit of my knowledge on what might be wrong or how to fix this problem.

    Any help, I hope step by step, would be greatly appreciated.

    To all those who may have this problem in the future, here's the solution. Pull the bottom of the file tab in the upper left corner of the screen. Select "Print preview", it should show the image size reduced to a preview page. Now select "Page Setup" in the file tab drop-down. Mine indicated a 30% scale, change the scale to 100%, click 'OK '. Now look 'Print Preview', let's see a picture in full size on the preview page and the printer will print the image in full size. PROBLEM SOLVED! I don't know how the level of 30% was chosen, I did not this, something in the program Firefox or recent upgrade must have reset to 30%.

  • Images of full size in the browser window?

    Hello


    I have problems trying to replicate a combination of things that I saw on a website (build in Adobe Muse). Web site - www.tatianapavlova.me


    I'm quite new to dream so please bear with me if it's all relatively simple substance. I looked through a few hours of YouTube videos and not managed to get close to an answer to my problem.

    I want to be able to reproduce the scalability of the slideshow, but also have the opportunity to see 'portfolio' of the Web site as soon as I start to scroll from the slide show, regardless of the size, I did my browser window.

    I've included a few screen grabs to illustrate my point a little better that I probably explained above. In IMG1 you will see that my browser window is about half the height of my screen, but as soon as I start scrolling down, I can see the whites of the portfolio section. IMG2 my browser window is almost the size of my screen, but I can still see only the background of slide show of images until I scroll down.

    I guess it's a kind of widget that needs to be added to the page to allow the slide show to do this, however as stated I don't know who he is.

    Once again, my apologies if this is relatively easy, I am new to the program.

    All the advice/help is welcome and appreciated

    Thank you!

    IMG1.jpgIMG2.jpg

    Check out this video for more details:

    https://www.YouTube.com/watch?v=gZI_K1TXqOM

    Thank you

    Sanjit

  • working capital with images of different sizes in the table

    Hello, I have a table with images of different size.  I want to use a bearing on each Panel, but my image is not the same size.  When I roll over the image the first image disappears.  Any suggestions?  I use CS5.5 Show map to the bottom.of page.

    Kappa Delta Pi

    Thank you

    Also I have never been able to use the "Preview in browser" globe icon  I don't seem to be, any suggestions on how to add this?

    A very simple solution is to make a second image that contains the image superimposed on the map. You must have 4 total images for this (all images have the same size):

    1. the plan with no photos

    2 - 4. The card with a unique image on the desired region (i.e., 3 additional images).

    In your access points, you exchange the entire map with the map of the desired region.

  • Determine the best image to overlay size to use

    Hi people

    So I'm working with Premiere Pro CS6 make a video montage of a Minister of my friends. Over pieces of the video, I was just overlap citations and whatnot. I would like to achieve consistency in always making sure that they are included on the same location on the screen. So I thought that a simple way to do it would be to determine the pixel size of the sequence. And the report of properties folder that my sequence is 1440 x 1080. I thought I could just create and manipulate images of this exact size and drop them to the exact location.

    The problem is that when I create an image of this size and drop it in PP, right monitor shows the image with areas of pillarboxed video on each side of it. The image certainly seems to be on-site with the altitude, but the width is off and I don't know why?

    So what is the explanation here? Certainly it seems that properties of the sequence are at odds with what this area right monitor in PP.

    PP.png

    Thank you... Rick

    You can specify the PAIR of titles that you create:

    .

    Basically, HD anamorphic uses rectangular pixels

    in order to crush the 16: 9 image in a setting of 4 x 3.

    First use-squishes' back pixels in 16 x 9.

    If your film the layer source is 1440 x 1080 (1.333).

    you are right in a sequence of 1440 x 1080 (1.333)...

    you just need to create the corresponding aspect / securities.

    If you use another application to create your .png images

    I'd be inclined to 1920 x 1080 (1.0).

    This will suit your anamorphic sequence regardless of the BY.

  • Not scanned image the same size as the original

    Scanned images of a doc of legal size seem to be reproduced on images of legal size. When printing, the print space is 60% or the printed page, while the original doc was so full page. Any thoughts on how to fix this?

    The default action is to just scan the document in without letting you look at your scan settings. I would say "the Interface of the Native Scanner see the" setting under "Custom Scan".  File > create a PDF from a Scanner > custom scan

    Click on the radio button to select "native interface of the scanner Show", then OK to confirm.

    When you click Scan in custom scan, you can then preview, set the size and then analyze using your own scanner software.

  • How always show Images in Thunderbird for MacBook Pro

    I sent you an e-mail with an article on how to load remote images in your thunderbird. Please see the link below:
    http://www.ashout.com/always-show-images-or-remote-content-in-Thunderbird/
    This may work for a PC, but it does not work on my MacBook Pro. The 1st step is to go back to 'Options' and 'Options '. My Thunderbird software (this is the latest Version) does not have the file 'Options '. Can you translate PC instructions to "MACOS" instructions for me to always display images on my incoming emails?

    My Thunderbird software (this is the latest Version) doesn't have the 'Options '.

    It's 'Preferences' for Mac OS.

  • Safari on my MacBook Pro retina 9.0.3 15-inch Version 10.11.3 do not show images on some Internet sites. They appear for a fraction of a second then disappear with a question mark in the Center. The same sites work fine on Chrome and Firefox.

    Safari on my MacBook Pro retina 9.0.3 15-inch Version 10.11.3 do not show images on some Internet sites. They appear for a fraction of a second then disappear with a question mark in the Center. The same sites work fine on Chrome and Firefox.

    I suggest you only begin by taking the measures recommended in this support article.

  • the option 'Show images' appeared at the top of some emails. My only option now is to show the e-mail on a web page. I would like to recover the original option.

    display images in windows mail

    Until recently, the option 'Show images' appeared at the top of some emails. My only option now is to show the e-mail on a web page. I would like to recover the original option.

    The problem is that IE9 has been installed by Windows Update and its not not watch 'bar info'.  See www.oehelp.com/OETips.aspx#15 for workarounds.

    Steve

  • Photos app stopped to show images of shared folders

    Hello

    My apps IdeaPad and EasyCrop save pictures in the shared documents folder. But the latest OS update 1.0.5 in my PlayBook does not show all pictures stored in shared folders.

    I tried to put in other shared folders (shared/photos) etc., but the photos app does not display all images saved from third-party applications.

    However, when Browse dialog opens to load the image, it displays all pictures stored in the shared folders.

    Everyone experienced up to now?

    If you have a PlayBook with last update, can you please try EasyCrop or any other free image utility to save an image and try to view in photos app?

    Thank you

    chall3ng3r / /.

    Okay, I finally found what was wrong.

    The updated OS 1.0.5.2342 have some changes in the mapped file APIs.

    File.documentsDirectory and File.desktopDirectory now points to the same folder "documents" on real PlayBook device.

    The last API docs v1.0.1 is incorrect. File.desktopDirectory is assumed to point to the "root" of work-sharing files.

    My applications used File.documentsDirectory to save the images. But the app photos in previous versions was showing images in the documents folder as well. In the last update, it stopped showing images in the documents folder.

    Now I've just updated my application to use File.userDirectory which now points to the root of the working folder. And now I'm able to save to the shared folder / photos.

    Save the actions/pictures folder now shows in the photos app.

    I'm now confused if I should download new versions of my applications to use this mapping has changed or I should wait for RIM fix this bad mapping.

    chall3ng3r / /.

  • How batch crop images of different sizes?

    Hey Fellow photoshoppers

    I was wondering how I can make an action or a script that can crop images to different sizes?

    Whenever I'm trying to make an action to do this he made mistakes in the images and it comes out black and that part of the image will be visible.

    I would really appreciate anyones help. If anyone can build me a custom action or script please pm me

    Try instead the image size command command crop to reduce the size of the image, then save the Action

  • I need to create my images twice the size in pixels on a Retina display?

    Hello!

    I stole this question to this thread: adobe photoshop - should I create my images twice the size in pixels on a retina display?-Graphic Design Stac...

    I read it over and over again, and I'm still confused. Maybe someone here would be able to explain it better?

    I don't have a computer screen Retina, but if I had one, I wonder how I would design my sites...

    I understand the concept of double the size of the images to view the retina when designing on a computer that has a standard screen.

    But according to the thread mentioned above, the same rule applies when designing on a computer screen Retina.

    How can this be?

    It's so confusing!

    Thanks again!

    Chris.

    As web design is concerned, there no difference in the design of the image on one retina screen, another that they can appear a little less sharp compared to a standard screen. You really just need to focus on the pixel dimensions.

    David

    Creative muse

  • Script to place an image in different sizes of paper!

    Script to place an image in documentdifferent sizes. Hello all, greetings to all. There is a possibility hereget a nice script that reposition an imageinserted in the document to make it encacheperfectly in sizedocument independent edges? With this feature, I'll be able to create severaltypes of frameworks, effects with mascaras etc... and sopower gives a nice streamlined in my work.

    Exemplo:

    1458482592 - YouTube video

    Please try this version.

    #target photoshop;
    app.bringToFront();
    
    main();
    function main(){
    if(!documents.length) return;
    try{
    var doc = app.activeDocument;
    app.displayDialogs = DialogModes.NO;
    var strtRulerUnits = app.preferences.rulerUnits;
    var strtTypeUnits = app.preferences.typeUnits;
    app.preferences.rulerUnits = Units.PIXELS;
    app.preferences.typeUnits = TypeUnits.PIXELS;
    var aLay = doc.activeLayer;
    doc.activeLayer = aLay;
    if(aLay.isBackgroundLayer) return;
    if (aLay.kind == LayerKind.SMARTOBJECT){
    aLay.resize(100 ,100,AnchorPosition.MIDDLECENTER);
    }
    var docWidth = activeDocument.width.value;
    var docHeight = activeDocument.height.value;
    var LB = activeDocument.activeLayer.bounds;
    var LHeight = LB[3].value - LB[1].value;
    var LWidth = LB[2].value - LB[0].value;
    var percentageHeight = ((docHeight/LHeight)*100);
    var percentageWidth = ((docWidth/LWidth)*100);
    activeDocument.activeLayer.resize(percentageWidth,percentageHeight,AnchorPosition.MIDDLECENTER);
    align( 'AdRg');
    align( 'AdBt');
    }catch(e){
    }
    finally{
    app.preferences.rulerUnits = strtRulerUnits;
    app.preferences.typeUnits = strtTypeUnits;
    }
    };
    function align(method) {
    activeDocument.selection.selectAll();
       var desc = new ActionDescriptor();
               var ref = new ActionReference();
               ref.putEnumerated( charIDToTypeID( "Lyr " ), charIDToTypeID( "Ordn" ), charIDToTypeID( "Trgt" ) );
           desc.putReference( charIDToTypeID( "null" ), ref );
           desc.putEnumerated( charIDToTypeID( "Usng" ), charIDToTypeID( "ADSt" ), charIDToTypeID( method ) );
        try{
       executeAction( charIDToTypeID( "Algn" ), desc, DialogModes.NO );
       }catch(e){}
       activeDocument.selection.deselect();
    }; 
    
  • In photoshop CS5 (bridge) I could select all the images and their size still before turning them into JPEG files. I can't find a way to do it in CC

    In photoshop CS5 (bridge) I could select all the images and their size still before turning them into JPEG files. I can't find a way to do it in CC

    Hi Tanuj.

    I actually understand it. Not the best user friendly system. Where as before (CS5), I just had to go to crop tool and choose the dimensions and the inches now it in the window. Just really complicated for nothing.

    Thanks anyway Tanuj

    Melanie

Maybe you are looking for