Skip to content

Commit 1f17215

Browse files
authored
Merge pull request #21 from FoamyGuy/bitmaptools_blit
update for blit refactor to bitmaptools
2 parents 7c9f01f + 2273385 commit 1f17215

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

examples/ov5640_stopmotion_kaluga1_3.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,26 @@ def take_stop_motion_gif(n_frames=10, replay_frame_time=0.3):
235235
g.add_frame(frame, replay_frame_time)
236236
for i in range(1, n_frames):
237237
print(f"{i}/{n_frames}")
238-
old_frame.blit(0, 0, frame, x1=0, y1=0, x2=frame.width, y2=frame.height)
238+
239+
# CircuitPython Versions <= 8.2.0
240+
if hasattr(old_frame, "blit"):
241+
old_frame.blit(
242+
0, 0, frame, x1=0, y1=0, x2=frame.width, y2=frame.height
243+
)
244+
245+
# CircuitPython Versions >= 9.0.0
246+
else:
247+
bitmaptools.blit(
248+
old_frame,
249+
frame,
250+
0,
251+
0,
252+
x1=0,
253+
y1=0,
254+
x2=frame.width,
255+
y2=frame.height,
256+
)
257+
239258
frame = wait_record_pressed_update_display(False, cap)
240259
g.add_frame(frame, replay_frame_time)
241260
print("done")

0 commit comments

Comments
 (0)