On 14/01/2014 at 15:13, xxxxxxxx wrote:
Yeah, I should have included some code, sorry about that. Thanks for the quick response and awesome code. I haven't gotten to look at your code extensively but I think I'm trying to do something slightly different than what you did.
//Message Function
case MSG_DESCRIPTION_GETBITMAP:
{
DescriptionGetBitmap* dgb = static_cast<DescriptionGetBitmap*>(data);
if(dgb->id[0] == idBitmapButton)
{
AutoAlloc<BaseBitmap> bm;
Filename bg ;
bg = "test.jpg";
bm->Init(bg);
dgb->bmp = bm.Release();
}
}
Bool TestTag::GetDParameter(GeListNode *node, const DescID &id, GeData &t_data, DESCFLAGS_GET &flags)
{
switch(id[0].id)
{
case idBitmapButton:
{
BaseContainer bc= GetCustomDataTypeDefault(DTYPE_BUTTON);
bc.SetBool(DESC_HIDE, buttonOn);
LONG dirty = 0;
BitmapButtonStruct bbs(static_cast<BaseObject*>(node), id, dirty);
t_data = GeData(CUSTOMDATATYPE_BITMAPBUTTON, bbs);
flags |= DESCFLAGS_GET_PARAM_GET;
break;
}
}
return SUPER::GetDParameter(node, id, t_data, flags);
//Code from Execute
BaseBitmap* basebitmap=BaseBitmap::Alloc() ;
basebitmap->Init(100, 100, 24, INITBITMAPFLAGS_0);
for (LONG X =0; X<100; X++)
{
for (LONG Y =0; Y<100; Y++)
{
basebitmap->SetPixel(X, Y,Mod(GeGetTimer(),200) , Mod(GeGetTimer(),210), Mod(GeGetTimer(),80));
}
}
BaseContainer* bctest;
basebitmap->Save("test.jpg", FILTER_TIF, bctest, SAVEBIT_0);
DescriptionGetBitmap bitmapdatatype;
bitmapdatatype.id = DescID(idBitmapButton);
bitmapdatatype.bmp = basebitmap;
tag->Message(MSG_DESCRIPTION_GETBITMAP,&bitmapdatatype);
So I have a jpg being overridden all of the time and then I'm trying to have the button update to show what the image is currently. Instead it only updates when I hit the button or when I unselect the tag and then reselect it.
I thought
tag->Message(MSG_DESCRIPTION_GETBITMAP,&bitmapdatatype);
would do the trick but apparently not.
Dan