Questions tagged [drawbitmap]
68 questions
2
votes
0 answers
Button extension: the canvas in onDraw method doesn't draw Bitmap only on Gingerbread
Method:
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
if(icon!=null)
canvas.drawBitmap(icon, iconBounds, buttonBounds, null);
}
public void setIcon(int res) {
this.icon =…

INDAPP
- 91
- 6
1
vote
1 answer
drawBitmap takes too long
Hello here is the code:
URL uri = new URL(photoUrl);
URLConnection connection = uri.openConnection();
Log.i(TAG, "connecting...");
connection.connect();
Log.i(TAG, "connected");
…

ihucos
- 1,821
- 3
- 19
- 30
1
vote
1 answer
how i can fix droped image change its postion over bitmap and save bitmap
I am developing android application drag and drop sticker and resize sticker after capturing image. I have problem with sticker position is change after saving image.it is move almost 20 dp down after saving.
i have use…

Dens
- 125
- 11
1
vote
2 answers
What does 'Paint' parameter do in android.graphics.Canvas.drawBitmap()?
I have a question about drawBitmap.
android.graphics.Canvas.drawBitmap(Bitmap bitmap, float left, float top, Paint paint)
What does that Paint paint? For example I have a picture.jpg and I make
Bitmap bitmap =…

randomUser56789
- 936
- 2
- 13
- 32
1
vote
4 answers
Android: FrameLayout subclass does not draw
This is, what works:
a) FrameLayout with two ImageViews in main.xml

decades
- 827
- 17
- 25
1
vote
1 answer
Android: canvas.drawBitmap performance issue
I had an issue lately Android: Rotation of image around the center which was solved by the help of Unconn.
However, it turns out, that the solution - as well as it is working - does have a much worse performance, than the RotateAnimation stuff.
What…

decades
- 827
- 17
- 25
1
vote
0 answers
Canvas.DrawBitmap holds reference to bitmap
In the following function:
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
canvas.drawBitmap( bmp ,0,0,null);
ViewCompat.postOnAnimationDelayed( this, new Runnable() {
@Override
public void run() {
…

user7091237
- 11
- 1
1
vote
1 answer
draw image in diagonal position android
I am a newbie here and I'd like to ask about Bitmaps. Is the image below possible?
I just want a bitmap image to display diagonally or in any position other than horizontal. I'm using SurfaceView but for the mean time while testing this, I'm just…

DeadShot French
- 21
- 1
1
vote
0 answers
Android - ColorMatrixColorFilter vs setpixel?
I want to implement convert a Bitmap from color to gray.
First I using two for-loop to set each pixel with (R+G+B)/3,
After using ColorMatrixColorFilter with ColorMatrix.setSaturation(),
the performance is better than setpixel.
But why the setpixel…

user2458433
- 11
- 3
1
vote
1 answer
method drawBitmap change behavior since last samsung update?
I have an application on Google Play published 4 or 5 months ago. The images had shown fine until the last samsung update.
In one part of the code I'm using the following function:
void android.graphics.Canvas.drawBitmap (Bitmap bitmap, Rect src,…

Pegastacus
- 31
- 5
1
vote
2 answers
canvas.drawLine() not appearing on bitmap
I have tried so many methods but still my code refuses to simply draw a line on the canvas. Each of the attempts I have commented out either crash the program or won't display the line. I am really struggling to get my head around how to do this, I…

logicalfox
- 83
- 2
- 13
1
vote
1 answer
Android - Canvas.drawBitmap doesn't work correctly on certain devices
I have a problem with my android app which draws graphs of functions on a plane. To do this I use a custom View. The user can pan the coordinate system with touch. In the onDraw method, the coordinate system and the labels are drawn directly on the…

user2073589
- 23
- 4
1
vote
4 answers
android placing bitmap in middle
I am designing a drawing app where user can import image from gallery and then scale up or down to fit the screen width or height. so that user can draw onto the imported picture, using the below code.
I am extending View, named DrawView. The…

pearmak
- 4,979
- 15
- 64
- 122
1
vote
1 answer
Android - float parameters in drawBitmap
I used this function in my Android program:
public void drawBitmap (Bitmap bitmap, float left, float top, Paint paint)
However, I want to draw my bitmap not in the position 0 x 0, but in the position 10 x 10 (in PIXELS). The drawBitmap function,…

Bitcoin Cash - ADA enthusiast
- 11,457
- 16
- 83
- 103
0
votes
1 answer
android positioning a drawBitmap that uses rect
I searched through this site to find out how to rotate a image back and forth and came up with my own with the help of other post on this site, it works great, the only problem is now I got it working so it rotates back and forth the way I like it,…

user870286
- 67
- 2
- 12