Android Question Rotate 90° image saved

Douglas Farias

Expert
Licensed User
Longtime User
hi how can i rotate my bmp saved in my device and dont lost quality?
i only need rotate this
i m using the RSImageProcessing to rotate and later i save this but it save with a very bad quality

have another way to rotate image?

native android method to rotate and save later rotated?

B4X:
    Dim bmp As Bitmap
    Dim rbmp As RSImageProcessing
    Dim casa As String
    Dim exif As ExifData

rbmp.Initialize
    bmp.Initialize(FP, "1.jpg")
    exif.Initialize(FP, "1.jpg")
    casa =  exif.getAttribute(exif.TAG_ORIENTATION)
    If casa = 6 Then
    exif.setAttribute(exif.TAG_ORIENTATION, 1)
    exif.saveAttributes
    If bmp.width>bmp.height Then     
    bmp = rbmp.Rotate(bmp, 90)
    rbmp.writeBitmapToFile(bmp,FP ,"1.jpg", 100 )
 

pauleffect

Member
Licensed User
Longtime User
use @Informatix 's lib bitmapplus.

Dim b as bitmap plus

Let's say your bitmap is named original

newFile = b.Rotate(Width, Height, Angle, True)

Angle will be 90 or whatver you need. True is for antialiasing. It will look good.

Hope it helps.
 
Upvote 0
Top