Merge pull request #7648 from gamblor21/ondiskgif_doc_fix

OnDiskGif Documentation Example fix
This commit is contained in:
MicroDev 2023-02-26 07:36:04 +05:30 committed by GitHub
commit 96ab9ff615
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -43,19 +43,21 @@
//| import displayio //| import displayio
//| import time //| import time
//| //|
//| display = board.DISPLAY
//| splash = displayio.Group() //| splash = displayio.Group()
//| board.DISPLAY.show(splash) //| display.root_group = splash
//| //|
//| odg = gifio.OnDiskGif('/sample.gif') //| odg = gifio.OnDiskGif('/sample.gif')
//| odg.next_frame() # Load the first frame //| odg.next_frame() # Load the first frame
//| face = displayio.TileGrid(odg, pixel_shader=displayio.ColorConverter(input_colorspace=displayio.Colorspace.RGB565)) //| # Depending on your display the next line may need Colorspace.RGB565 instead of Colorspace.RGB565_SWAPPED
//| face = displayio.TileGrid(odg.bitmap, pixel_shader=displayio.ColorConverter(input_colorspace=displayio.Colorspace.RGB565_SWAPPED))
//| splash.append(face) //| splash.append(face)
//| board.DISPLAY.refresh() //| board.DISPLAY.refresh()
//| //|
//| # Wait forever //| # Wait forever
//| while True: //| while True:
//| gif.next_frame() //| next_delay = odg.next_frame()
//| time.sleep(0.1)""" //| time.sleep(next_delay)"""
//| //|
//| def __init__(self, file: str) -> None: //| def __init__(self, file: str) -> None:
//| """Create an OnDiskGif object with the given file. //| """Create an OnDiskGif object with the given file.