Just popping in
|
Hi Amigans, I need a fast help to resolve a issue about 8 bit (256 colors) images. The following snippet code works ok with 24 bit images but fails to load 8 bit ones. I don't need to load 15/16 bit pictures. The image is displayed but with less colors. I grabbed code from Thomas examples
int32 LoadPic (struct ILBMInfo *ilbm, uint8 *filename) { int32 Error; uint32 Width, Height, Depth; Object *dto;
Error = TRUE; Width = ilbm->Bmhd.w; Height = ilbm->Bmhd.h; Depth = ilbm->Bmhd.nPlanes;
if ((Depth == MIN_DEPTH) || (Depth == MAX_DEPTH)) { if((dto = NewDTObject(filename, DTA_SourceType, DTST_FILE, DTA_GroupID, GID_PICTURE, PDTA_Screen,ilbm->scr, PDTA_UseFriendBitMap,TRUE, PDTA_DestMode, PMODE_V43, TAG_END))) { SetDTAttrs(dto,NULL,NULL, GA_Left, 0, GA_Top, 0, GA_Width, Width, GA_Height, Height, ICA_TARGET, ICTARGET_IDCMP, TAG_END); AddDTObject(ilbm->win,NULL,dto,-1); RefreshDTObjects(dto,ilbm->win,NULL,NULL); RemoveDTObject(ilbm->win,dto); DisposeDTObject(dto); Error = FALSE; } }
return Error; }
|