Hello everyone,
protect yourself face to the tiny virus...not in your computer !!
Here is a problem of degradation of the pictures during their rotations in an imageView.
The code I use is the following one:
imv1 is an imageView
bm is a bitMap
I created a button for the picture rotation.
But after each rotation, the picture loses some pixels...they become gray.
Is it due to the calculation of the internal matrix of rotation or do have I some code to add for keeping the complete quality to the picture ?
When you'll have a moment..thanks much !
protect yourself face to the tiny virus...not in your computer !!
Here is a problem of degradation of the pictures during their rotations in an imageView.
The code I use is the following one:
picture rotation:
sub rotation
dir=File.DirRootExternal & "/imgBooks"
filename ="id" & lblId.Text & "_img" & rd & ".jpeg"
bm.Initialize(dir,filename)
bm=bm.Rotate(sens)
bm2 =bm
Dim out As OutputStream
out = File.OpenOutput(dir, filename, False)
bm2.WriteToStream(out, 100, "JPEG")
out.Close
'----------------------
Dim a As Double
Wi = bm.width'150
Hi = bm.height'80
Wv=imv1.Width'100
Hv=imv1.height'100
rw=Wv/Wi'100/150=0.666 --> a =0.666
rh=Hv/Hi'100/80=1.25
If rw>rh Then a=rh Else a=rw'rapport des hauteur et largeur
imv1.Bitmap = LoadBitmapResize(dir, filename, a*Wi, a*Hi, True)
imv1.Gravity = Gravity.CENTER
end sub
imv1 is an imageView
bm is a bitMap
I created a button for the picture rotation.
But after each rotation, the picture loses some pixels...they become gray.
Is it due to the calculation of the internal matrix of rotation or do have I some code to add for keeping the complete quality to the picture ?
When you'll have a moment..thanks much !