Open TroyRay opened 8 years ago
+1
please
it's my question too .
My issue . Can anyone help me ? Thanks
anyone found solution?
??
You can use set ascept ratio method on GPUImageView gpuImageView.setRatio(getDecimalEquivalent(bitmap.width,bitmap.height)) gpuImageView.setImage(bitmap)
private fun getDecimalEquivalent(width: Int, height: Int): Float { val factor = greatestCommonFactor(width, height) val widthRatio: Float = width / factor val heightRatio: Float = height / factor return widthRatio / heightRatio }
private fun greatestCommonFactor(width: Int, height: Int): Float {
return if (height == 0) width.toFloat() else greatestCommonFactor(height, width % height)
}
How to remove the black background of gpuimage?