iOS Question problem with cropview

mohammadreza hosseinzadeh

Member
Licensed User
hi there
i wanna use crop view in this thread https://www.b4x.com/android/forum/threads/b4x-xui-cropview.94952/ in b4i
as mentioned in thread it required XUI, BitmapCreator and both of them are internal
but xui is internal in b4i
ive added bitmap creator in my project with this link https://www.b4x.com/android/forum/t...eator-pixels-drawings-and-more.92050/#content

but my cropview have some error again
this method has error

B4X:
Private Sub pnl_Touch (Action As Int, X As Float, Y As Float)
    x = (x - OffsetX)/ xui.Scale
    y = (y - OffsetY) / xui.Scale
    x = Max(0, Min(ColorBC.mWidth - 1, X))
    y = Max(0, Min(ColorBC.mHeight - 1, Y))
    Select Action
        Case pnl.TOUCH_ACTION_DOWN
            SelectionRect.Left = 0
            SelectionRect.Top = 0
            SelectionRect.Right = 0
            SelectionRect.Bottom = 0
            sx = X
            sy = Y
        Case pnl.TOUCH_ACTION_MOVE
            SelectionRect.Left = Min(sx, X)
            SelectionRect.Top = Min(sy, Y)
            SelectionRect.Right = Max(sx, X)
            SelectionRect.Bottom = Max(sy, Y)
        Case pnl.TOUCH_ACTION_UP
            If IsValidSelection Then
                CallSubDelayed(mCallBack, mEventName & "_CropCompleted")
            End If
    End Select
    UpdateTarget
End Sub

xui.Scale is unknown member
and pnl.TOUCH_ACTION_DOWN is unknown member too as it is b4xview and dont have touch action

what should i do
i attach a cropview.bas
please help me to figure it out in b4i
 

Attachments

  • CropView.bas
    3.9 KB · Views: 312
Top