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

    drawJpgFile at specific coordinates

    PRODUCTS
    3
    3
    8.3k
    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.
    • F
      forjus2000
      last edited by

      for (int x=0; x <160 ; x++){

      M5.Lcd.setCursor (x, 0);
      M5.Lcd.drawJpgFile(SD, "/picture.jpg");

      }

      how can i draw a jpg image at specific location ?

      1 Reply Last reply Reply Quote 0
      • 0x1abin0
        0x1abin
        last edited by

        M5.Lcd.drawJpgFile(fs::FS &fs, const char *path, uint16_t x, uint16_t y, uint16_t maxWidth, uint16_t maxHeight, uint16_t offX, uint16_t offY, jpeg_div_t scale);

        1 Reply Last reply Reply Quote 1
        • AsmodevA
          Asmodev
          last edited by

          void drawJpgFile(fs::FS &fs, const char *path, uint16_t x = 0,
                           uint16_t y = 0, uint16_t maxWidth = 0,
                           uint16_t maxHeight = 0, uint16_t offX = 0,
                           uint16_t offY = 0, jpeg_div_t scale = JPEG_DIV_NONE);
          
          void drawPngFile(fs::FS &fs, const char *path, uint16_t x = 0,
                           uint16_t y = 0, uint16_t maxWidth = 0,
                           uint16_t maxHeight = 0, uint16_t offX = 0,
                           uint16_t offY = 0, double scale = 1.0,
                           uint8_t alphaThreshold = 127);
          

          As you can see you don't need the extra values because they're automatically SET, even
          M5.Lcd.drawJpgFile(SD, "/wifi.jpg",110,40,100,100,0,0);
          does not work though, Why are the libraries not working properly?

          1 Reply Last reply Reply Quote 1
          • First post
            Last post