Unfortunately the b4xCanvas has no .drawbitmapflipped method. Is there a workaround?
'flips an image
'Orientation 0 = horizontally 1 = vertically 2 = both
Public Sub Flip(Image As B4XBitmap, Orientation As Int) As B4XBitmap
Private xf, yf, x, y As Int
Private col0 As ARGBColor
Private bmcImage, bmcResult As BitmapCreator
bmcImage.Initialize(Image.Width, Image.Height)
bmcImage.CopyPixelsFromBitmap(Image)
bmcResult.Initialize(Image.Width, Image.Height)
Select Orientation
Case 0
For y = 0 To Image.Height - 1
For x = 0 To Image.Width - 1
bmcImage.GetARGB(x, y, col0)
bmcResult.SetARGB(x, y, col0)
Next
Next
Case 1
For y = 0 To Image.Height - 1
For x = 0 To Image.Width - 1
xf = Image.Width - 1 - x
bmcImage.GetARGB(x, y, col0)
bmcResult.SetARGB(xf, y, col0)
Next
Next
Case 2
For y = 0 To Image.Height - 1
For x = 0 To Image.Width - 1
yf = Image.Height - 1 - y
bmcImage.GetARGB(x, y, col0)
bmcResult.SetARGB(x, yf, col0)
Next
Next
Case 3
For y = 0 To Image.Height - 1
For x = 0 To Image.Width - 1
xf = Image.Width - 1 - x
yf = Image.Height - 1 - y
bmcImage.GetARGB(x, y, col0)
bmcResult.SetARGB(xf, yf, col0)
Next
Next
End Select
Return bmcResult.Bitmap
End Sub
thank you Luca. I have dealt with BitmapCreator, but cannot apply it to my problem. The FlipcompressedBitmap-Method aplies to CompressedBC. I cannot find a way with bitmapCreator, to flip a canvas or bitmap.
I 've been surfing around in this forum to find an easy way to flip a canvas or a bitmap, but was not successful. (most of the examples simply use canvas, but I want to do it crossplattform)
The real problem is that you are not reading the posts.(The more I deal with b4a, the more I appreciate it. But it also confuses me with it's wide spread and partially contradictory informations. f.i. your nice latest fitForCenterImage-example, that I just found by chance - older version I found earlier...)
The table on page 11 shows the available methods with the different canvases.2. page 8 (and 11) in my B4xGraphicsV1_7.pdf tells me, there would be a DrawBitmapFlipped-Method.
The code in the routines runs on all three platforms.In my downloaded examples, BitmapCreator1-3 has just b4j-files. No b4a examples.
My wife keeps on telling me, that I am not listening correctly so you must be wrongThe real problem is that you are not reading the posts.
Go to BitmapCreaterEffects. Download the library and use effects.FlipVertical or FlipHorizontal to flip the images.
Sorry, I did not understand, that the B4a-Column might not apply, if I use a b4x-object.The DrawBitmapFlipped method you are speaking of is in the B4A column, therefore only available with a B4A Canvas.
The code in the routines runs on all three platforms.
Only the B4J program is shown, all the routines are valid for B4A and B4i.
Thank you Klaus. This is exceptionally a point, I have already understoodBitmapCreatorEffects is a b4xlib and cross-platform!
You can develop desktop application with B4J.Is it correct, that I could replace my coding in VB.Net with b4j and I could develope desktop-apps with B4J as well?