update for blit refactor to bitmaptools
This commit is contained in:
parent
3e5de3618d
commit
0e1c2c65ec
1 changed files with 20 additions and 1 deletions
|
|
@ -235,7 +235,26 @@ def take_stop_motion_gif(n_frames=10, replay_frame_time=0.3):
|
|||
g.add_frame(frame, replay_frame_time)
|
||||
for i in range(1, n_frames):
|
||||
print(f"{i}/{n_frames}")
|
||||
old_frame.blit(0, 0, frame, x1=0, y1=0, x2=frame.width, y2=frame.height)
|
||||
|
||||
# CircuitPython Versions <= 8.2.0
|
||||
if hasattr(old_frame, "blit"):
|
||||
old_frame.blit(
|
||||
0, 0, frame, x1=0, y1=0, x2=frame.width, y2=frame.height
|
||||
)
|
||||
|
||||
# CircuitPython Versions >= 9.0.0
|
||||
elif hasattr(bitmaptools, "blit"):
|
||||
bitmaptools.blit(
|
||||
old_frame,
|
||||
frame,
|
||||
0,
|
||||
0,
|
||||
x1=0,
|
||||
y1=0,
|
||||
x2=frame.width,
|
||||
y2=frame.height,
|
||||
)
|
||||
|
||||
frame = wait_record_pressed_update_display(False, cap)
|
||||
g.add_frame(frame, replay_frame_time)
|
||||
print("done")
|
||||
|
|
|
|||
Loading…
Reference in a new issue