scaling of bitmap

HII all I want to change my image of transparent background 100 * 100 in 80 * 80 with transparent background.  When the

bitmap. Scale (new bitmap (), Bitmap.lancoz);

How to make transparent background as a black background...

but I want not transparent as original image...

using the search help.
http://supportforums.BlackBerry.com/T5/Java-development/resizing-transparent-bitmaps/Ta-p/703239

Tags: BlackBerry Developers

Similar Questions

  • scaling of bitmap problems

    Hi, I'm doing my compatible application on all phones, and I came to a roadblock.

    -the sNormButton parameters are just an experiment to see if it works

    -the normal parameters of the image are 40 x 20 cm I think

    -everything works perfectly before putting in the code of scaling

    -at the moment is to find a null pointer exception when I trigger the image

    Here is my code on the screen:

    Bitmap SNormButton = new Bitmap (10.5);

    .......

    public mainUIScreen()
    {
    Super();
    ......

    If ((Display.GetWidth () == 320) & (Display.getHeight () == 240))
    {
    A.newGame.scaleInto (sNormButton, Bitmap.FILTER_BILINEAR);
    }

    .....

    newGameBut = new BitmapButtonField (A.newGame, A.newGameUp);
    newGameBut.setChangeListener (this);

    I'm new to the thing scaled so all words of advice are greatly appreciated, thank you!

    Is this for 5.0 and above?

    If so, use this class for scaling: http://supportforums.blackberry.com/t5/Java-Development/Resizing-Transparent-Bitmaps/ta-p/703239 it is clean and works with images that have transparent backgrounds (which the BB SDK does not work).

  • Scaling of Bitmaps embedded in Illustrator files.

    Hello

    At the moment, if I'm files provided with built-in Bitmaps (or related) I find the source file, rebuild the image and the parent to the rest of the work, if I want it intensify.

    I can't just step up in Illustrator which makes things too big for AE work with.

    Then

    I was wondering if there was a way to gain access to Illustrator, scaling in EI.

    For example, within a 1024 x 576 image, there is a small bitmap picture.

    In Illustrator, the original bitmap has been reduced to 12%

    I want to zoom in on that part of the image

    If I resized the picture upwards in artificial intelligence, he referred to the original bitmap, so I can resize it back up to 100%

    But if it's at 1024 x 576 AE can't do.

    Continuous dither treats the whole things as vector of original size.

    I can't do just one big file AS I would now have a px AI 10240 x 5760 file that would give me errors of memory.

    (because always the AE will not only rendered what is in the window, but must do the whole layer. Did someone nothing real now at Adobe?)

    Maybe some PDF files would work?

    Is focused on working on a workflow better

    designers still use bitmap (and bitmap effects!) images in artificial intelligence and think that I can zoom in on them.

    Even at 100% weird flickering errors occur with bitmaps in files so I have used to reuse and parents anyway.

    Nope. Would be nice, but can't be doen ATM. And a simple PDF file is useless, either because this can actually worse by flattening of the things that could be the vector into bitmap data or cut out pictures in separate tiles...

    Mylenium

  • Scaling background Bitmap, 9900 vs 9700

    App looks on the 9900, but of course, the 9700 has a different screen and my bitmaps were created to adapt to the 9900. I checked the other threads, but all they advise to make is to use the method. scaleInto(), who does not work for me, as shown:

    Bitmap bgfirstscreen = Bitmap.getBitmapResource("peerreview2.jpg");
                Bitmap bgfirstscreenScaled = new Bitmap(Display.getWidth(),Display.getHeight());
                bgfirstscreen.scaleInto(bgfirstscreenScaled, Bitmap.FILTER_LANCZOS);
                Background background = BackgroundFactory
                        .createBitmapBackground(bgfirstscreen);
    

    Is this all that generally must be done for the bitmap on the scale? It is used as a background image for my application screen.

    Hi vingilot

    Try this.

        public static Bitmap getScaledBitmapImage(String imagename,int wd,int ht)
        {
            EncodedImage image = EncodedImage.getEncodedImageResource(imagename);
            if(image.getWidth()==wd && image.getHeight()==ht)
                    return image.getBitmap();
            int currentWidthFixed32 = Fixed32.toFP(image.getWidth());
            int currentHeightFixed32 = Fixed32.toFP(image.getHeight());
            int width = wd;
            if(width == -1)
                width=image.getWidth();
            int height = ht;
            if(height == -1)
                height=image.getHeight();
            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);
            return image.getBitmap();
        }
    

    Thank you

    Pawan

  • Scaling of Bitmaps on BB 4.6?

    Hi all

    Take a look at the following knowledge base article:

    Rotate and scale of bitmaps

    Works on BB4.2 and later versions.

  • Question about image scaling height

    Hi all

    I know that there are a ton of posts on this topic, but I have not really found one that is clear on the problem I encounter.

    Basically I have a PNG image that I want to change so that the width of the image corresponds to the width of the screen.  So, I want the height of the image to be adjusted automatically in order to preserve the proportions of the image.  Currently, I am doing this:

    Bitmap b = Bitmap.getBitmapResource(image);
    
    Bitmap scaled = new Bitmap(Display.getWidth(), ???);
    b.scaleInto(scaled, Bitmap.FILTER_BILINEAR, Bitmap.SCALE_TO_FIT);
    
    BitmapField bf = new BitmapField(scaled);
    

    But with this method, I have to set the height of the sized image.  This is not good, as I don't know what should be the height after the image has been resized (and kept proportions).

    Anyone know how I can determine the correct height of the image?

    Thank you.

    If you can get the height and width of the image, then use the ratios.

    UX = initial width, OH is original height, NW is the new width, NH = new height.

    (NW * OH) / OW = NH

  • the scale of a bitmap

    I'm scaling a bitmap image and the great works, the thing is that when one tries to show by using the function sprite.graphics.beginBitmapFill (bitmapdata, null, false, false) market not work, what and do is the following.

    bitmap.scaleX = value;

    bitmap.scaleY = value;

    It works perfectly

    var container: Sprite = new Sprite();

    container.addChild (bitmap)

    work in this way does not work

    var container: Sprite = new Sprite();

    container.graphics.beginBitmapFill (bitmap.bitmapdata, null, false, false);

    Anyone know why in the second case, the bitmap dosen't appear to be to scale;

    The bitmapData does not change when scaling, only its rendering on the screen.

  • gradient color in JDE 4.5

    I use Jde 4.5. I want to fill a rectangle with a gradient color effect rounded edge. I know it can be done in 4.6 above using the base class. Is it possible to do the same thing in 4.5 also

    4.5, you don't exactly "set background".  You paint using drawTexturedPath (drawBitmap that draws a rectangle, but you want a rounded, so drawTexturedPath is suitable).  For more information on how to create the correct path and types of points for a rounded rectangle, look here;

    Code of blackBerry to a rectangle rounded with gradient fill

    This article, however, uses the net.rim.device.api.ui.decor methods, which are not available prior to 4.6. You need to replace it with their drawShadedFilledPath with your drawTexturedPath.  DrawTexturedPath settings should be as follows:

    xPts, yPts, pointTypes - remove the above article

    offsets - null (once again, as in the article)

    xOrigin, yOrigin - 0, 0

    DUX, dvx, duy, dvy - Fixed32.toFP (1), 0, 0, Fixed32.toFP (1) respectively (you do not rotate or scaling the bitmap, are you?  Hell, maybe you are - if you use fields of different heights.  Then look at the parameter dvy)

    Bitmap - any Bitmap that you generate using suggestion of Hithredin.

    Good luck!

  • Look at pictures of press pdf low resolution

    Hey,.

    I wrote a pdf of press of an Indesign file made up of photography. He was wonderful as usual. But I imported the same content for a resizing and wrote a new pdf press and photo of the pdf part looks like very low resolution. I re-imported the photos and tried again. But now I am at a loss. Someone help please?

    As you find it, a lot depends on how you create the PDF file. I guess it isn't with the option to export in ID, Acrobat. When you change the size on a bitmap, a change of resolution in PDF format can cause a lot of problems because of the way the original bitmap can be sampled and put in the new resolution. Always a danger when playing with scaling of bitmaps (why vector graphics are preferred where appropriate - of course, not for photos and others). I suspect that all goes back to the sample which is forced. In the future, you might want to to scale the chart in an appropriate program (perhaps PhotoShop) to obtain the desired size and resolution and use in the presentation of the ID, not just a copy, paste, scale. Graphics programs are properly designed scaling a bitmap.

  • Bitmap scaling problem

    I have a simple yet unusual problem... I can't scale a bitmap despite the use of scaleinto class. BTW, I use the BB Torch Simulator.

    My code is as follows:

    Create background bitmap

    Image bitmap bmpBkg = Bitmap.getBitmapResource ("sunlight2.png");

    Bitmap scaling

    Scaledbitmap bitmap =new Bitmap (Display.getWidth (),Display.getHeight ());

    bmpBkg.scaleInto (scaledbitmap, Bitmap.FILTER_BILINEAR);

    The problem is that even after the operation of scaleinto the height and width of the bmpBkg remain the same...?

    Can someone help me with this please?

    Thank you.

    According to me, Miss me something here:

    After:

    bmpBkg.scaleInto (scaledbitmap, Bitmap.FILTER_BILINEAR);

    isn't the Bitmap scaling in scaledbitmap rather than bmpBkg?

  • Implement the bitmap scaling as a backdrop for MainScree

    Newbie here. Well, I know that there's much out there on what I just spent the largest part of this holiday weekend trying to achieve. Here's what I'm trying to do:

    1. I have a bitmap png file that is large enough to accommodate the larger size of the screen.

    2. I need the title bar on a screen.

    3 I need bitmap scaling down to adjust the device existing rest area non-defilement as a background.

    4 I am on OS 5.0 or higher (am NOT interested by implementations of 4.x)

    5. I would like to use the setBackground (BackgroundFactory things if possible.

    First thing, I've tried:

    1. I can't scale carried out with the help of a routine I found in positions that scales an image coded. It seems to work very well, but it takes as parameters Display.getWidth and Display.GetHeight and the height will be turned off because it includes the height of the title bar.

    2. I can pass the bitmap scaling the setBackground (... well BackgroundFactory of things.

    The problem is that the lower part of the image is cropped by what seems to be at the height of the title bar. So I went then on a safari in trying to find a way to determine the height of the title bar. Was able to get the height by substituting the method sublayout as one of the positions. That's nice, but the sublayout does not draw after the manufacturer of the screen which is where I would need to adjust the scale value. I also tried the override of the method of painting (both on-screen and in a clever separate VerticalFieldManager (thanks to BB_DUDE).

    I'm puzzled not to mention frustrated as you can guess. Surely this issue was properly resolved for 5.0 installation? I know I'm a newbie, but I am at a loss to continue. I've seen all the posts that just say 'the search will give you an answer. " I searched for two days! What I don't understand is why the background don't lie not in the title bar? (It's below everything else!). I understand the definition of a new value for money approach, but I still couldn't it either works. The implementation of the missions I've tried always have cropped down image. There must be something obvious that I'm on. It can't just be this hard! I am at the point to forget the title bar and build my own that will sit on top of the background

    Any help would be appreciated! (Yes, I saw the screen explained as well).

    Well, after dinner, drinks and meditation I have revisted the questions. Here's my situation:

    My first implementation was:

    this.getMainManager () .setBackground (BackgroundFactory.createBitmapBackgroundUtilities.GetBackgroundImage));

    where Utilities.GetBackgroundImage () is my method of support of:

    CImage EncodedImage = EncodedImage.getEncodedImageResource ("bottomlogobackground.png");

    EncodedImage sImage = Utilities.SizeImage (CImage,Display.getWidth (),Display.getHeight ());

    Return sImage.getBitmap ();

    I think that my mistakes to be:

    a. the encoded image and image logical size is extracted from some forum posts. I miss-interpreted that the scale must take place before the call to the method BitmapFactory.createdBitmapBackground ().

    (b) "control" me was not recognizing that the BackgroundFactory.createBitmapBackground () method has an overload to allow not only the alignments of XY, but the 3rd parameter to indicate the appropriate size! DOH!

    My successful implementation is:

    Bitmap Imagearriereplan = Bitmap.getBitmapResource ("bottomlogobackground.png");

    this.getMainManager () .setBackground (BackgroundFactory.createBitmapBackground (backgroundBitmap, Background.POSITION_X_LEFT, Background.POSITION_Y_TOP, Background.REPEAT_SCALE_TO_FIT));

    No need to do any scaling before the call so I can eliminate my routines of support for 'Utilities '. It seems to work very well. In addition, all this is done against the Manager of vertical not with default scrolling field, i.e. I don't have to create a subordinate value.

    If anyone knows the faults of the above, let me know. It seems to work correctly. I'll be making additional GUI development now (probably I will have others not of fake beginner!)

    Thanks for the ear...

  • Controls not destructive bitmap scaling in the FW

    Hi everyone, I was doing research if the new FireWorks CS3 handles transformations of scale - as does Indesign, non-destructive.

    The problem: when you place a bitmap in FW and resize it, pixel data are retired or interpolated (upwards or downwards), and increase of additional refinements of scaling the image degradation. (Photoshop is that there are much too). On the other hand, Indesign will scale only a preview or a proxy of the image and updates the display bitmap in the source file. Therefore, no data is lost when the design changes.

    The goal is to be able to prototype and create a presentation with maximum freedom. Thoughts?

    Alex, great suggestion - I had not thought of that. I've only experimented with it... beautiful! At first, I noticed the absence of the possibility to crop the symbol (edit--> selected bitmap harvest) directly in order to have multiple instances with different croppings... but then the workaround is just to create a mask for each instance.

    I think my problem is solved...

    Quote:
    Select the bitmap into a graphic symbol.

  • Bitmaps disappear when scaled

    Issue of Flash CS3/Flash Player 9

    I imported bitmaps 29 in my library (gifs, each a 1728 x 1152, range in size from 4 to 14 Ko, in each case the vast majority of the image is transparent).

    I add each one to the step in the following way:

    var img1Data = new img1 (1728,1152);

    var img1Map = new Bitmap (img1Data);

    containerMC.addChild (img1Map); MovieClip to which all bitmaps are added

    If I set scaleX and scaleY of the containerMC 1,.75,.5 ou.25, bitmaps don't appear.  However, when I scale to a different amount,.6 ou.8, for example, the first six added bitmaps appear not.  I changed around the order of the bitmaps, and he always seems to be the top six who are not displayed.

    It seems not serious if I have the container on the scale or scale each bitmap individually; the result is the same.

    Any ideas as to why this is happening and how can I avoid it?  Thanks for your help!

    kglad - where your bitmaps imported graphics or YOU just generated those?

    I wonder if this is a continuation of the problem magical mysterious table-aliasing of high quality?

    Back in the day, there is a limit of 10 images with transparency, which could be correctly smoothed by the Flash rendering engine. Obviously, there is a hardcoded length 10 table which held the references and when you have more the rest disappeared. I think that they have improved this number in Flash 9, but not unlimited.

    Try to add this line to your code:

    internship. Quality = StageQuality.Low

    The low setting requires Flash no anti-aliasing stuff and so they should not have this problem. Of course they will seem not so hot. But if they become visible, then we will know it is probably related to a change in this old question.

    Otherwise it might be something else, but heck if I know.

  • Torch: OpenVG will increase the speed in real time for the scaling\rotating image?

    Hello!

    I have such a problem. I need to view the satellite map (not vectored) with the possibility of scaling on in real time. Map is a bitmap either 1500 x 1500.

    I'm doing the scaling that requires 480 * 360 for operations return the second part of the map on a defined scale, but it is not enough - it is slow to make good zoom in real time.

    Maybe someone knows is it possible to increase the speed by using OpenVG? (OpenGL is not supported in the torch)

    Thank you for your attention.

    Realization of OpenVG for play ~ 1500px x 1500px images, rotation & them staggering realtime works pretty fast.

    So if someone needs of fast image processing to use OpenVG

  • Select the Bitmap

    I know this is a vague question but could someone try to explain the steps involved in the creation of a selection on a bitmap? (similar to the in Photoshop selection tool). I'm not looking for any code I was wondering what is involved. Thank you.

    OK, it's much more complex.

    For the moment let's ignore touch screens.

    So, basically, you are going to have to display the Bitmap, and then, when the focus is on this bitmap, display a kind of cursor/pointer.  You need to replace the painting and this match draw in front of your Bitmap image.

    This slider will have to meet the navigationMovement.  The user must be able to "click" to select an area, or maybe to do the standard "drag" to select a rectangular area.  Once you have this area (you know where it is because you are viewing the cursor), you use getARGB on the Bitmap image, get rough ints, convert this back to a Bitmap, scaling it.

    Make sense?

Maybe you are looking for