does getting image from same cell work?
See original GitHub issueI have tried to get an image of the canvas from the same cell as described in the documentation. I tried the following code:
from ipycanvas import Canvas
import numpy as np
canvas = Canvas(width=200, height=200, sync_image_data=True)
display(canvas)
def get_array(*args, **kwargs):
print("here")
arr = canvas.get_image_data()
print(arr)
np.save("whatever.txt", arr)
# Do something with arr
# Listen to changes on the ``image_data`` trait and call ``get_array`` when it changes.
canvas.observe(get_array, 'image_data')
canvas.stroke_line(50, 10, 150, 10)
Unfortunately nothing happens (except the canvas being drawn). Can you confirm that this works for you?
PS: What I am trying to achieve is creating a gif/video from an animation, which is still an open issue as far as I have seen. But I try it “by hand”.
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Lookup Pictures in Excel based on a Cell Value - YouTube
Use Data Validation/Drop Down Lists or Slicers to lookup pictures or images in Excel. ... Your browser can 't play this video.
Read more >Excel IMAGE function to insert picture in cell - Ablebits
With the newly introduced IMAGE function, you can insert a picture in a cell with a simple formula, place images within Excel tables,...
Read more >How to change images based on cell values (3 ways)
Ultimately, the purpose is to link an image or picture to a cell; change the cell value and the picture automatically changes.
Read more >Microsoft Excel: How to insert an image into a cell
A. Yes, you can insert an image into an Excel cell as follows. Paste an image into Excel, then resize the image and...
Read more >Picture Lookup in Excel using Named Ranges
Learn how to use Named Ranges to do a Picture Lookup in Excel. This is a cool excel dashboard trick where pictures update...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This was actually the problem 😃
This code works now for me:
Hope that somehow helps you in the future with your GIF animation creation.
This is huge ahah. I haven’t thought of threading when trying the first time.
Thanks a lot for trying! This will definitely help. We would need to think of a way to expose this as a nice and friendly user-API.