iOS Question Flip a bitmap

Alessandra Pellegri

Active Member
Licensed User
Longtime User
I am looking for B4A Canvas.DrawBitmapFlipped equivalent in B4i.
Does it exists or do I need to use native api with objective C ? Eventually how could I do ?

Thank you
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Canvas currently doesn't support it.

You can use this code to flip a view:
B4X:
Sub FlipView (View As View, Vertically As Boolean, Horizontally As Boolean)
   Dim no As NativeObject = Me
   Dim x, y As Int
   If Horizontally Then x = -1 Else x = 1
   If Vertically Then y = -1 Else y = 1
   no.RunMethod("FlipView:::", Array(View, x, y))
End Sub

#if objc
- (void) FlipView:(UIView*)view :(int)x :(int)y {
   view.transform = CGAffineTransformMakeScale(x, y);
}
#end if
 
Upvote 0
Top