Skip to content

Commit

Permalink
处理进度条预览图片时使用计算出的图片大小进行裁剪
Browse files Browse the repository at this point in the history
  • Loading branch information
aaa1115910 committed Jun 14, 2024
1 parent 0a6cf3c commit c67f514
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,12 @@ fun VideoShot.getImage(time: Int): Bitmap {
}
}

return Bitmap.createBitmap(bitmap, x * imageWidth, y * imageHeight, imageWidth, imageHeight)
val realImageWidth = bitmap.width / imageCountX
val realImageHeight = bitmap.height / imageCountY

return Bitmap.createBitmap(
bitmap, x * realImageWidth, y * realImageHeight, realImageWidth, realImageHeight
)
}

private fun findClosestValueIndex(array: List<UShort>, target: UShort): Int {
Expand Down

0 comments on commit c67f514

Please sign in to comment.