Drawing part of PDC image

When working with bitmap images it’s common to create one resource with many small images inside AKA atlas, and then render only part of the image. Pebble API supports such workflow with gbitmap_create_as_sub_bitmap function.

But is it possible to do the same with PDC? Is it even a good idea to have an atlas PDC image and then render only selected parts of it?

I’m currently working on font, made as PDC file, with big numbers for my new watchface and I went straight for atlas image approach Watchface: Naive - #16 by irek . But I see no function in pebble.h that could make this work.

Is it a better idea to have each digit image as separate resource?

1 Like

You can retrieve parts of pdcs with gdraw_command_image_get_command_list, but you would have to do a bit of math to figure out which command belongs to which part of the asset. In cutiefur I ship up to 5 resources per creature with 13 (I think?) creatures in total now, and the performance is better than I was imagining it would be, so I doubt there’s much concern about using multiple pdcs in one draw.

2 Likes

I know the exact index of my command and I have just one command per shape so this solution is perfect for my case. Thanks :))

2 Likes