Gradient image | developer.brewmp.com Gradient image | developer.brewmp.com

Developer

Gradient image

Forums:

Hi,

How to get support for partial(semi) transperency . code below fails for semi transperancy

IIMAGE_SetParm(img->m_pIImage, IPARM_ROP,AEE_RO_TRANSPARENT,RGB_BLACK);
IIMAGE_Draw(img->m_pIImage,x,y);

Hi,
I feel I should put my question this way... I have transparent image say A.png which is having shaded colors in border , when I used above code image is shown properly but shaded boders are ignored though mask I have used is for black only, why other colors are ignored? coz tht seems the only reason for me not showing shaded borders.....
regards

Hi,
I feel I should put my question this way... I have transparent image say A.png which is having shaded colors in border , when I used above code image is shown properly but shaded boders are ignored though mask I have used is for black only, why other colors are ignored? coz tht seems the only reason for me not showing shaded borders.....
regards

Actually need of partial transperancy is to show shaded boders around my otherwise fully transparent image...any suggestion???
regards

Actually need of partial transperancy is to show shaded boders around my otherwise fully transparent image...any suggestion???
regards

You need to implement your own methods for image blending...
The following code will get a background pixel and it will blend with the user set color pixel. By reducing the opacity from 100 to 0 you can see the transperancy levels. This example is for 16bit color device and this is generic and should work on any color device without any issue.
Run this code in a loop which gets each pixel color of a set rectangle and set the pixel with your own color & opacity value for transperancy check.
if opacity = 100, you won't able to see backgroung color.
if opacity=0, you wont able to see the foreground color.
Quote:
typedef union _mynative
{
uint16 color;
struct{
uint16 B:5; // 31 - 255 == 0.122
uint16 G:6; // 63 - 255 == 0.248
uint16 R:5; // 31 - 255 == 0.122
stct;
mynative;
NativeColor pColor;
uint16 i,y;
int opacity=100; // your transperancy value....
mynative mynativelocal;
mynative mynativeget;
mynative mynativeset;
mynativeset.color = 2016; // Foreground color
// where pMe->pIBitmap is the device display btmap....
IBITMAP_GetPixel(pMe->pIBitmap,x,y,&pColor); // To get the background color.
mynativeget.color=(uint16)pColor;
mynativelocal.stct.R = (mynativeget.stct.R + (uint16)( (opacity*(mynativeset.stct.R-mynativeget.stct.R))/100 ) );
mynativelocal.stct.G = (mynativeget.stct.G + (uint16)( (opacity*(mynativeset.stct.G-mynativeget.stct.G))/100 ) );
mynativelocal.stct.B = (mynativeget.stct.B + (uint16)( (opacity*(mynativeset.stct.B-mynativeget.stct.B))/100 ) );
IBITMAP_SetPixels(pMe->pIBitmap1,1,&point,mynativelocal.color,AEE_RO_COPY);

You need to implement your own methods for image blending...
The following code will get a background pixel and it will blend with the user set color pixel. By reducing the opacity from 100 to 0 you can see the transperancy levels. This example is for 16bit color device and this is generic and should work on any color device without any issue.
Run this code in a loop which gets each pixel color of a set rectangle and set the pixel with your own color & opacity value for transperancy check.
if opacity = 100, you won't able to see backgroung color.
if opacity=0, you wont able to see the foreground color.
Quote:
typedef union _mynative
{
uint16 color;
struct{
uint16 B:5; // 31 - 255 == 0.122
uint16 G:6; // 63 - 255 == 0.248
uint16 R:5; // 31 - 255 == 0.122
stct;
mynative;
NativeColor pColor;
uint16 i,y;
int opacity=100; // your transperancy value....
mynative mynativelocal;
mynative mynativeget;
mynative mynativeset;
mynativeset.color = 2016; // Foreground color
// where pMe->pIBitmap is the device display btmap....
IBITMAP_GetPixel(pMe->pIBitmap,x,y,&pColor); // To get the background color.
mynativeget.color=(uint16)pColor;
mynativelocal.stct.R = (mynativeget.stct.R + (uint16)( (opacity*(mynativeset.stct.R-mynativeget.stct.R))/100 ) );
mynativelocal.stct.G = (mynativeget.stct.G + (uint16)( (opacity*(mynativeset.stct.G-mynativeget.stct.G))/100 ) );
mynativelocal.stct.B = (mynativeget.stct.B + (uint16)( (opacity*(mynativeset.stct.B-mynativeget.stct.B))/100 ) );
IBITMAP_SetPixels(pMe->pIBitmap1,1,&point,mynativelocal.color,AEE_RO_COPY);

AEE_RO_BLEND, for alpha blending, was added in BREW 3.1.5.
-Erik

AEE_RO_BLEND, for alpha blending, was added in BREW 3.1.5.
-Erik

Hi ebrowne
Can I set the blend effect i.e alpha blend level(any where between 0 - 100)?????
But with the sample code, irrespetive of the image alpha, one can set their transparency level any where between 0-100% and its generic, works on any brew version.

Hi ebrowne
Can I set the blend effect i.e alpha blend level(any where between 0 - 100)?????
But with the sample code, irrespetive of the image alpha, one can set their transparency level any where between 0-100% and its generic, works on any brew version.

Thanks Brewin.
I have achieved the transparency by using your algorithm publish in the forum.
Thanks
Swami

Thanks Brewin.
I have achieved the transparency by using your algorithm publish in the forum.
Thanks
Swami