Questions tagged [drawbitmap]

68 questions
0
votes
2 answers

Display image in the same spot on multiple screens | Android

I'm creating a game that is full screen. I'm using an image for the background and I'm drawing images on top of it. The background image looks great in all the devices, but I can't draw the overlay images in the same spot on all devices. For example…
Dave
  • 324
  • 1
  • 4
  • 10
0
votes
0 answers

High dpi image drawing performance issues on canvas (android)

I download a image with following properties using AsyncTask and then resize and down sample using the logic in this url. In addition image loaded in ARGB_8888 config to in memory (image is a jpg file). When I segment this image to small images and…
pats
  • 1,273
  • 2
  • 20
  • 43
0
votes
1 answer

Display content over image on hover/touch in Android Studio

I placed some circle images in my layout and I would like to display content when the user hover on them or touch an image. I tried to search on google, but I found nothing useful about this topic. I would like to display (i.e. on test1 image) a…
Marcus Barnet
  • 2,083
  • 6
  • 28
  • 36
0
votes
0 answers

SurfaceView drawBitmap take too long, the longest time consuming 200ms

I am using Surface to show bitmap from JNI, to show a video, this is my code : SurfaceHolder holder = surfaceView.getHolder(); while(true) { if(getBitmap() == null) { continue; } …
0
votes
1 answer

Android drawing scaled Bitmap without OutOfMemory error

I need scale my bitmap to screenSizeAverage / 3. When I do it like this, I have sometimes OutOfMemory error. screenWidth = size.x; screenHeight = size.y; screenSizeAverage = (screenWidth + screenHeight) / 2; Bitmap b2 =…
0
votes
1 answer

Coordinates of type "float"

Sorry my bad english. I tried to draw something on the screen with drawText(), drawRect() and drawBitmap(). WHY coordinates must be of the "float"? They should be of type "int"?
user3106572
  • 101
  • 1
  • 1
  • 3
0
votes
1 answer

Why the background bitMap is not fullScreen?

I have 2 question. First why the background is not fullscreen but I have this space bottom? Second why this strange delay of ship in the space when the background is not drawn? package com.caccagame; import android.content.Context; import…
0
votes
1 answer

Canvas.DrawBitmap unexpected result(BUG or strange behaviour) Xamarin Android

So i have an problem with method of Canvas.DrawBitmap(), that draws unexpected result. Lets see my example: Source image I have two cases(just for test): I want to draw Red rectangle from 0,0 and give for him size 1/4 of image,also i want to…
XTL
  • 1,452
  • 2
  • 17
  • 40
0
votes
0 answers

Canvas set left, top, translate and rotate bitmap

I want to set left and top Bitmap coordinates then apply Y translation and rotation on this Bitmap but I can't... the result is not what I expected. Here my code : point[0] = centerX-bitmapWidth/2; point[1] = centerY; point[2] =…
Florian Mac Langlade
  • 1,863
  • 7
  • 28
  • 57
0
votes
2 answers

Performance difference between drawBitmap and createScaledBitmap

In order to support different size of screen resolutions, I programmatically scale the bitmaps in my android game application using SurfaceView. I performed it by using drawBitmap(Bitmap bitmap, Rect src, RectF dst, Paint paint) method. I saw a…
adba
  • 477
  • 9
  • 25
0
votes
1 answer

Canvas.drawBitmap Showing Black

Why is my first drawbitmap not working but my second an third ones are? All I get is a black screen for the first one but the others draw fine. FULL_COMPOSITE_SIZE = new Size(1920, 1080); PREVIEW_COMPOSITE_SIZE = new Size(640, 360); …
w9jds
  • 877
  • 6
  • 17
0
votes
1 answer

canvas drawBitmap doesnot display camera preview

I am not able to display the camera preview on my android screen using the canvas.drawbitmap. The screen is all black, I verified the drawtext method is working. Please let me know what I am doing wrong !! class CameraView extends SurfaceView…
0
votes
0 answers

Canvas.drawBitmap performance on Android 4.3

I have two Samsung S4, one is 4.2.2, the other 4.3. I am running the same game, which is drawn on SurfaceView. On 4.2.2 drawing takes about 30ms, while on 4.3 almost 100ms. Drawing is performed from the other thread. I have checked, that the problem…
0
votes
0 answers

not able to draw image on canvas of surface view in Android

I am drawing an image using drawbitmap method on a canvas of surface view which is an overlay surface on my camera preview.The image drawn is a portion of captured image to guide the user to capture next image with a proper overlap.Now when I am…
Fayaz Ali
  • 61
  • 1
  • 6
0
votes
2 answers

Android Live Wallpaper with canvas.drawBitmap is way to slow

I just started android programming this week and am curently working on a Live Wallpaper. I have 2 Images, the Background Image (720x1280 png) and a slidebar (2276x290 png) that slides from right to left in an endles loop. my Problem is I only get…