Shop OBEX P1 Docs P2 Docs Learn Events
How do I get bitmap icons from an SD card to Rayman's display? — Parallax Forums

How do I get bitmap icons from an SD card to Rayman's display?

MicrocontrolledMicrocontrolled Posts: 2,461
edited 2010-04-20 23:21 in Propeller 1
I am wanting to read bitmap icons (doesn't matter how much color) off of an SD card and onto Rayman's display. They will be placed on the screen like the shortcuts on a desktop. I am wondering: What code will I need for this and what will I need to do to the .bmp file to get it on the display? I have used Rayman's 2bit bitmap Windows app and the DisplayBitmap2bit PUB from the PSB_Paint! object but only get a disorted image. What do I need to do to get multiple icons on the screen? This is using a PSB setup and the prop.

Thanks,

Micro Propeller.gif

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Check out my new website!!

Use the Propeller icon!! Propeller.gif

Follow me on Twitter! Search "Microcontrolled"

Comments

  • RaymanRayman Posts: 14,887
    edited 2010-04-20 17:32
    Take a look at the Paint! example app... There are several custom 2-bit icons on the screen. It's that same Windows app that makes them...

    The one trick to custom character apps is that we need to 16-long align the bitmap data before showing it.
    But, we need to know how much data we need to align...· This is handled by a parameter in the CON section called "nuchars".
    So, if you add a 16x16 pixel tile, you need to increase the value of the constant "nuchars" by 1.
    I think those icons are 2x2=4 tiles, so you need to add 4 to nuchars for every icon you add...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm

    My Prop Products:· http://www.rayslogic.com/Propeller/Products/Products.htm
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2010-04-20 18:18
    That's what was wrong! Thanks Rayman!

    Now I have another question: How do I get it the colors I want?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Check out my new website!!

    Use the Propeller icon!! Propeller.gif

    Follow me on Twitter! Search "Microcontrolled"
  • RaymanRayman Posts: 14,887
    edited 2010-04-20 20:30
    I believe one the the parameters to the function that shows the bitmap is the color number...· Just change the corresponding color to the value you want...

    I have some color help here:

    http://www.rayslogic.com/propeller/Programming/Colors.htm

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm

    My Prop Products:· http://www.rayslogic.com/Propeller/Products/Products.htm
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2010-04-20 23:21
    @Rayman: OK, if I have never told you before, you are the diamond of the Propeller driven displays. You are one of the few people that have written PC tools to help with Propeller programming, AND have written awesome propeller programs as well. We need more of people like you one this forum. Your website is AMAZING. It's PACKED with awesome tools to be used. Thank you.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Check out my new website!!

    Use the Propeller icon!! Propeller.gif

    Follow me on Twitter! Search "Microcontrolled"
Sign In or Register to comment.