Image bitmap scaleInto

Hi all

I have a code that uses this function:

Bitmap image. scaleInto (int srcLeft, int srcTop, int srcWidth, int srcHeight, Bitmap dst, int dstLeft, int dstTop, int dstWidth, int dstHeight, int filterType)

It works quite well on the simulator of the torch, but when I run it on one of the simulators OS5 seems not to do the resizing & copy.

The code is identical on the two simulators, works great on 6 but not on 5.

Ideas:

Thank you

You will not believe, but this just function doesn't seem to work on OS5.  I wrote my own version of the function and now it works fine.

For all job-here it is:

Tags: BlackBerry Developers

Similar Questions

  • Images bitmap will be not smooth.

    Hello again,

    I'm loading external images and try to get them to smooth out, but for some reason, this isn't the case. I've tried everything I can find on the internet in the last 10 hours or and nothing has worked.

    The code on my movieclip (first image) is:

    var Ldr:Loader = new Loader();

    var UrlR:URLRequest = new URLRequest("myImage.jpg");

    LDR.x = 340

    LDR.y = 0

    addChild (Ldr);

    LDR. Load (UrlR);

    everything works fine to get the image on the stage.

    I have tried many variations of the following (immediately after the code above):

    var myBitmap = new Bitmap (image Bitmap (Ldr.content) .bitmapData, "auto", true);

    OR Bitmap (Ldr.content) .smoothing = true;

    ETC.

    I also tried:

    internship. Quality = StageQuality.BEST;

    on my first frame of the main timeline, but my images were still in staircase

    My pictures are of very high resolution, so I know this isn't a resolution problem. Anyway, they look crappy when they size down too. also, I'm sure that smoothing is the question, because I have a very similar image in the library (details at the same time and a similar resolution, etc.), and it is great when I allow smoothing in the bitmap properties panel.

    Anyone know what is missing in my code?

    Thank you!

    Robin

    AFTER loading is completed, apply your image bitmap and smoothing.

  • BitmapField does not display an image bitmap. In fact, it does not display anything at all...

    My problem is simple and fast. I am probably just a stupid mistake, but the BitmapField component does nothing and does not display the bitmap image. I first tried to display a Bitmap using its setBitmap (bitmap Bitmap) method, which did not work. Then I tried to use it's method setBitmap to the Builder, who did nothing at all no more. Then I tried to use setImage using an image encoded if nothing happened again. Yes, both the encoded image and methods of Bitmap.fromBitmap that make new Bitmap objects and EncodedImage POINTENT to real images in my project folder. So what I am doing wrong, I forget to call a method in needed or what? I use Eclipse with the plugin and I use the Blackberry 9550 Simulator.

    First of all, your use setSpace is incorrect. What you are doing here are to define a space around the bitmap image - in this case, the space is bigger than most of the screens, which will ensure that your bitmap image is not actually on the screen. See the description of the API in the javadocs.

    Second, you SHOULD check the return of getBitmapResource(). If it returns NULL, then the resource was not available. What you're doing here can hide a problem.

  • Zoom on the image Bitmap field

    Good morning to all"

    I want to zoom in on BitmapField. Is it possible to BB?

    TNX your tips.

    What do you mean by 'zoom in '?  If you want to enlarge a bitmap image, you can use EncodedImage.scaleImage32 (as long as you are able to get your image as an EncodedImage data).  Here's an example of utility code I had to scale an image based on its width or height.  Using this as a basis, it should be simple enough to adapt it to your specific needs.  If not, let me know; I have a lot of image processing code.

     public static EncodedImage scaleImageToWidth(EncodedImage encoded, int newWidth) {
            return scaleToFactor(encoded, encoded.getWidth(), newWidth);
        }
    
        public static EncodedImage scaleImageToHeight(EncodedImage encoded, int newHeight) {
            return scaleToFactor(encoded, encoded.getHeight(), newHeight);
        }
    
        public static EncodedImage scaleToFactor(EncodedImage encoded, int curSize, int newSize) {
            int numerator = Fixed32.toFP(curSize);
            int denominator = Fixed32.toFP(newSize);
            int scale = Fixed32.div(numerator, denominator);
    
            return encoded.scaleImage32(scale, scale);
        }
    
  • Image bitmap binary questions

    Good afternoon

    I am trying to convert an image into a Portable Bitmap format in order to to use with a web application that counts as 1 and 0 in the file. When I save the image in Photoshop as a Bitmap (.bmp) and Portable Bitmap (.pbm) and open the file in Notepad to see if it is really binary code, I met:

    "YYYYYYYYYYYYYYYYYYYYYYYYO YYYYYYYYO] YYYYYYYYYYY YYYYYYYYYYYYYYYU ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿo? ÿÿÿÿÿÿÿÿo ÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþ YYYYYYYYYYYYYYYYYYYYYYYYU] YYYYYYYYO YYYYYYYYYYU YYYYYYYYYYYYYYYU ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿu ÿÿÿÿÿÿÿÿo? ÿÿÿÿÿÿÿÿÿÿþ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþ wwwwwwwwwwwwwwwwwwwwwwwwt wwwwwwwwwp 7wwwwwwwwwwv 7wwwwwwwwwwwwwwwv"

    I don't know if I'm doing something wrong or if there is some kind of encryption. Please help me find the ones and zeros.

    Thank you

    I recommend that you download the trial version of Paint Shop Pro and see if that gives you the results you're looking for.

  • move the image bitmap overlay 2 at a time

    I have 2 bitmaps overlapping (one is a card and the other an indicative icon) is a card offline, the question is when I move around the map and move along the map and the icon, it gives me error, the two movement with this code:

    navigationMovement protected boolean (int dx, int dy, int, int time status) {}
    left + = (dx * HORZ_SCROLL_FACTOR);
    Top + = (dy * VERT_SCROLL_FACTOR);

    If (on the left<0) left="">
    If (upper-<0) top="">
    If (left > maxLeft) left = maxLeft;
    If (top > maxTop) top = maxTop;

    invalidate ();

    Returns true;

    Thank you

    This error means usually only one of the arguments you provided was an invalid value.

    The best thing to do is to set a breakpoint and check the values provided to this function.

    My guess is that either top > left or bitmap (xBitmap) .getHeight > .getWidth bitmap (xBitmap).

    E.

  • Image bitmap setARGB

    If I use setARGB on an object Bitmap must match those of the Bitmap was created with the dimensions of the matrix? I have an app where I need to rotate a picture not square. I wrote a function to do that myself, but it fails when you try to call setARGB with the new table.

    You can create a new Bitmap object with the desired size

  • Restore the size of the image bitmap (image) and PPI

    Here's something that I have not found a quick solution after several years of use.

    The scenario is as follows:

    1. you receive a document with embedded images and no access to links original.

    2. the images are resized and proportions have changed. For example, PPI: 85.372 x 71.954 and the scale of the Image (H, V): 84.337%, 100.065%.

    Is there a quick way to change the scale of the image at 100%, 100% or 72 x 72 PPI?

    I always do this by calculating the percentage of that image has be restored by horizontally and vertically for the original report.

    See you soon.

    Mordy Golding provides this method on his Real World Illustrator blog:

    http://rwillustrator.blogspot.com/2008/11/technique-unembedding-images.html

    It gives a detailed description, but basically it's save as PDF, open in Photoshop, choose the option Images.

    Hope this helps

    Mike D.

  • Size of image bitmap/placement on stage

    Hello

    I need to be able to make a bitmap to the stage and make it be centered little matter the size.

    I tried to change the memberNum of a sprite - but that shrinking the bitmap in the size of
    the founding members.

    Any help is greatly appreciated.

    BigDaddy

    After that Exchange you the sprite cast member, set the size of the sprite
    the size of the new Member.

    example of

    Sprite (1) .member = member ("someNewMember")
    Sprite (1) .width = member("someNewMember").width
    Sprite (1) .height = member("someNewMember").height

    BigDaddy wrote:
    > Hi
    >
    > I don't understand your answer.
    >
    > I tried to use a sprite of bitmap with 400 height and width 300, your member number 7.
    > Then I changed the number of members to 19, this bitmap sprite has a width 680 and
    > height 500.
    > My new sprite took on the width and the height of the original - I need to be
    > It's own dimensions.
    >
    > BigDaddy
    >

  • image bitmap field not seized touch event

    Hi all

    I've implemented a customButton class that extends from BitmapField to tuchscreen.

    The CustomField is FOCUSABLE.

    I placed 6 these customButtons in a horizontal field.

    First 3 buttons are getting clicked correctly but the last three are not capture any key event.

    The procedure is the same for all. But still this is happening.

    Can someone tell me why its happening? How can I solve this problem?

    I solved the problem

    the code is shown in the link

    http://supportforums.BlackBerry.com/T5/Java-development/capturing-click-event-of-buttons-oat-right-c...

  • compression of image and convert between Bitmap and byte]

    Hello

    I'm trying to compress an image raw data(byte[]), and here's what I did:

    Bitmap image = Bitmap.createBitmapFromBytes( _raw, 0, -1, 7 );
    Bitmap scaledBitmap = new Bitmap(192, 144);
    image.scaleInto(scaledBitmap, Bitmap.FILTER_BILINEAR, Bitmap.SCALE_TO_FIT);
    

    So now that I have a compressed Bitmap, scaledBitmap and I want the gross data(byte[]) extract from the scaledBitmap. I noticed there is a getRGB565 method, but I don't know how to use it. Can someone give me an example on how to extract the raw data? If it is not possible, is there another way to compress the _raw?

    Thanks in advanc

    I found the solution:

    Bitmap image = Bitmap.createBitmapFromBytes( _raw, 0, -1, 8 );
    
    int newWidth = 192;
    int newHeight = 144;
    
    Bitmap scaledBitmap = new Bitmap(newWidth, newHeight);
    image.scaleInto(scaledBitmap, Bitmap.FILTER_BILINEAR, Bitmap.SCALE_TO_FIT);
    PNGEncodedImage encoder = PNGEncodedImage.encode(scaledBitmap);
    byte[] resizedBytes = encoder.getData();
    
  • Emulator CVS displays bitmap color black and white images

    I use a VBAI2009 inspection on 1454 CVS which uses a camera firewire AVT Guppy F - 036C. This system is on a production machine inspect the product we make. VBAI uses the legacy IMAQ for IEEE 1394 on a CVS not the driver IMAQ-dx cameras. The VBAI script contains several steps function color inspection. To get the AVT camera to display the color, I had to install the files of MAX camera using the Bayer color tab because Bayer settings are not accessible from the driver on the CVS IMAQ. I'm no adjustment of the camera of the VBAI. This configuration works well and has worked for 6 months on the machine of production without any problem.

    Now, I need to edit the VBAI script but can't stop the machine to make the changes and test the program. I captured images bitmap using MAX during the inspection was installed 6 months ago and they stored on my host for just such an occasion. I am using these captured images and the CVS emulator in VBAI to make the changes to the program offline. I performed the inspection under the CVS emulator and the acquisition stage is configured to point to the captured bitmap images using the button Configure Simulation settings. The problem I have is that bitmaps are displayed as black & white in the emulator, even if these are images of color seen with paint. I can't find a way to fix this. Is - this problem as a result of using the parameters of Bayer to create the image color or something else in the emulator? The emulator, no installation of color image treats?

    Any help would be appreciated,

    Mark

    The stages of acquisition camera record video mode information used to acquire images. If you use these steps in emulation mode, it converts the type size and the image to match what has been gained for calibration and processing step use the same type of image. Looks like than the stage thought that the image was mono, even if you got it to be color. I will consider how it could have be saved incorrectly when you use the settings of Bayer. In the short term, you can disable the acquisition stage (don't delete so you do not lose the camera settings saved in step) and use a stage of acquisition of simulation or a new phase in the acquisition of 1394 and won't force the image size/type.

    Hope this helps,

    Brad

  • How to access an image button (bitmap image)?

    Hello

    I have two questions.

    1 .i have over the path navigationClick() method, but always attack don't know, how to get the id of the clicked field?

    2. How can I put a label with this bitmapField?

    Here is my code.

    Image bitmap myBitmap = Bitmap.getBitmapResource ("Order.jpg");
    BitmapField myBitmapField = new BitmapField (myBitmap, BitmapField.FOCUSABLE);
        
                
    Image bitmap deliverBitmap = Bitmap.getBitmapResource ("Deliver.jpg");
    BitmapField deliverBitmapField = new BitmapField (deliverBitmap, BitmapField.FOCUSABLE);

    protected boolean navigationClick (int status, int time)
    {
    System.out.println ("key =" + status);
        
    Returns true;
    }

    No, I mean that you set your variables of the bitmap to the screen, not only in its constructor.

    Focus on the ground = getLeafFieldWithFocus();

    If (focus.equals (bitmapfield1) {;} doStuff () else if...})

  • get the Bitmap Image of the web site or remote location

    Hi, yesterday I asked for some ease of image horizontal scorlling with blackberry. It's work very well. Thank you for all.

    But I could not do my job. What I need, that I have to get the Image from a web site (not in the project of ths) and display it in the BB device. I can do this and I get byte array and show the image using BitmapField. But this installation of scrolling does not work with the bitmap field.

    Is is them possible to get my web site dynamic images of the Bitmap object?

    Here is the code that you sent me.

    // ------------------------------------------

    package com.falseflag.blackberry.recipes;

    Import net.rim.device.api.system.Bitmap;
    Import net.rim.device.api.ui.Graphics;
    Import net.rim.device.api.ui.UiApplication;
    Import net.rim.device.api.ui.component.Dialog;
    Import net.rim.device.api.ui.container.MainScreen;

    class ScrollingImageRecipe extends UiApplication {}

    private class ScrollingImageScreen extends form {}
    private static final int HORZ_SCROLL_FACTOR = 10;
    private static final int VERT_SCROLL_FACTOR = 10;

    Bitmap bitmap;
    int left = 0;
    high int = 0;
    int maxLeft = 0;
    maxTop int = 0;
           
    public ScrollingImageScreen() {}
    bitmap image = Bitmap.getBitmapResource ("test.png");
           
    If (bitmap == null) {}
    UiApplication.getUiApplication () .invokeLater (new Runnable() {}
    public void run() {}
    Dialog.Alert ("Failed to load image");
    System.Exit (0);
    }
    });
    return;
    }
               
    If (bitmap.getWidth () > Graphics.getScreenWidth ()) {}
    maxLeft = bitmap.getWidth () - Graphics.getScreenWidth ();
    }
               
    If (bitmap.getHeight () > Graphics.getScreenHeight ()) {}
    maxTop = bitmap.getHeight () - Graphics.getScreenHeight ();
    }
    }
           
    protected void paint (Graphics graphics) {}
    If (bitmap! = null) {}
    graphics.drawBitmap (0, 0, Graphics.getScreenWidth (), Graphics.getScreenHeight (),
    bitmap, left, top);
    }
    }
           
    protected boolean navigationMovement (int dx, int dy, int, int time status) {}
    left += (dx * HORZ_SCROLL_FACTOR);
    top += (dy * VERT_SCROLL_FACTOR);

    If (on the left< 0)="" left="">
    If (upper-< 0)="" top="">
    If (left > maxLeft) left = maxLeft;
    If (top > maxTop) top = maxTop;

    Invalidate();

    Returns true;
    }
    }

    Public Shared Sub main (String [] args) {}
    ScrollingImageRecipe app = new ScrollingImageRecipe();
    app.enterEventDispatcher ();
    }
       
    {ScrollingImageRecipe()}
    pushScreen (new ScrollingImageScreen());
    }

    }

    //-------------------------------

    Please be so kind to give me a solution for this issue.

    You can use a browserfield to display web content in your application.  Take a look at the browserfielddemo provided with the BlackBerry JDE for example

    If you ask how to connect to a web site, please see the httpdemo.

    This example shows how to create a scrolling image field.

    -Creates a scrolling Image field
    Article number: DB-00681

    http://www.BlackBerry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800505/800345/...

  • Convert Image screenshot of Bitmap file?

    I use code below to take the screenshot of Blackberry.

    public static Bitmap getScreenShot() {}
    Bitmap bitmap;
    image bitmap = new Bitmap (Display.getWidth (), Display.getHeight ());
    Display.screenshot (bitmap);
    try {}
    FileConnection file = (FileConnection)Connector.open("file:///store/home/user/img.bmp");
    {if(!file.) Exists())}
    leader. Create();
    }
    DataOutputStream out = file.openDataOutputStream ();
    out. Write (getBytesFromBitmap ());    Returns the bytes of the bitmap object
    } catch (IOException e) {}
    Generative TODO catch block
    e.printStackTrace ();
    }
    return bmp;
    }

    I want to convert this Bitmap object in a file of any format of file:.bmp/.png/.jpg etc. Is there a way I can achieve this?

    Help, please.

    Thank you.

    to solve this... I was without closing my outputstream...

