How to use graphics.drawBitmap

I have the 10 * 15 bitmap.

If I want to draw a Bitmap occuping full displaywidth and the height of the image, I can do using this image.

I tried to use this, but I can't get the single image to the required width. Method is

graphics.drawBitmap (10,20,340,image.getHeight (), image, 0, 0);

Is it possible

Respect of

Rakesh shankar.

rcmaniac25 is right. You need first to scale your bitmap to the desired width. You would like to use the following method to the scale of your bitmap in width:

Bitmap resizeByWidth(Bitmap originalBitmap, int w) {
 double ratio = (double) originalBitmap.getWidth() / (double) w;
 int h = round((double) originalBitmap.getHeight() / ratio);

 Bitmap scaledBitmap = new Bitmap(w, h);
 originalBitmap.scaleInto(scaledBitmap, Bitmap.FILTER_BILINEAR);
 return scaledBitmap;
}

int round(double d) {
 return (int) Math.ceil(d);
}

Tags: BlackBerry Developers

Similar Questions

  • How to use graphics files

    I want to join Adobe stock to take advantage of computer graphics models.

    Do I need special software to edit the text and images on the templates? Like some of the patterns I want to plug my own text and images. I have photoshop CC.

    Thanks for your reply.

    Check the file type.

    If it's a .ai file you Illustrator to edit.

  • How to use switchable graphics?

    Where can I find how to use switchable graphics?

    I hope I'll be able to switch to fixed graphics using my ATI Radeon 6490 M and not Intel's integrated graphics. Yes, it will consume more energy, but my laptop would work.

    Hello

    Please check with this topic:

    http://h20000.www2.HP.com/bizsupport/TechSupport/document.jsp?lang=en&cc=us&ObjectID=c02731962&JumpID=reg_R1002_USEN

    Kind regards.

  • HP Slimline S5 - 1120D: how to use VGA internal?

    Hello

    I am currently using Windows Update to 10 anniversary and my screen turns off after a few minutes I have to play the game. It says "VGA: No Signal.

    How to use the other port VGA on my PC? Currently, they are covered with plastic and has "do not remove" on the subject.

    Coming from my PC with NVIDIA GT 520 graphics card, but I think that this graphics card is broken now.

    Can I remove my VGA card and use the other ports? Or do I need to change some settings?

    Kind regards
    Delegation of Dian

    Hello:

    Before physically uninstall the graphics card from nvidia, uninstall it in Device Manager.

    Go to Device Manager, expand the category of device of graphics cards.

    Make a right-click on the graphics card from Nvidia that there are listed and choose uninstall.  Also check the uninstalling the driver box.

    Do not restart the PC you are prompted.

    Go to control panel > programs and uninstall all software listed Nvidia.

    Once this is done, turn off the PC, remove the graphics card.

    Remove the covers of video ports, plug your monitor DVI or VGA port (your choice) and turn on the PC.

    The switch must be automatic and I think W10 will find and install the Intel HD graphics driver.

  • Satellite A100-692 - how to reduce graphic memory?

    Hello!
    I'm looking for information how to reduce graphic memory. I have Satellite A100-692, PSAA9E-09900QGR and install 1024Mo RAM but 512 MB is dedicated to graphics memory. Because of this I have 512 MB of RAM in real-time only.
    I would change it. Should be spend of only 256 MB memory graphics. I checked the BIOS (ver. 2.00) and graphic drivers and anywhere is option for memory graphic change.

    Please help how do.

    Hello

    You described your situation, but this seems very strange.
    As far as I know, the laptop uses a 128 MB ATI MOBILITY RADEON X 1400 graphics card and this isn't a memory sheared graphics card!
    This card uses own 128 MB and must share main memory!

    I put t know why you suggested that you have only 512 MB.
    How did you test it?

  • Graphics output using graphics data

    Hi all

    I have a signal in the range of 0 to 1000 mV that I am aquring using my device to acquisition of data usb or over a period of time.

    Let's say I'll connect the DAQ Assistant for the waveform table and display the signal on the chart.

    The graph will plot v vs time and after about 60 seconds of acquisition (for example), now I want to analyze the data on the chart "visually", using my eyes, then choose a few points (x, y) graph so to use for calculations in my vi.

    Is it possible in labview to click on points on the graph using my mouse and then take the value 'x' (because I'm only interested in the information of the x-axis) which represents the relative time in my case and then undergo calculations using this value?

    I'm new to labview so forgive me if this function is already there, but I don't know how to use it.

    Thanks in advance

    Concerning

    Shady

    LV 2010 version attached.

    I suggest to read the help on graphics and check out a few examples (help > find examples and search for table or graph).

    Graphics will store only a finite amount of data (defined by the length of history, default = 1024) but require very little work on your part. You give it just a scalar (or a table if you want to display the serveral tracks) and it will be updated to the x axis, scroll, etc. Because it loses data, I guess that's why NOR did not bother with the sliders, but I don't know.

    With a Simple graphic, you will need to feed the WHOLE track, so if do you it point by point, you should have to add each value in a table, feed this table updated the graph. A bit more complicated for a novice like you, but not that hard. Yet once, check the examples. But you could show the sliders (the visible elements > cursor legend) and read the mouse XY coordinates without programming.

    Good luck!

  • How to create graphic tabs in front of Panel?

    How to create graphic tabs in front of Panel? How can I use tabbed indicators in the front panel?

    Drop a control tab on the front.

    Move a chart on a tab.  You can add multiple pages of tabs by clicking on the tabs.

  • How to use bluetooth BRAVEN BRV-1 on Windows 7 Ultimate speakers

    Nice day

    I would like to request assistance on how to use my speakers BRAVEN BRV-1 on my desktop PC. The specs of my PC are as follows:

    • Name of the OS and Version - Microsoft Windows 7 Ultimate 6.1.7600 Build 7600 32-bit
    • Processor - Interl (R) Core i3 CPU [email protected], 2933 Mhz, 2 Lossnay, 4 logical processors
    • RAM - 4.00 GB
    • Graphics - AMD Radeon HD 6800 Series
    • Motherboard - ECS H55H-M

    Currently, the device is visible in the "devices and printers" (see attachment pic1) but no sound is produced. It was connected via a bluetooth dongle that I recently bought at a hardware store. While they inspected the volume icon in the lower right of the task bar, the speaker does not appear in the list (see attachment Note2). I would appreciate any suggestions really, I've tried a few methods have been proposed by different forums/sites without success.

    pic1

    Pic2

    Thank you very much.

    Hello

    Welcome to the Microsoft community. I apologize for the inconvenience.

    I suggest you to see link below and check if it helps.

    Tips for solving common audio problems

    http://Windows.Microsoft.com/en-us/Windows/tips-fixing-common-sound-problems#tips-fixing-common-sound-problems=Windows-7

    Let us know the status.

    Kind regards

    Guru Kiran

  • How to use the Gif image in Blackberry android runtime

    Hello

    I deploy an android app in blackberry 10. All that it works well in blackberry 10 except gif image. In app android gif image is displayed using the AnimationDrawable from the link

    http://developer.Android.com/reference/Android/graphics/drawable/AnimationDrawable.html

    So how to use blackberry 10.

    Is it possible to use GIFs in blackberry 10.

    Please suggest.

    Thanks in advance.

    Hello

    I found the solution.

    He needs of the gifDecoder and gifDecoderView classes and following code extract

    Mode, mode = inflate.inflate (R.layout.layout_gspot, null);
    GIF GifDecoderView = view.findViewById (R.id.gifView) (GifDecoderView);
    gif.setGifImageFromAssets ("abc.gif");

    and following the layout code

    <>
    Android:ID="@+id/gifView".
    Android: layout_width = "120dp."
    Android: layout_height = "120dp."
    Android:layout_alignLeft="@+id/textView1".
    Android: layout_centerVertical = "true".
    Android:background="@Android:color/transparent" / >

  • How to use my PC as a digital video recorder (Windows 7, 64-bit)

    Microsoft community,

    Issues related to the:

    I want to use my new PC as a digital video recorder, but I have trouble to know how to do. I'm trying to figure out how to get Windows media Center to record shows to my HD TV Box Charter? I know that I need two things to help and support. ((TV tuner) 1 and the TV signal source) 2.

    (1) first for the TV tuner: I guess that I need something like this... http://www.Walmart.com/IP/Hauppauge-PCTV-801E-se-HD-Pro-TV-tuner/15125571

    (2) what is a TV signal source? Is it just my TV provider for example Charter TV, live TV etc.

    My computer specs:

    Windows 7 64 bit

    ASUS Essentio Series Desktop i5

    AMD Radeon 7770 graphic card

    TV provider:

    Charter Communications

    Any help would be great,

    -TJ

    Hi hotmishchief,

    Please ask questions!

    If I understand correctly, you want to know how to use the computer like a TV. To answer your questions, you will need a tuner TV and a TV Signal Source which is the cable from the TV Signal provider to connect with the TV Tuner.

    Check out these links that will guide you in setting up your computer as a DVR.

    Demo: set up a TV tuner and a digital video recorder with Windows Media Center (Applicable to Windows 7)

    For more information, see the links provided.

    Set up a TV signal in Windows Media Center

    What should I know before adding TV tuners to use with Windows Media Center?

    TV signals that are supported by Windows Media Center

    Let us know if this information useful. I'd be happy to help you further.

    Thank you.

  • my knee is locking when I used it to play nfs most wanted. How to use without blocking?

    my knee is locking when I used it to play nfs most wanted. How to use without blocking? and how to find the size of the graphics card to my lapto?

    Hello


    To know the exact size of the graphics card, you can refer to the following steps:

    (a) click Start, type run, press enter

    (b) type dxdiag in the run, press enter

    (c) it opens the DirectX Diagnostic tool

    (d) go to the screen to know the exact memory of the graphics card.

        

    NFS Most Wanted issue:

    Method 1:  Make sure that the computer meets the minimum system requirements to run the game.

    Method 2: Direct X: update

    Which version of DirectX is on your computer?

    http://Windows.Microsoft.com/en-us/Windows7/which-version-of-DirectX-is-on-your-computer

    Download and install the latest version of DirectX from here:

    http://www.Microsoft.com/en-US/Download/details.aspx?ID=35

    Method 3: To uninstall and reinstall graphics card drivers.

    See the following steps:

    (a) click Start, right click on computer.

    (b) click on properties, click on Device Manager

    (c) Expand, graphics card, right click on the card option, click on uninstall

    (e) now go to your computer/device manufacturer site, download the updated drivers and install them.

    Reference:

    Updated a hardware driver that is not working properly:

    http://Windows.Microsoft.com/en-us/Windows7/update-a-driver-for-hardware-that-isn ' t-work correctly

  • How to use a FOR LOOP to create multiple forms?

    I use Adobe animate CC (formerly Flash Professional CC) and I am trying to adjust the following snippet so that it creates several rectangles:

    var form = createjs new. Form (new createjs. Graphics ().beginFill("#FF0000").drawRect (5,5,100,100));

    this.addChild (shape);

    I then set it and put it in a loop I thought work in the reproduction of the form. The following code creates only a rectangle well?

    for (i = 0; i < 10; i ++) {}

    var i is new createjs. Form (new createjs. Graphics ().beginFill("#FF0000").drawRect (5,5,30,30));

    this.addChild (i);

    Move so that they do not lie on the other

    This.x += 50;

    }

    I think that the problem is how you use your iterator variable. In your loop, at the first start, i is equal to 0, then you immediately replace 0 with an instance of the Shape class, which means when he tries to loop again, I is not less than 10. They can't, because it is now a shape, not a whole number.

    Try this inside the loop:

    newshape var = new createjs. Form (new createjs. Graphics ().beginFill("#FF0000").drawRect (5,5,30,30));

    newshape.x += 50;

    this.addChild (newshape);

  • How to use PSD as Nav bar

    I had a cool graphic river navigation bar and I'd love to use it, but I can't understand what is the best way to use it.  It is a psd document and I can't hide all the bars, I don't want to, but I don't know what to do on the graph of hovering on each of the individual sections.  Is it possible to import it into a smart object or something, or that I have to cut to the top of each section?

    Thanks for your help, you guys save me all the time

    You are welcome!

    I use an older version of DW (CS3) and I have always used the DW javascript code provided:

    MM_swapImgRestore() MM_findObj(n, d) MM_swapImage() MM_preloadImages()

    Here is a link to a tutorial on how to use them.

    However, there may be a newer Dreamweaver how to make rollovers right now.

    ~ codeDawg

  • How to use paragraph styles?

    Can someone explain how to use paragraph Styles? OMG! This is so difficult for me to kiss - I can't seem to understand how to create a paragraph style in a document, in the first place, then I don't seem to be able to apply it to the rest of paragraphs in the document.  Whenever I have try this I lose the track and then I lose patience!

    I do appreciate this forum and hope someone can clarify this issue for me, I am eternally grateful. I'm trying to gather some my illustrations and story in a booklet for children and I need to get out to publishers (fingers crossed!) until I forget why I started to be a student in graphic design and Illustration in the first place

    Thank you!

    aganess wrote:

    Can someone explain how to use paragraph Styles? OMG! This is so difficult for me to kiss - I can't seem to understand how to create a paragraph style in a document, in the first place, then I don't seem to be able to apply it to the rest of paragraphs in the document.  Whenever I have try this I lose the track and then I lose patience!

    I do appreciate this forum and hope someone can clarify this issue for me, I am eternally grateful. I'm trying to gather some my illustrations and story in a booklet for children and I need to get out to publishers (fingers crossed!) until I forget why I started to be a student in graphic design and Illustration in the first place

    Thank you!

    I've been there. It was a long time ago, but I still remember the confusion and despair.

    First, know that you will survive and ask what was the hang up. If you are a special person, do you promise never to forget what was the hang up, then you can help others when it is time to pay back the community.

    Think about how things work without paragraph styles. When you want a paragraph to look a certain way, regardless of the software you have used to work with text, you select ("highlight") some text and look for ways to style it (check its appearance, or 'attributes' or 'features' or 'features'.) You choose a font (Helvetica, Times, etc.) weight ("BOLD", extra bold, light), a color of text, an angle (italic, Roman), the space between the lines ("leading,") space between paragraphs (space before, space after,) and so on. Without named styles, you must select each property in a menu or a list when the text is selected. The next time that you want this same paragraph look, you can recall everything you did and repeat with newly selected text, or you can copy and paste one that looks, then change the text inside.

    However, it does take long to realize that he has to be a way to save these settings and pull them up and slap them on the other selections, with a few clicks and make sure that you don't forget to do something. Creation and registration of collection of a paragraph of the property settings are called "define a style." Software for manipulation of more modern text can save paragraph styles that apply to full paragraphs, and they can also save character styles, which apply to parts of the text in a paragraph. A paragraph of normal text can be used a style called 'body '. You can select a bunch of miscellaneously style paragraphs and apply the body style for them with a single click on the paragraph styles list.

    If you decide that you would like the body to look different style, you can redefine, and all paragraphs in the active document using the body style change to show the look of the new definition.

    In a body paragraph, you can have same bold italic bold text and italictext and so on. You can always select text in a paragraph and find a menu that offers characters bold or italic in the selected text. But you can also create a character for each of these apparitions style and apply them to music. As for paragraph styles, character styles are more controllable and more useful than simply highlight and apply a property. If, you use a character style that applies "BOLD", you can change its character style definition and all the places it is used in a document will show the change.

    Here is an example which shows the usefulness of the styles of characters named:

    According to the standard style for writing guides that have been developed before computers, scientific names, the words of the foreign language in a host as the English language, the titles of the documents, movies and poems and a few other things are supposed to be italicized. With character styles, you can create and apply styles of characters for each category of text in italics. In this forum, * sapiens, The Pentagon Papers and Gone With the Wind, all look the same, but with character styles, styles, named 'scientificName', 'bookTitle', and 'filmTitle', can distinguish between texts in italics. Sometimes, you gotta be able to treat these things differently, and styles is a way to keep them organized.

    Most writing tools can create a style named for the existing sample. So, if you have customized a paragraph for your body text, you can use InDesign to set the body of the paragraph in the example chosen style.

    Google search for terms like 'InDesign create the paragraph of the selection style,' "InDesign redefine style', 'Create a character style, InDesign' and"InDesign tutorial character and paragraph styles."

    HTH

    Kind regards

    Peter

    _______________________

    Peter gold

    Know-how ProServices

  • JQuery - how to use

    I have a simple piece of jquery code (zoom image) I want to stick it on my page.  I've never used jquery before so do not know where to paste.  Is it possible to do without having to learn how to use wisely?  I'm new on this and cannot learn everything at once!  Or is there a jquery for beginners complete starter tutorial of some type that I could have a go?  Thank you!

    Streetwitch wrote:

    I made a start with

    PHP as one of my sites need a mailing list - I have not started to learn the

    language that I find adequate Dreamweaver features in this

    step and I use SSI for menus for awhile.  So I wonder now

    If I need to learn to write PHP, or continue as I am and to make a start on

    jQuery instead, while continuing to blitz CSS.  Or both?  The other thing

    I have on my list to learn is Flash (also an Illustrator, but since I'm)

    reasonably competent with Photoshop I'm not considered too much of a

    problem with this...).

    If you rely on Dreamweaver to generate the PHP code for you, you will be severely limited in what you can achieve. Dreamweaver server behaviors offer only very basic features. You really need to learn PHP to customize the code to your own needs.

    Learn Flash is also quite a steep hill to climb, although you will find may be easier if you have a good knowledge in graphic design. Despite this, people who do really amazing things with Flash are experts in ActionScript, yet another script and programming language to learn.

    Have a wide range of skills is good, but doesn't end up being a Jack of all trades and master of none.

Maybe you are looking for