[haiku-bluetooth] Re: B_RGBA32 Problem Code

Hi
I tested this code not with the media/iconfile.h. I produced there for an
own iconfile.h with bitmap sources via Wonderbrush which are only aviable
for 32x32 elements and RGBA32 colorspace. The icons are rendered only to a
quator and are interrupted then. I do not know why! Therefore I asked for a
converter programm to scale the icon bitmap sources to 16x16 elements with
CMAP8 colorspace, because I know that this code does work correct!


2009/3/29 Oliver Ruiz Dorantes <oliver.ruiz.dorantes@xxxxxxxxx>

> Hi Joerg,
>
> After seeing the preferences/media/iconfile.h i think I get the problem,
>
> If you check the file, each Icon is an array of 16x16 elements, those
> elements are 1 byte size (ex 0xFF), well 2 hex numbers which make a 8 bits.
> Therefore these are arrays of 16x16 elements of 8 bits colorspace. Those
> cannot be used in a higher colorspace than 8 :(
>
> But I guess we could create another similar array for the bluetooth Icon.
>
> Great effort drawing a Phone stroking lines!
>
> I am commiting your patch anyways, so anybody can dump their artistic
> skills
>
> Thanks!
>
> 2009/3/29 Joerg Meyer <joerg.meyer@xxxxxxxxx>
>
> Here the missed code, sorry!
>>
>>  BRect iconRect(0,0,31,31);
>>     BBitmap *icon=new BBitmap(iconRect, B_RGBA32);
>>     owner->SetDrawingMode(B_OP_ALPHA);
>>         owner->SetBlendingMode(B_PIXEL_ALPHA, B_ALPHA_OVERLAY);
>>
>>     switch (fClass.GetMajorDeviceClass()) {
>>         case 1: // computer
>>             icon->SetBits(kterminalBits,32*32, 0, B_RGBA32);
>>             break;
>>         case 4: // audio/video
>>             icon->SetBits(kmediaBits,32*32, 0, B_RGBA32);
>>             break;
>>         default:
>>             icon->SetBits(kbluetoothBits,32*32, 0, B_RGBA32);
>>             break;
>>     }
>>     owner->DrawBitmap(icon, iconRect,BRect(itemRect.left + INSETS,
>> itemRect.top + INSETS,
>>             itemRect.left + INSETS + PIXELS_FOR_ICON, itemRect.top +
>> INSETS + PIXELS_FOR_ICON));
>>
>>
>> --
>> Joerg Meyer
>> <mailto://joerg.meyer@xxxxxxxxx>
>>
>
>
>
> --
> Oliver,
>
> http://urnenfeld.blogspot.com
>



-- 
Joerg Meyer
<mailto://joerg.meyer@xxxxxxxxx>

Other related posts: