Given that PtDBContainer() cannot handle it, the below attempt at drawing
with a memory context draws, but the colors are still wrong.
I’m puzzled because I can draw to the screen by just overlapping images
with three different image labels just fine with the right color.
Is there something I could be missing? Here’s the code. I will send
a .tgz file of the PhAB project if anyone is interested. Hopefully there
are some memory context experts out there.
Thanks in advance,
Barry
////////////////////////////////////////////////////////////////////////////////
void BuildImage4( void )
{
PhImage_t *base = animProgressImages[ animProgressImageIndex ];
PhImage_t *overlay = animProcessingImages[ animProcessingImageIndex ];
PhImage_t *icon = progressTypeWeigh;
PhImage_t result;
memcpy( &result, base, sizeof( PhImage_t ) );
result.type = Pg_IMAGE_DIRECT_888; // 3 bytes per pixel
result.image = 0;
PhPoint_t translation = { 0, 0 };
mc = PmMemCreateMC( &result, &result.size, &translation );
PmMemStart( mc );
PhPoint_t size = { 125, 128 };
PhPoint_t size2 = { 51, 64 };
PhDim_t dim = { 125, 128 };
PhDim_t dim2 = { 51, 64 };
PhPoint_t position = { 0, 0 }; //x,y
PhPoint_t position2 = { 37, 32 }; //x,y
// Draw the non-transparent progress image as a base (goes in a circle).
PgDrawImage( base->image, base->type, &position, &size, base->bpl, base->image_tag );
// Overlay a processing indicator (goes in a circle).
PgDrawTImage( overlay->image, overlay->type, &position, &dim, overlay->bpl,
overlay->image_tag, overlay->mask_bm, overlay->mask_bpl );
// Overlay an icon to indicate what kind of progress.
PgDrawImage( icon->image, icon->type, &position2, &size2, icon->bpl, icon->image_tag );
PmMemFlush( mc, &result ); // get the image
PmMemStop( mc );
// SetImage is my function which loads the PtLabel with the image.
SetImage( ABW_MyImage, &result );
PmMemReleaseMC( mc );
}