Drop Shadow in ver 2.67

Discussions on GFL SDK, the graphic library for reading and writing graphic files

Moderators: XnTriq, xnview

linojr99
Posts: 8
Joined: Thu Feb 15, 2007 3:57 pm

Drop Shadow in ver 2.67

Post by linojr99 »

:? I've tried using the new drop shadow feature and found I was unable to get the black shadow to appear. The white border is created but the black shadow is missing.
Is there documentation avaliable showing how to show the black color or any other color?
User avatar
xnview
Author of XnView
Posts: 36866
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: Drop Shadow in ver 2.67

Post by xnview »

linojr99 wrote::? I've tried using the new drop shadow feature and found I was unable to get the black shadow to appear. The white border is created but the black shadow is missing.
Is there documentation avaliable showing how to show the black color or any other color?
Could you tell me which parameters do you use?
Pierre.
linojr99
Posts: 8
Joined: Thu Feb 15, 2007 3:57 pm

GFL_SDK ver 2.67 Drop shadow problem

Post by linojr99 »

private: int _DropShadow(HBITMAP & src, HBITMAP & dest, int size, int depth, int keep_size);
public: int DropShadow(Image & src, Image *& dest, int size, int depth, int keep_size);
public: int DropShadowF(String * src, String * dest, int size, int depth, int keep_size);

/////////////////////////////////////////////////////////////////////////////////////
// DropShadow
//
int Converter::Effects::_DropShadow(HBITMAP & src, HBITMAP & dest, int size, int depth, int keep_size)
{
int error;
GFL_BITMAP * src_bmp = NULL;
GFL_BITMAP * dest_bmp = NULL;

error=gflConvertDDBIntoBitmap(src,&src_bmp);
if(error) return error;
error=gflDropShadow(src_bmp,&dest_bmp,size,depth,keep_size);
if(error) return error;
error=gflConvertBitmapIntoDDB(dest_bmp,&dest);
FreeGFLBitmap(src_bmp);
FreeGFLBitmap(dest_bmp);

return error;
}
int Converter::Effects::DropShadow(Image & src, Image *& dest, int size, int depth, int keep_size)
{
HBITMAP src_bmp=NULL, dest_bmp=NULL;
int error;

src_bmp=getHBitmap(src);
error=_DropShadow(src_bmp, dest_bmp,size,depth,keep_size);
if(!error) dest=getImage(dest_bmp);
FreeHBitmap(src_bmp);
FreeHBitmap(dest_bmp);

return error;
}
int Converter::Effects::DropShadowF(String * src, String * dest, int size, int depth, int keep_size)
{
int error;
GFL_BITMAP *src_bmp=NULL,*dest_bmp=NULL;
GFL_LOAD_PARAMS load_params;
GFL_FILE_INFORMATION informations;
GFL_SAVE_PARAMS gfl_save_params;

gflGetDefaultLoadParams(&load_params);
error=gflLoadBitmap(toChars(src),&src_bmp,&load_params,&informations);
if(error) return error;
ChangeToRGB(src_bmp,&src_bmp);
error=gflDropShadow(src_bmp,&dest_bmp,size,depth,keep_size);
if(error) return error;
PrepareToSave(src,dest_bmp,gfl_save_params,informations);
error=gflSaveBitmap(toChars(dest),dest_bmp,&gfl_save_params);
FreeGFLBitmap(src_bmp);
FreeGFLBitmap(dest_bmp);
gflFreeFileInformation(&informations);

return error;
}
User avatar
xnview
Author of XnView
Posts: 36866
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: GFL_SDK ver 2.67 Drop shadow problem

Post by xnview »

Do you have tried on simple code like Load/DropShadow/Save??
Pierre.