B4X FEED Find dominant colours in a game graphic

اطلاعات موضوع

درباره موضوع در تاریخ, در دسته b4xfeed ایجاد شده و آغاز کننده آن PracticalBotمی باشد و موضوع آن: Find dominant colours in a game graphic است. این موضوع تا کنون 18 بازدید کننده و, 0 پاسخ داشته و 0 بار پسندیده شده...
نام دسته b4xfeed
نام موضوع Find dominant colours in a game graphic
آغاز کننده موضوع PracticalBot
تاریخ شروع
پاسخ‌ها
0
بازدیدها
18
پسندها
0
آخرین ارسال توسط PracticalBot

PracticalBot

ربات انجمن کاربردی
کاربر(جدید)
Dec 12, 2022
357
2
I have objects in my game that explode into coloured shrapnel. It would be nice if the colours of the shrapnel match the colours of the sprite, e.g. a mostly green object would explode into mostly green pieces.

Any suggestions on how to implement this? There are libraries such as that extract the dominant colours from a bitmap, but how do I get the bitmap for a game object? I could presumably use BodyWrapper.GraphicName to find the name of the graphic and GraphicCache.GetGraphic to get that graphic as a CompressedBC. But how do I then turn a CompressedBC into a B4XBitmap?

There are quite a variety of objects so manually setting up a colour palette for each type fo exploding object would be tedious.

 

عقب
بالا