android-canvas Questions

2

Solved

I need to draw a rounded square, something like drawRoundRect, but only the outline. something like this. this image is drawn by hand, as I said I need it to look like drawRoundRect but without ou...

4

Solved

background i have a master bitmap that i need to draw on it other bitmaps. the master bitmap has some semi-transparent pixels (pixels with variant values for the alpha channel) , so that the othe...
Comprehend asked 9/7, 2013 at 15:27

3

Solved

So I use Canvas.drawText to draw some string on a Canvas. The issue is that I want to draw a rectangle before it so that the text appears centred onto the rectangle. But I hit a real problem. The s...
Fukien asked 11/6, 2011 at 17:35

5

Solved

This is how I draw Bitmap on Canvas in my Android app: canvas.save(); canvas.scale(scale, scale, x, y); canvas.drawBitmap(bitmap, x, y, null); canvas.restore(); However the Bitmap is not scaled ...
Rooke asked 27/11, 2010 at 21:48

8

Solved

What I want to do? (blue will be changed as white) What I did? I have found a class which extends TextView that able to outline textview very close to what I want. The problem is that I could not...
Foetid asked 26/2, 2013 at 14:36

4

Solved

I am using canvas.drawLine to draw some line in android but the lines are too sharp but i need a curved edges Here the 1 is what i have and 2 is what i want to achieve, means a line with curved ed...
Florafloral asked 29/12, 2013 at 7:14

1

Solved

I was trying to draw text inside circle and square in Jetpack Compose and I encounter this issue. The text holder/container (I am not sure what we call it), the light red rectangle, which holds the...

1

Solved

I am trying to draw text inside a circle in Jetpack Compose. I drew the circle with the center being the center of the canvas. Now I want to draw text exactly at the center of the circle. The drawT...

3

I am able to draw a text on canvas on motion view now the problem is that when i draw text & go for the next draw on same canvas my draw text is getting disappear i mean screen is getting redra...
Ridenhour asked 27/11, 2014 at 12:16

2

Solved

I need to implement a donut chart with a legend for each sector in the center of the slice. I use compose and there are no problems with the chart itself, but I don't understand how to draw text in...

1

Solved

I have drawn a heart using path.cubicTo() method Canvas(modifier = Modifier.size(100.dp)) { val path = Path() path.moveTo(0f, size.height / 3) path.cubicTo(0f, 0f, size.width / 2, 0f, size.widt...

8

Solved

Is there a method which returns the width ( in pixels ) of a text to be drawn on an Android canvas using the drawText() method according to the Paint used to draw it?
Xylo asked 15/7, 2010 at 15:45

6

I need to draw three circles in my fragment ,the circles differ in size, I refer this link The result i obtained is this This is my XML Code : UPDATED <?xml version="1.0" encoding="utf-8"?...
Racine asked 17/1, 2014 at 4:57

1

I am trying to achieve the blur effect like highlighted in this post: I'm using Jetpack Compose: @Composable fun MainApp() { val linearGradientBrush = Brush.linearGradient( colors = listOf( Col...

1

Solved

Assume I have the following code in compose below. A background magenta circle with a text on top with a default black color. I would like to blend the text color to White when it is above the cir...

19

Solved

A hopefully quick question, but I can't seem to find any examples... I'd like to write multi-line text to a custom View via a Canvas, and in onDraw() I have: ... String text = "This is\nmulti-line...
Woolsey asked 20/7, 2011 at 4:21

1

Has anyone seen anything like this? I'm drawing some rectangles on the canvas with the following code. int col = pad.getColor(); paint.setColor(col); Log.d("XXX","col " + Color....
Bryant asked 23/11, 2022 at 1:36

3

Solved

Basically, I have a rectangular bitmap and want to create a new Bitmap with squared dimensions which will contain the rectangular bitmap inside of it. So, for example, if the source bitmap has wid...
Christyna asked 2/11, 2013 at 16:29

6

My application work very well on nougat emulator and many devices, but i found this exception in google play crash reporter, I don't know why it happened, The exception causes with nougat devices +...
Infectious asked 5/7, 2017 at 7:9

3

Solved

I'm using Jetpack Compose to implement my requirement of drawing a 'Gradual growing line', i.e a line that starts from a specified start and point and gradually 'grows' until it reaches a specified...

0

I have a Box layout in which I have a canvas composable that draws a circle animation. I also have another Test Composable in which I would be drawing a few other shapes(Denoted in Grey color in th...
Eelworm asked 9/8, 2022 at 20:57

3

Solved

I'm trying to apply a visual effect to a viewgroup. My idea is to grab a bitmap of the viewgroup, shrink it down, expand it back up, and draw it over the viewgroup to give it a blocky, low quality ...
Barcroft asked 12/11, 2012 at 15:33

1

Could someone explain how can i draw this lines using jetpack compose & canvas?
Strouse asked 12/6, 2022 at 12:51

11

Solved

I am creating a pixel-hunting game. So my activity shows an ImageView. And I want to create a hint "show me where is the object". For this I need to blur whole image except a circle around a point ...
Catinacation asked 13/11, 2013 at 7:27

2

Solved

im trying to learn drawing bitmap on canvas with the usage of drawBitmap(Bitmap bitmap, Matrix matrix, Paint paint); Because i need one of my pngs to increase its size nearly every frame, i man...
Giffard asked 12/4, 2013 at 18:49

© 2022 - 2025 — McMap. All rights reserved.