Android Question [B4X] [XUI] CropView how to resize to fullscreen via code or layout?

scsjc

Well-Known Member
Licensed User
Longtime User
Sorry, but I don't understand what exactly you want to do.
Maybe this could help: [B4X][XUI] Fill and Fit images without distortion

The idea is to change the size to 100%x and 100%y of cropview1, but for example:

It happens that if I put it in this size that I show here, and I press the screen above the cropview1 it gives me that error.

and if I put it at 100% x and 100% and the same thing happens when the bmp is smaller than the cropview

1580563401681.png
 
Upvote 0

scsjc

Well-Known Member
Licensed User
Longtime User

Attachments

  • CropView.zip
    56.5 KB · Views: 195
Upvote 0

klaus

Expert
Licensed User
Longtime User
I had a look at your project, I get also an error when beginning outsides the CropView.
I have not yet investigated more deeply into it, it is insides the CropView class.
Maybe you could have a look at this [B4X] [XUI] xResizeAndCrop, it's cross platform.
 
Upvote 0

MicroDrie

Well-Known Member
Licensed User
To fix the error when beginning outsides the CropView: add line 1 and 2

Fix for Private Sub DrawRect:
    If SelectionRect.Bottom < 1 Then Return
    If SelectionRect.Right < 1 Then Return
    
    For y = SelectionRect.Top To SelectionRect.Bottom - 1
        TargetBC.SetARGB(SelectionRect.Left, y, a)
        TargetBC.SetARGB(SelectionRect.Right - 1, y, a)
    Next
    For x = SelectionRect.Left To SelectionRect.Right - 1
        TargetBC.SetARGB(x, SelectionRect.Top, a)
        TargetBC.SetARGB(x, SelectionRect.Bottom - 1, a)
    Next

This fix ignore the update when start outside the picture.

A clever and a very nice and useful way to display details from a picture.
 
Upvote 0
Top