Maybe you are looking for

  • Satellite L655D - slow Internet connection

    I bought a new laptop because my old Inspiron 1501 has problems. The battery is dead, the R button does not work, the hard drive is 40 GB and the RAM maxed out at 2 GB. A Windows Vista. So anyway my new laptop has 3 GB, more than 200 GB hard disk, Wi

  • Options of fonts and multiplayer games/chat MSN emoticons

    I have recently reinstalled, with the support of Microsoft support email, my OS (Vista Home Premium 34 bit), etc., the applications and drivers. Since then, I was unable to access the option of police while playing TexasHoldEm MSN. The steps proposed

  • Acer Aspire 15 E5 - 575 G-76YK E?

    Recently, the Acer Aspire E 15 E5 - 575 G-53VG (http://www.amazon.com/Acer-Aspire-NVIDIA-Windows-E5-575G-53VG/dp/B01DT4A2R4) has been on sale on Amazon. There must be a variant of i7 (with all the same features in addition to the chip Skylake) and th

  • Understanding shared RAM

    Hello HP suggests I buy a SHARED RAM module to 125 Dollars based on the module of my laptop code: 641369-001. This HP product is the only module marketed as SHARED. My laptop is a module of ADATA 4 GB at $ 45 and after performing a global search on t

  • Live Photo Gallery Photo Viewer background color

    Hello to my favorite Windows, Forum I just installed the latest Windows Live Photo Gallery version 2009 (Build 14.0.8064.206). I don't write to complain, but I have to tell you that I had to install this because the past years would crash and tell me