Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to edit pixels in a Picture #34

Open
yskwong opened this issue Sep 30, 2014 · 4 comments
Open

How to edit pixels in a Picture #34

yskwong opened this issue Sep 30, 2014 · 4 comments
Assignees
Milestone

Comments

@yskwong
Copy link

yskwong commented Sep 30, 2014

I am experimenting with the Picture shape. An image is loaded into the Picture shape and displayed successfully after adding the shape to a layer.

I get at the ImageData of the picture, and change the color of some pixels by using APIs of ImageData (e.g. setRed, setGreen, ...).

After changing the imagedata of this picture shape, how do I refresh the picture so that it shows the effect of color changes at those pixels?? In other words, how to ask the picture to use the newly modified image data?? I must be missing something, as I could not find the APIs to do so.

@SprocketNYC SprocketNYC added this to the 2.1 milestone Oct 1, 2014
@SprocketNYC SprocketNYC self-assigned this Oct 1, 2014
@SprocketNYC
Copy link
Contributor

Will add in 2.1

@yskwong
Copy link
Author

yskwong commented Oct 1, 2014

Thank you.

@yskwong
Copy link
Author

yskwong commented Oct 1, 2014

In addition to updating a picture after pixel editing, I also have a related use case that might call for new constructors for Picture.

At this time, all the constructors of Picture are based on a parameter requiring an external resource, say a URL or ImageResource. However, if a new bitmap/imagedata is created programmatically, can we turn that into a picture? Thank you.

@SprocketNYC
Copy link
Contributor

It's not that hard to do, it's just messy when it comes to JSON serialization, and YOU wrote most go the tickets for JSON deserialization. Basically, if you construct a picture with ImageData, I need to force picture serialization to data URL's... something to think about.

@SprocketNYC SprocketNYC modified the milestones: 2.2, 2.1 Dec 1, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants