B4J Question B4XImageView in B4J

Colin Evans

Active Member
Licensed User
Longtime User
Hi, can anyone please help, I'm trying to implement a playing card display, and one of the examples in B4A shows the display using B4XImageView but the syntax isn't the same in B4J

Example in B4J in the FlipCards example the following code seems okay

B4X:
For X = 0 To Columns - 1
        For Y = 0 To Rows - 1
            B4XImgViewCard(Counter).Initialize(Me, "B4XImgViewCard")
            B4XImgViewCard(Counter).AddToParent(PnlMain, OffSetX + x * (CardSize + 10dip), OffSetY + y * (CardSize + 10dip), CardSize, CardSize)
            B4XImgViewCard(Counter).B4XBitmap = CardBack 'Set card back image
            B4XImgViewCard(Counter).Tag = $"${LstCards.Get(Counter)}~${Counter}"$ 'Store card name and card position

            MapRotation.Put(Counter, 0) 'Store card name and set rotation to 0 
            Counter = Counter + 1
        Next

But in B4J there is no option to .AddToParent or .B4XBitmap any idea's or work arounds would be greatly received, many thanks
 

Colin Evans

Active Member
Licensed User
Longtime User
Hi, thanks for the reply, I just thought B4X..... were the same in all languages, so if it was available in B4A it would have been in B4J, oh well maybe it's something for the future

Thanks for your suggestion I'll have a go, thanks again
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
Hi, thanks for the reply, I just thought B4X..... were the same in all languages, so if it was available in B4A it would have been in B4J, oh well maybe it's something for the future

Thanks for your suggestion I'll have a go, thanks again
Maybe I didn't explain well.
Not even in B4A does B4XImageView have the AddToParent method. I don't know what type that array of your code is.
 
Upvote 0

Colin Evans

Active Member
Licensed User
Longtime User
Thanks to both of you, I think I am / was confused with the example I downloaded from the forum, in post 9 of the following link


And on post 26 on the link, LucaMs, confused me more as he seemingly amended the code, which I can't run got errorss

Unknown member: b4xbitmap
Unknown member: b4xbitmap
Unknown member: b4xbitmap
Unknown member: rotate
Unknown member: rotate
Unknown member: b4xbitmap
Unknown member: addtoparent

In the logs
 
Last edited:
Upvote 0
Top