mgood7123

Results 139 comments of mgood7123

Nice On Sat, 20 Aug 2022, 9:13 pm Victor Irzak, ***@***.***> wrote: > @mgood7123 Yes, I have tested it. Works in > Visual Studio that consumes a nuget package. >...

> Thanks for this PR. We should add some logging, but this must be a Debug-only feature, internal and opt-in by setting some property. > > If you have a...

This one should be mergable

> Based on the google discussion: > > > I think this only supports unknown chunks - iTXt and pHYs are standard chunks, which are handled directly by libpng. >...

> I added a test, so before we merge I think we should add a test proving this works. Are you able to find an image that causes the chunks...

i tried it with ```cs var bm = BitmapFactory.decodeFile(Context, image_path_NPatch); var chunks = bm.getNinePatchChunk(); if (NinePatch.isNinePatchChunk(chunks)) { Log.d("NINEPATCH", "IS CHUNK YES"); //image.setImageDrawable(new NinePatchDrawable(bm, chunks, new Rect(), null)); } else {...

![circle 9](https://user-images.githubusercontent.com/26642847/186392529-edb5516a-58c2-4b63-9701-1bdcf9577d4f.png) valid 9 patch image `circle.9.png`

in android this works ```java Bitmap bm = decodeResource(getResources(), R.drawable.circle); // same as DecodeFile byte[] ninePatchChunk = bm.getNinePatchChunk(); if (NinePatch.isNinePatchChunk(ninePatchChunk)) { image.setImageDrawable(new NinePatchDrawable(bm, ninePatchChunk, new Rect(), null)); ```

hmmm it seems that Android's AAPT creates the 9-patch chunks itself, and the image does not actually contain these chunks (just the pixel info for these chunks) luckily we can...

and it can read it :) ![image](https://user-images.githubusercontent.com/26642847/186560976-c9d9a8a6-ce6d-4fde-92f3-06044814f41d.png) ```cs internal class _10_test_png_chunk_reader : Test { internal class Reader : SKPngChunkReader { public bool r = false; protected override bool ReadChunk(string tag,...