Converting .png to .bin and .h

Discussion in '3DS - Homebrew Development and Emulators' started by mashers, Sep 13, 2015.

  1. mashers
    OP

    mashers Stubborn ape

    Member
    3,837
    5,155
    Jun 10, 2015
    Kongo Jungle
    When I build home brew launcher from source, I can put png files which have been converted to .bin into the data directory, and it gets compiled into the product and the object can be referenced through a header file.

    I'm currently using a web based tool to convert the image to the .bin file, but I want to be able to display png images from SD without having to convert them first. Does anybody know what format the .bin file is in, and if there is a method of doing the same thing in C?
     
  2. 730

    730 Professional Shitposter

    Member
    465
    376
    Apr 2, 2015
    Argentina
    From here:
    Now you figure out how to do that because I don't know C or anything :P
     
  3. Garcia98

    Garcia98 Hey! Listen!

    Member
    361
    188
    Sep 8, 2015
    Salamanca
    Nevermind I misunderstood you xD
     
  4. elhobbs

    elhobbs GBAtemp Advanced Fan

    Member
    806
    295
    Jul 28, 2008
    United States
  5. mashers
    OP

    mashers Stubborn ape

    Member
    3,837
    5,155
    Jun 10, 2015
    Kongo Jungle
    @elhobbs
    Are you referring to lodepng.c?
     
  6. elhobbs

    elhobbs GBAtemp Advanced Fan

    Member
    806
    295
    Jul 28, 2008
    United States
    yes
     
  7. suloku

    suloku GBAtemp Advanced Fan

    Member
    863
    491
    Apr 28, 2008
    I think hbl does that to optimize and embed its graphics thoughh
     
  8. mashers
    OP

    mashers Stubborn ape

    Member
    3,837
    5,155
    Jun 10, 2015
    Kongo Jungle
    Thanks. Looking into it, it seems to be a standalone PNG encoding/decoding function. If it can decode it into the right type of data then it could work. Thanks!

    Sure, and I don't intend to do this for any built in graphics such as the UI. I want to give the option of adding a high resolution icon for the top screen, and I don't want the user to have to convert to .bin format in advance.
     
  9. Garcia98

    Garcia98 Hey! Listen!

    Member
    361
    188
    Sep 8, 2015
    Salamanca
    I don't know if it's to late but you can use sfillib to load images
     
  10. mashers
    OP

    mashers Stubborn ape

    Member
    3,837
    5,155
    Jun 10, 2015
    Kongo Jungle
    Thanks- I'm still looking into options for PNG loading, so I'll look it this library too.