🤖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

    Scheduled Pinned Locked Moved Micropython
    5 Posts 4 Posters 9.4k Views 1 Watching
    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 Offline
      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 Offline
        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 Offline
          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 Offline
            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 Offline
              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

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              • First post
                Last post