mirai-core / net.mamoe.mirai.utils / java.awt.image.BufferedImage

Extensions for java.awt.image.BufferedImage

suspendToExternalImage

suspend fun BufferedImage.suspendToExternalImage(): ExternalImage

toExternalImage

BufferedImage 保存稳临时文件, 然后构造 ExternalImage

fun BufferedImage.toExternalImage(formatName: String = "png"): ExternalImage