1. Are you ready for the Galaxy S20? Here is everything we know so far!

Painting a bitmap to a canvas with stretch

Discussion in 'Android Development' started by badkarma, Feb 9, 2011.

  1. badkarma

    badkarma Newbie
    Thread Starter

    Hi all,

    I have looked all around Google and these forums for 'Android' + 'Stretch(ing)' + 'Bitmap' but there appears no solution to my problem.

    I have (lots of) 8x8 pixel images and would like to paint them to the canvas in 16x16 pixl fomat (i.e. double size).

    I have reseached densities etc but this is not what I need.

    I need a function like:

    canvas.drawBitmap(Bitmap, x1, y1, x2, y2);

    So I could then call:

    canvas.drawBitmap(myBitmap, 0, 0, 15, 15);

    ... which will then paint my Bitmap double size (pixels wise!) on the canvas (screen).

    Has anyone got a solution for this? I would be very grateful.

    Many thanks


    1. Download the Forums for Android™ app!



Share This Page