Hello my friends,
I use ABExtDrawing library in order to change saturation,brightness,contrast etc of a photo with this code(all done by a seekbar):
When user wants to apply for example that level of brightness, hits button "Apply", which does this:
My question here is, if user keep editing photo and hitting Apply button, photo quality lowers dramatically. Does anyone knows any workaround for this problem?
I use ABExtDrawing library in order to change saturation,brightness,contrast etc of a photo with this code(all done by a seekbar):
B4X:
Sub SeekBar1_ValueChanged (Value As Int, UserChanged As Boolean)
Private abd As ABExtDrawing
Private recta As Rect
recta.Initialize(0,0,imgPhoto.Width,imgPhoto.Height)
lblSeek1.Text="Brightness: " & c
paint.SetColorMatrixColorFilter(Array As Float(1, 0, 0, 0, c,0, 1, 0, 0, c,0, 0, 1, 0, c,0, 0, 0, 1, 0,0, 0, 0, 0, 1))
abd.drawBitmap(canvas2,bm,Null,recta,paint) 'canvas2 is a canvas to be drawn, bm is my photo bitmap, recta is as Rect where to be drawn, paint is the brightness filter
Activity.Invalidate2(recta) 'realtime seekbar change
End Sub
When user wants to apply for example that level of brightness, hits button "Apply", which does this:
B4X:
Sub btnApply_Click
out=File.OpenOutput(File.DirInternal,Main.filename,False)
canvas2.Bitmap.WriteToStream(out,100,"JPEG")
out.Close
bm=LoadBitmap(File.DirInternal,Main.filename) 'Loads the new "edited" photo at bitmap, in order user can furthermore edit it
End Sub
My question here is, if user keep editing photo and hitting Apply button, photo quality lowers dramatically. Does anyone knows any workaround for this problem?