int
main
	(
	int		argc,
	char*	argv[]
	)
{
	JString fileName;
	JBoolean printInfo;
	int transparentColor;
	LaceOption interlace;
	JBoolean padColormap;
	JBoolean blend;
	JFloat alpha;
	JRGB alphaColor;
	JString blendOutput;
	ParseOptions(argc, argv, &fileName, &printInfo, &transparentColor,
				 &interlace, &padColormap, &blend, &alpha, &alphaColor, &blendOutput);

	JBoolean changed = kJFalse;
	gdImagePtr image = ReadGIF(fileName);

	if (printInfo)
		{
		PrintGIFInfo(image);
		}

	if (SetTransparentColor(image, transparentColor))
		{
		changed = kJTrue;
		}

	if (SetInterlace(image, interlace))
		{
		changed = kJTrue;
		}

	if (padColormap && PadColormap(image))
		{
		changed = kJTrue;
		}

	if (blend)
		{
		Blend(image, alpha, alphaColor, blendOutput);
		}

	if (changed)
		{
		WriteGIF(image, fileName);
		}

	gdImageDestroy(image);
	return 0;
}
// CDlgAppConfig 消息处理程序
void CDlgAppConfig::InitWidowsBG()
{
	//设置任务栏显示窗体的Title信息
	CString str;
	this->GetDlgItemText(STATIC_TITLE,str);
	SetWindowText(str);
	EnableEasyMove(1);                       // 允许移动
	SetBitmap(_T("res/appconfigbg.bmp"));    // 设置背景位图
	SetStyle(LO_STRETCH);                   // 伸缩图片以适合对话框大小
	SetTransparentColor(RGB(0, 255, 0));     // 设置透明色为绿色
	CRect   temprect(0,0,470,450);			 // 设置窗体的初始化大小
	CWnd::SetWindowPos(NULL,0,0,temprect.Width(),temprect.Height(), SWP_NOZORDER|SWP_NOMOVE);
	GetDlgItem(BTN_MAX)->EnableWindow(FALSE);
}
示例#3
0
LTBOOL CBitmapCtrl::Create(ILTClient *pClientDE,  char *lpszNormalBmp,char *lpszSelectedBmp,char *lpszDisabledBmp,
                            CLTGUICommandHandler *pCommandHandler, uint32 dwCommandID, uint32 dwParam1, uint32 dwParam2)
{
	m_pClientDE=pClientDE;
	m_pCommandHandler=pCommandHandler;
	// The transparent color
	SetTransparentColor(SETRGB_T(255,0,255));

	if (SetBitmap(lpszNormalBmp,lpszSelectedBmp,lpszDisabledBmp))
	{
		CLTGUICtrl::Create(dwCommandID,dwParam1,dwParam2);
        return LTTRUE;
	}
	else
        return LTFALSE;
}