xamarin.android - How to get Bit Depth of a Bitmap on Mono For Android -
in .net 1 way check bitdepth of bitmap image using bitmap class so:
switch (bitmap.pixelformat) { case system.drawing.imaging.pixelformat.format1bppindexed: return 1; case system.drawing.imaging.pixelformat.format4bppindexed: return 4; case system.drawing.imaging.pixelformat.format8bppindexed: return 8; case system.drawing.imaging.pixelformat.format16bppargb1555: case system.drawing.imaging.pixelformat.format16bppgrayscale: case system.drawing.imaging.pixelformat.format16bpprgb555: case system.drawing.imaging.pixelformat.format16bpprgb565: return 16; case system.drawing.imaging.pixelformat.format24bpprgb: return 24; case system.drawing.imaging.pixelformat.format32bppargb: case system.drawing.imaging.pixelformat.format32bpppargb: case system.drawing.imaging.pixelformat.format32bpprgb: return 32; case system.drawing.imaging.pixelformat.format48bpprgb: return 48; case system.drawing.imaging.pixelformat.format64bppargb: case system.drawing.imaging.pixelformat.format64bpppargb: return 64; }
i trying write equivalent function targeting mono android (xamarin project) returns me bitdepth of bitmap file bitmap class in adroid.graphics namespace, lot less helpful - or perhaps unfamilar me. can help?
you can bitmap depth adroid.graphics.bitmap.config property :
bitmap.config argb_4444 16 bitmap.config argb_8888 32 bitmap.config rgb_565 16 r5 g6 b5 ,no alpha
Comments
Post a Comment