Skip to content

Conversation

riggaroo
Copy link
Collaborator

@riggaroo riggaroo commented Aug 18, 2023

Adding a sample that shows how to draw a composable into a bitmap, using Picture and drawIntoCanvas.

@riggaroo riggaroo changed the title [WIP] Draw into bitmap Sample showing how to take a screenshot from a composable Aug 19, 2023
@riggaroo riggaroo marked this pull request as ready for review August 21, 2023 20:10
@snippet-bot
Copy link

snippet-bot bot commented Aug 21, 2023

Here is the summary of changes.

You are about to add 2 region tags.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@riggaroo riggaroo requested a review from IanGClifton August 21, 2023 20:17
Copy link
Contributor

@JolandaVerhoef JolandaVerhoef left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love it! One small comment.


onDrawWithContent {
val pictureCanvas =
androidx.compose.ui.graphics.Canvas(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is there a whole package definition needed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because we need to use two different kinds of canvas' in the snippet, I'll import the other one too so its clearer in the snippets.

@riggaroo riggaroo merged commit bcbbd86 into main Aug 22, 2023
@riggaroo riggaroo deleted the draw-into-bitmap branch August 22, 2023 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants