In my code I need create a Bitmap using double values. It´s important use the correct value.
I´m using:
Bitmap bmp = Bitmap.createBitmap(int, int, Bitmap.Config.ARGB_8888);
... When i would need something like:
Bitmap bmp = Bitmap.createBitmap(double, double, Bitmap.Config.ARGB_8888);
Everything I've trying to make the conversion ( possible ? ) Only returns the initial value or integer
How I can use double values when creating the bitmap?
Try this, convert double to int:
Using (int) casts the double into an int
Perhaps I misunderstand the question, but bitmaps are rasters of whole pixels. You can't have fractions of pixels, so you can only have integer numbers of rows and columns in the parameters for createBitmap.
Having said that, you can rescale how the bitmap is drawn using float scale factors applied via Matrix drawBitmap methods, e.g.
Canvas.drawBitmap(Bitmap bitmap, Matrix matrix, Paint paint)
However, when it comes to rendering this on screen, it will again draw only whole pixels, so you still don't get fractional pixels displayed.