How to dynamically set the width of the bitmap as mobile size and adjust accordingly the photo.

I have the bitmap image. Now, I want the bitmap to the screen but its size should be as mobile width and adjust the picture accordingly. For the former I enlarge it should look like small small mobile screen.

My code but its not working.

public static BitmapField getHeader() throws NullPointerException {}
Bitmap b = Bitmap.getBitmapResource("img/logo.jpg");
return (new BitmapField (b, Field.FIELD_HCENTER) {})
Protected Sub layout (int width, int height) {}
setExtent (365, 80);
}
});
}

You will need to put the image yourself to match the dimensions you need.

Watch Bitmap.scaleInto)

If you have transparent images, then watch this:

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

Tags: BlackBerry Developers

Similar Questions

  • How to dynamically set the height and width of the image?

    I'm trying to dynamically set the size of an image of "spacer", but this doesn't seem to work.

    "< img src ="Images/SpacerYellow.gif"width ="5"height =" < cfoutput query = "Img" > #Img.Jan # < / cfoutput > "/ >

    When I insert the source of the page and the view, it is the HTML < img src = "images/SpacerYellow.gif" width = "5" height = "745014" / > why so the stil teeny tiny image? "

    A better question would be, why are you trying to display an image of space which is more than 745 000 pixels high? The HTML code looks OK, so you may be panicking the browser.

    From the point of view best practices, if you only want to display a value in the first row of a query, you can reference using the #MyQueryName.myColumn #. You need not include the query within the tag.

  • How to dynamically set the filter IR APEX of the value of a radio button column?

    Hello

    I built a simple APEX 4.2 IR report that includes column, namely "Source_Data" and a separate user to input radio button namly "P33_SOURCE_DATA" with two possible values in 'X' or 'Y '.

    I would like the report filter source_data = 'X' or source_data = "Y" is applied, after each time the user clicks on the radio button P33_SOURCE_DATA. "

    So my question is, how to set the value of the IR filter using the value of P33_SOURCE_DATA to the dynamic action and javascript?

    Thanks in advance.

    Concerning

    Susanna

    In this case, you can pull an onchange dynamic action on the radio, or at the click of a button.

    This dynamic action update your IR region

    And your IR region would have an appropriate where clause, with "Page to go" set on your radio.

  • How to dynamically set the containers/component

    Hello

    I want to put on if containers of other condition.i.e condition if - set another container2 container1. How can I do? Any reference?

    Hey there,

    Because the way this all happens at the start of your application, simply use the add method that Simon bound for you in his first response.  Don't worry the method replace because that is only for all the containers that are already visible (or is already a child) within your root container (or whichever it is).

        // Just as an example from QSettings...
        if (mySettings.value("firstcontainer", 0) == 1) {
            myFirstContainer = Container::create()
                .layout(StackLayout::create())            .objectName("firstContainer")
                .vertical(VerticalAlignment::Center);
            // Add anything else for your first Container...
            // Then finally, you add it to your main or root
            // container with the add() function. Hopefully your
            // mainContainer is either a class member variable or
            // declared and initialized somewhere above this        // if-else statement.
            mainContainer->add(myFirstContainer);
        } else {
            mySecondContainer = Container::create()
                .layout(StackLayout::create())            .objectName("secondContainer")
                .vertical(VerticalAlignment::Center);
            // Add anything else for your second Container...
            mainContainer->add(mySecondContainer);
        }
    

    However, if somehow somewhere else in your application, you want to change the containers because the user has changed the value QSettings, you would replace it...

    if (user_wants_firstContainer) {    replaceC = mainContainer->findChild("secondContainer");    myCurrentContainer = myFirstContainer;} else {    replaceC = mainContainer->findChild("firstContainer");    myCurrentContainer = mySecondContainer;}
    
    if (replaceC) {
        replaceIndex = mainContainer->indexOf((Control*) replaceC);
    
        if (replaceIndex >= 0) {
            replaceC = (Container*) mainContainer->replace(replaceIndex, myCurrentContainer);
            // If you want to, you can just delete the replaced container here
            delete replaceC;
        }}
    
  • How to outsource the JNDI name (dynamically set the JNDI name)

    Hello

    In the adapters such as ftp, database, must specify the jndi name. This binds the adapter to a particular jndi name. It's certainly better that connect the adapter directly to the physical resource, I was wondering if it is possible to have still more flexibililty-setting the jndi name dynamically.

    Basically my requirement is to develop a web service that reads a file from a FTP location. I know that I can outsource the file name and directory, but I wonder how to dynamically set the ftp location.

    http://Darwin-it.blogspot.com/2008/03/configuration-of-FTP-synchronous-get.html gives the answer if I want to set the host name, portname, user id and password.

    But I want to configure the adapter got FTP and then use this JNDI name in my service. Is this possible... I am using SOA 10.1.3.3

    Kind regards
    Amit

    I've sent.

    -Rigault.

  • Dynamically set the Station process model

    I noticed in an existing position, to dynamically set the active process template, you use the Engine.StationOptions.StationModelSequenceFilePath property. (Search for "How do I dynamically (at runtime) the models?").

    But where do you put the statement that sets it?

    Thank you

    Oh yes I forgot to say in my last post

    You can make a file of sequence requires a specific process template.  So that no matter what the model of the station is on the sequence of file always use the designated model provide you.

    With the sequence file that requires that the new process model open go to Edition > properties file in sequence.  Under the Advanced tab, under model Options, select require a specific model.  You will then see a box of template file.  Navigate to your new template and select it.  Click OK to exit.

    Now, whenever this sequence file is opened, it will use this process template regardless of what is the model of the station.

    Hope this helps,

  • How to dynamically change the graphic style css?

    What is the right method to dynamically replace the graphic style of JavaFx 2.2 in the code? I modified the example in the tutorial below with or without loading the css file. So far, I am unable to replace the style from the code. My goal is to dynamically set the width of each line. We use Java with Eclipse on Windows 7 (64-bit) 7_51. The CSS generated in the code below works when it is in the file. There must be a better way than to write a new file and read it, right?

          String title = "Chart Title";
          stage.setTitle("Stage Title");
          final LogAxis xAxis = new NumberAxis();
          final NumberAxis yAxis = new NumberAxis();
          final LineChart<Number, Number> chart = new LineChart<>(xAxis, yAxis);
          chart.setTitle(title);
          chart.setLegendVisible(false);
          chart.setCreateSymbols(false);
          xAxis.setLabel("x-axis");
          yAxis.setLabel("y-axis");
    
          // each bar is a line from x,0 to x,y
          int width = 24; // pixels
          for (int i = 0; i < ydata.length; i++)
          {
             String css = "";
             // TODO: dynamically calculate unique width for each "bar"
             final XYChart.Series data = new XYChart.Series();
             data.setName("Series" + (i + 1));
             data.getData().add(new XYChart.Data(xdata[i], 0.0f));
             data.getData().add(new XYChart.Data(xdata[i], ydata[i]));
             chart.getData().add(data);
             // Dynamically set style instead of reading from file
             // Assign each "bar" data series a color and line width
             css += ".chart-series-line{ -fx-stroke: red; -fx-stroke-width: ";
             css += width;
             css += "px; }\n";
             data.getNode().setStyle(css);
             System.out.println("node style: " + data.getNode().getStyle());
             System.out.println("node style class: " + data.getNode().getStyleClass());
             width *= 3; // TODO: replace this with dynamic calculation of width
          } // end for
    
          final Scene scene = new Scene(chart, 800, 600);
          scene.getStylesheets().add("Chart.css");
          System.out.println("Scene stylesheet: " + scene.getStylesheets());
          System.out.println("chart style: " + chart.getStyle());
          System.out.println("chart style class: " + chart.getStyleClass());
          System.out.println("chart style sheet: " + chart.getStylesheets());
          stage.setScene(scene);
          stage.show();
    

    The Node #setStyle (String) method only supports the statements, not the rule full css. The setStyle call with '.chart-series-line {-fx-stroke...} '. "should give an error in the parser. Something like "whereas IDENT.

    You might find the line you want in the series. If series.getNode () is a form (as it will be for a line chart), you can just get the node in a form and call the setStrokeWidth() directly.

  • dynamically set the role name

    Hello

    I set 4 roles in the application. In the navigation of workflow, I created a notification. How can I dynamically set the name property of role of the Notification message so that as soon as the order is delivered to this notification, all users in this role Gets the notification message?

    Thank you.

    Hello

    Define an attribute that contains the value of one of the four defined roles. Then create an activity (with a specific function) who will choose the role and assigning to the attribute.

    In the notification, give the value of the performer or performing as the name of the attribute.

    This will solve your purpose.

    Kind regards
    Kumar.

  • How can I set the default download locations

    How can I set the default download locations?

    You can watch here:

    • Tools > Options > general: downloads
  • How can I set the time axis on my waveform table to show run time that is to say whenever I start the program I should have 0 as the starting point

    How can I set the time axis on my waveform table to show run time that is to say whenever I start the program I should have 0 as the starting point. I've been messing around with the without success. I'm under Labview 2012.

    Thank you!

    Townes wrote:

    I can't understand what you mean. I have no formal training with labview. It took me a long time to write the simple program that I joined. Any guidance would be greatly appreciated!

    Its pretty normal for a beginner to take the time to write code. Right-click the map of waveform > Create > property node > historical data, you will get a property node, keep this at the beginning of the code and create a constant. You can also go to the VI properties and > run and select "clear indicators when it is called.

    I recommend you to go through the basic materials of LabVIEW which will give you an understanding on the basics of bases/components of LabVIEW.

  • How can I set the camera at 1/125, F11, ISO 100?

    Hello

    Please, someone tell me how can I set my Canon Rebel T5 at 1/125, F11 and ISO 100?

    I tried a lot of things with no success... I can always change 2 settings, but never a 3rd.

    Please help me!

    Thanks in advance

    If the mode dial is set to "M", then you should be able to set one of these three values for everything you want.

  • How can I set the default font size and type for the outgoing Hotmail mail?

    How can I set the default font size and type for the outgoing Hotmail mail?

    Hi Dale,

    What is the email client do you use?

    Outlook can be configured per - start Outlook-> Tools-> Options-> mail-> fixed Format and fonts... Select the font and size you need... Click ok on all screens.

    I hope this helps.

  • How do you set the time and date on fax for hp officejet 4622

    How do you set the date and time on the fax for hp officejet head 4622

    Hi Chrisharrison23,

    Date and time should be under configuration tools or fax setting in the printer control panel.

    OfficeJet 4620:

    1. click on the key icon on the control panel of the printer

    2. go to tools

    3 scroll to the date and time

    I would like to know if you are able to locate the setting?

    Officejet 4622: Set the date and time

     
  • Sleep Timer Pavillion DV 7 - How do you set the timer for a different time setting?

    Sleep Timer Pavillion DV 7 - How do you set the timer for a different time setting?

    Hello Pidcock,

    Welcome to the HP Forums, I hope you enjoy your experience! To help you get the most out of the Forums of HP, I would like to draw your attention to the Guide of the Forums HP first time here? Learn how to publish and more.

    I understand that you want to change on your computer sleep timer. I'll be happy to answer that question for you. Now you have not specified what operating system you are using, so I guess it's the same operating system provided with your computer (Windows 7). I will provide you the HP support document: Management of power (Windows 7 and Vista) Options, which will guide you in how to set the power of your laptop. Just in case you have upgraded to Windows 8 I am also including the HP Support document: Manage the power (Windows 8) Options. This document will guide you through the same steps in Windows 8.

    I hope that I have answered your question to your satisfaction. Thanks for posting this question on the Forums of HP. Have a great day!

  • How can I set the format of Windows Media Center at 16:10 in other than the full screen?

    How can I set the format of Windows Media Center in Vista at 16:10 in other than the full screen? I use a screen as secondary display 1680x1050px.

    Hello, YPOC

    It is not possible to change the proportions for Media Center in windowed mode.

    The aspect ratio has been changed in Windows 7 and uses a format screen mode to windowed.

Maybe you are looking for