🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    M5.Lcd.drawJpg in python

    Micropython
    4
    5
    7.7k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P
      Powersoft
      last edited by

      Hello,

      Is there an equivalent version of "M5.Lcd.drawJpg" in python on the M5Stack?

      1 Reply Last reply Reply Quote 0
      • T
        tehnolog
        last edited by

        lcd.image(100, 100, file="res/default.jpg", scale=0, type=lcd.JPG)

        1 Reply Last reply Reply Quote 0
        • ajb2k3A
          ajb2k3
          last edited by

          image0 = M5Img(107, 65, "res/default.jpg", True)

          UIFlow, so easy an adult can learn it!
          If I don't know it, be patient!
          I've ether not learned it or am too drunk to remember it!
          Author of the WIP UIFlow Handbook!
          M5Black, Go, Stick, Core2, and so much more it cant be fit in here!

          M 1 Reply Last reply Reply Quote 0
          • M
            mb @ajb2k3
            last edited by

            Hi @ajb2k3, is M5Img still the preferred way to display an image on the Core2?

            Somehow it doesn't work for me, neither from flash nor from micro SD card.

            >>> from m5stack import *
                from m5stack_ui import *
                from uiflow import *
                image0 = M5Img(0, 0, "/flash/images/sled240.jpg", True)
            
            Traceback (most recent call last):
              File "<stdin>", line 4, in <module>
              File "m5stack_ui.py", line 493, in __init__
            TypeError: 'int' object isn't iterable
            

            I can use lcd.image(), but that crashes for pictures from the mico SD card (link).

            1 Reply Last reply Reply Quote 0
            • M
              mb
              last edited by mb

              Now I found working code for UIFlow 1.7.2, but this only supports PNGs:

              from m5stack import *
              from m5stack_ui import *
              
              screen = M5Screen()
              screen.clean_screen()
              screen.set_screen_bg_color(0xFFFFFF)
              
              image0 = M5Img("/sd/images/sled150.png", x=0, y=0, parent=None)
              
              1 Reply Last reply Reply Quote 0
              • First post
                Last post