isImageAlphaExist static method

bool isImageAlphaExist(
  1. Uint8List imageBytes
)

檢查是否有alpha通道

Implementation

static bool isImageAlphaExist(Uint8List imageBytes) {
  // Load the image
  final image = decodeImage(imageBytes);
  if (image == null) {
    print('Failed to load image.');
    throw Exception('Failed to load image.');
  }

  return image.hasAlpha;
}