Android Question Image scaling problems after processing

Sub7

Active Member
Licensed User
Longtime User
I've really tried to understand what's going on but i cannot get it so i give up..

I have a touchimageview, a panel, camera, MESGraphix library to convert in grayscale (no rsimageprocessing because it seems to be too slow at least on my devices),
jpegutils to read image metadata, rsimageprocessing to rotate the image.

I take a picture, convert to grayscale, load the processed image in the touchimageview and it get scaled, zoomed, moved all around, this change from device to device.

For example on my tablet the result cover all the screen but scaled and zoomed, on samsung s3 the result is a little cropped image.

@thedesolatesoul :) No matter if i save, copy, rename, reload the file, i get the same result, this does not happen if i use rsimageprocessing to convert the image to grayscale but as i said i looks very slow on my 3 devices!

I want to see in my touchimageview exactly the same thing i photographed.

I upload an example (libs included), if someone can help i'll be extremely grateful.
 

Attachments

  • camera.zip
    368.7 KB · Views: 182

Sub7

Active Member
Licensed User
Longtime User
Hi, are you telling me the result image on touchimageview1 is in grayscale exactly what you photographed?
This is what i get:
first pic i commented this: convert = mes.toGrayscale(convert)
Second pic tograyscale enable is what i get while i am trying to get a full size and correctly positioned image.


thanks
 

Attachments

  • correct.jpg
    correct.jpg
    129.5 KB · Views: 178
  • wrong.jpg
    wrong.jpg
    175.4 KB · Views: 180
Upvote 0

sorex

Expert
Licensed User
Longtime User
yes, it is.

the first time the only issue I saw was that it zoomed in too much but it was all there when I zoomed out.
 
Upvote 0

Sub7

Active Member
Licensed User
Longtime User
Thank you for testing, this make everything even more problematic :)
May can i know in which device you tried and os version?

@Erel any input?

Thanks Sorex!
 
Upvote 0

Sub7

Active Member
Licensed User
Longtime User
Update:
converting the image using rsimageprocessing library and later getting the scale rect (touchview1.GetScaleRect) give this:
(Rect)(1, 1, 961, 1281) but only after taking 2 pictures and overwriting the file.
The first picture saved get: (Rect)(1, 1, 1, 1)

With the other library the result of GetScaleRect is always (Rect)(1, 1, 1, 1), this must be the problem.

Anyone?

Good morning.
 
Upvote 0

Sub7

Active Member
Licensed User
Longtime User
I give up, i think that the libraby MESGRaphix may be is bugged, another user reporting the same issue.

"Maybe bugreport to the lib:

Dim BM As Bitmap, Wid, Ht As Int
BM.initialize(File.DirAssets, "picture.jpg") '200 x 200 pixels
BM = BMP.toGrayscale(BM)

Grayscale result of the picture is also 200 x 200 pixels, but contain the left-top scaled up corner of the picture."
 
Upvote 0

Sub7

Active Member
Licensed User
Longtime User
The problem is not converting the image into grayscale but the resultant image that's scaled up.
i'll use another lib, my patience has reach his limit :rolleyes:
 
Upvote 0

Informatix

Expert
Licensed User
Longtime User
The problem is not converting the image into grayscale but the resultant image that's scaled up.
i'll use another lib, my patience has reach his limit :rolleyes:
If you load your bitmaps with LoadBitmap or LoadBitmapSample (or their corresponding Initialize function), you're going to face a problem of density and thus a problem of scaling with ImageViews. To avoid this, you should use the LoadScaledBitmap function of my Accelerated Surface library (class AS_ImageUtils). The scaling parameters can be set to -1 for no scale change. By the way, you will be able to convert your images to grayscale in a very efficient way with the AlterColors function of the same class.
 
Upvote 0
Top