Skip to content

Get a GraphicsContext to modify an Image/Sprite #4330

@dacap

Description

@dacap

I though there were an issue created for this one, anyway it would be nice to be able to get a GraphicsContext to modify an Image. The tricky part here is to be able to undo all the modifications when the GraphicsContext is not used anymore.

Requested in the past and recently:

The function wrap_docimage_in_sksurface() can be used for this purpose (not sure if this would work on all color modes).

EDIT: The crossed out link is about drawing in a GraphicsContext received in the onpaint event, so it is actually a different issue, also it is not actually an issue, since the user was trying to draw an sprite using GraphicsContext::drawImage, which receives an Image as a parameter, not an Sprite. Someone from the community gave the user a right answer, so there is no need to create an new github issue.

Metadata

Metadata

Assignees

Labels

featureFeature request, or something should be improvedscriptingRelated to scripting API

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions