dotnet / dotnet/maui

DrawBitmap support for ICanvas

Open
#4,094 7 comments 7 reactions 0 assignees View on GitHub
area-drawing proposal/open t/enhancement ☀️
Dominant language
C#
Stars
23.3k
Forks
2k
Avg merge
1d 15h
Merged PRs (30d)
290

Description

### Description

In terms of drawing using ICanvas I feel features are bit limited on MAUI. Drawing on bitmap would be lot easier to save the UI and reuse object whenever needed.

For example, here is a case where I have tried to render circle based on the touch points interacted and for this I need to store every points and render again for each interaction. This results in performance issues on higher point counts. So I have overcame this issue on android native by drawing the points on bitmap parallelly and rendered the existing bitmap to the view on each interaction. So this lets canvas draw the bitmap alone at invalidate. So it would be good to provide feature to draw on the bitmap and draw a bitmap to the view using ICanvas.

### Public API Changes

- `canvas.DrawBitmap(bitmap)` -Renders bitmap to the given canvas
- `canvas.DrawCircle(bitmap)` -Render on the bitmap object

### Intended Use-Case

In my app I have a situation where I would add different paths to the canvas. But adding each paths every time at invalidation costs me the performance issue. Drawing on the bitmap and drawing the same bitmap to the view would be lot performance savings

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the ICanvas API and its existing drawing methods, then compare the requested bitmap rendering and drawing operations with the current cross-platform canvas behavior. Done means the API requirements are resolved and bitmap content can be rendered to and drawn on an ICanvas with the intended performance benefit; the issue names no files or tests to run.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
frontend, mobile-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.