This could be a dumb question :grimacing:. How do I `drawImage` (`Canvas`) with "pixelated" output?
t
This could be a dumb question 😬. How do I
drawImage
(
Canvas
) with "pixelated" output?
r
You mean when you scale the image?
t
Yes
When I zoom the input image, the output looks like this. (pixelated)
r
In the
Paint
you pass to
drawImage
set the
filterQuality
to
None
I believe
t
and when I
drawImage
, it looks like this.
@romainguy Okay, let me try that.
@romainguy Looks like there's no
Paint
param 🤔
t
okay, I think i need to use
drawIntoCanvas
then
but then the problem is
Canvas#drawImage
doesn't accept
srcOffset
😬. It got only destination offset(
topLeftOffset
)
Also doesn't have
dstSize
😞 I think i have to do all thse manually now.
androidx.compose.ui.graphics.drawscope.DrawScope#drawImage
was easier
It would be great if
DrawScope#drawImage
can accept
Paint
object 😬
Ohh I didn't knw abt that method 😮
It worked android dance
Thanks @Aaron Yoder @romainguy 🙇
a
Sorry, deleted my comment because I thought I misunderstood the question after looking at the documentation, but apparently not. 😅 For anyone else: use
Canvas#drawImageRect
t
😄 👍
c
@theapache64 can't wait to play Super Mario Compose. 😄