Skip to content

How to draw an image in a Canvas ? #2431

Answered by freakboy3742
ikus060 asked this question in Q&A
Discussion options

You must be logged in to vote

You haven't missed anything - canvas doesn't support bitmap images. Canvas is a purely vector surface. It's likely possible to implement support for bitmaps on canvas, but the feature isn't there at present.

However, more generally, my immediate reaction is that a canvas is almost certainly the wrong foundation on which to build this. It's a bare-bones drawing surface, not something intended for constructing complex UI widgets. It may superficially have the features that seem like a match for building a widget, like drawing text and handling mouse clicks - but the resulting widget won't look very native widget, as you need to take control of the entire drawing process, and the entire proc…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by ikus060
Comment options

You must be logged in to vote
1 reply
@HalfWhitt
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants