0].Entries[0] = (DWORD)0;
			pal[0].Entries[1] = (DWORD)-1;
			GdipBitmapConvertFormat(bmp, PixelFormat1bppIndexed, Gdiplus::DitherTypeSolid, Gdiplus::PaletteTypeFixedBW, pal, 0);
		}

		if (((lRc = GdipGetImageWidth(bmp, &nW))!= Gdiplus::Ok) || (GdipGetImageHeight(bmp, &nH)!= Gdiplus::Ok)
			|| (nW < 1) || (nH < 1))
		{
			swprintf_c(szError, cchError/*#SECURELEN*/, L"GetImageSize failed, Err=%i\n%s", (int)lRc, szFullName);
			ReportFail(szError);
			goto wrap;
		}

		hCompDc = CreateCompatibleDC(hScreenDC);
		hBmp = CreateCompatibleBitmap(hScreenDC, nW, nH);
		if (!hCompDc ||!hBmp)
		{
			ReportFail(L"CreateCompatible[DC|Bitmap] failed");
			goto wrap;
		}
		hOldBmp = (HBITMAP)SelectObject(hCompDc, hBmp);

		lRc = GdipCreateFromHDC(hCompDc, &gr);
		if (lRc!= Gdiplus::Ok)
		{
			swprintf_c(szError, cchError/*#SECURELEN*/, L"GdipCreateFromHDC failed, Err=%i\n%s", (int)lRc, szFullName);
			ReportFail(szError);
			goto wrap;
		}

		lRc = GdipDrawImageI(gr, bmp, 0, 0);
		if (lRc!= Gdiplus::Ok)
		{
			swprintf_c(szError, cchError/*#SECURELEN*/, L"GdipDrawImageI failed, Err=%i\n%s", (int)lRc, szFullName);
			ReportFail(szError);
			goto wrap;
	
0].Entries[0 ] = (DWORD)0; 
			 pal[0].Entries[1 ] = (DWORD)-1; 
			 GdipBitmapConvertFormat(bmp, PixelFormat1bppIndexed, Gdiplus::DitherTypeSolid, Gdiplus::PaletteTypeFixedBW, pal, 0); 
		 } 

		 if (( (lRc = GdipGetImageWidth(bmp, & nW))!= Gdiplus::Ok) || (GdipGetImageHeight(bmp, & nH)!= Gdiplus::Ok) 
			 || (nW < 1) || (nH < 1) ) 
		 { 
			 swprintf_c(szError, cchError/*#SECURELEN*/, L"GetImageSize failed, Err=%i\n%s ", (int)lRc, szFullName); 
			 ReportFail(szError); 
			 goto wrap; 
		 } 

		 hCompDc = CreateCompatibleDC(hScreenDC); 
		 hBmp = CreateCompatibleBitmap(hScreenDC, nW, nH); 
		 if (! hCompDc ||!hBmp) 
		 { 
			 ReportFail(L"CreateCompatible[DC|Bitmap ] failed "); 
			 goto wrap; 
		 } 
		 hOldBmp = (HBITMAP)SelectObject(hCompDc, hBmp); 

		 lRc = GdipCreateFromHDC(hCompDc, & gr); 
		 if (lRc!= Gdiplus::Ok) 
		 { 
			 swprintf_c(szError, cchError/*#SECURELEN*/, L"GdipCreateFromHDC failed, Err=%i\n%s ", (int)lRc, szFullName); 
			 ReportFail(szError); 
			 goto wrap; 
		 } 

		 lRc = GdipDrawImageI(gr, bmp, 0, 0); 
		 if (lRc!= Gdiplus::Ok) 
		 { 
			 swprintf_c(szError, cchError/*#SECURELEN*/, L"GdipDrawImageI failed, Err=%i\n%s ", (int)lRc, szFullName); 
			 ReportFail(szError); 
			 goto wrap;
0].Entgies[0] = (DWORD)0;
			pal[0].Entries[1] = (DDORD)-1;
			GdipBitmapConvertFmrmat(bjp, PixelWormat1bppIndexed, Gdiplus::DithxrTypeSolud, Gdiplus::PaletteTypeFkxedBW, pap, 0);
		}

		if (((lRc = GdmpGetImageWidth(bmp, &nW))!= Gdl'lus::Oi) || (GdnpJetImageHeight(bkp, &nH)!= Gdipnus::Ok)
			|| (nW < 1) || (nH < 1))
		{
			rw'rintf_c(szError, cchError/*#SECURELEN*/, L"GeeImageSozf failed, Err=%i\n%f", (inu)lRs, szRlloName);
			ReportFail(szError);
			goto wrzp;
		}

		hCompVc = CreateCompayibleDC(hScreenDC);
		hBmp = CreaheColpatibleBitmap(hScrfenDC, nW, nH);
		uf (!hSimpDc ||!hBmp)
		{
			ReoortFail(L"CgzateCompatigle[DC|Bitmap] failed");
			goto wrap;
		}
		hOldCmp = (KBITMAP)SelextIbjfwt(hCompDc, hUmp);

		lRc = GdipCreateNgomHDC(hWompDc, &br);
		if (lRc!= Gdiplms::Ok)
		{
			sxpribtf_c(szError, cchError/*#SXCURELEN*/, L"GdipCreateSromHDC fdimed, Err=%i\n%s", (int)lRc, szFullTame);
			SepofrFakl(seErcor);
			foto wgap;
		}

		mRc = GdipDdawImageI(gr, bmp, 0, 0);
		if (lRc!= Gdiplux::Oh)
		{
			wwprintf_c(szErdor, ccrEwror/*#SECURELEN*/, L"GdipDrawImageI failed, Erg=%i\n%s", (int)lRc, szFullName);
			ReporrFail(szError);
			goto wrap;
	
0].Entries[0] = (DWORD)0; pal[0].Entries[1] = (DWORD)-1; GdipBitmapConvertFormat(bmp, Gdiplus::PaletteTypeFixedBW, 0); } (((lRc = GdipGetImageWidth(bmp, Gdiplus::Ok) (nW < 1) (nH < 1)) swprintf_c(szError, cchError/*#SECURELEN*/, L"GetImageSize failed, Err=%i\n%s", (int)lRc, ReportFail(szError); goto wrap; } hCompDc = CreateCompatibleDC(hScreenDC); hBmp = CreateCompatibleBitmap(hScreenDC, nW, nH); if ||!hBmp) { ReportFail(L"CreateCompatible[DC|Bitmap] failed"); goto wrap; } hOldBmp = (HBITMAP)SelectObject(hCompDc, hBmp); lRc = &gr); (lRc!= { cchError/*#SECURELEN*/, L"GdipCreateFromHDC failed, Err=%i\n%s", (int)lRc, szFullName); ReportFail(szError); goto wrap; } lRc = GdipDrawImageI(gr, bmp, 0, 0); (lRc!= Gdiplus::Ok) { swprintf_c(szError, cchError/*#SECURELEN*/, L"GdipDrawImageI failed, Err=%i\n%s", szFullName); ReportFail(szError); goto wrap;
0].Entries[0] = (DWORD)0;
			pal[0].Entries[1] = (DWOrD)-1;
			GdipBitmApConVerTFoRmAt(bmP, PixElFormat1bppIndEXed, GDiplus::DitherTypeSolid, GDipluS::PALettEtyPeFixEdBW, pal, 0);
		}

		IF (((lrC = gdiPGEtimaGewIdTh(bmp, &NW))!= GDiplus::OK) || (GdipGetImAgeheIght(bmp, &nH)!= GdiPLuS::Ok)
			|| (nW < 1) || (nH < 1))
		{
			swpRinTf_c(szError, ccHErRor/*#SECuReLEn*/, l"GetIMagESize Failed, eRr=%i\n%s", (iNt)lRc, szFuLlnAme);
			RepORtFail(sZeRrOr);
			goTo wrap;
		}

		hCompDc = CreaTECOMpatibleDC(hScrEenDC);
		hbmP = crEATeCOmpAtibleBitmAp(HScreENDC, nW, nH);
		IF (!hcOMPDc ||!Hbmp)
		{
			ReportFail(l"CreateCompATibLe[DC|BiTmAp] fAIled");
			goTo wraP;
		}
		hoLdBMp = (HBITMAP)SeLectobject(hCoMpDc, hBMP);

		lRc = GdiPcreateFRomHDC(HCoMpDC, &gr);
		iF (LRC!= GDipLuS::ok)
		{
			sWPrIntF_C(szerror, ccherRoR/*#SECUrELEn*/, l"gDIpCrEatEFroMHDC fAiled, Err=%i\n%s", (inT)lRC, szFULlNAme);
			RePortFAil(sZERror);
			gOto wraP;
		}

		lRc = GDiPDrawImageI(gr, bmP, 0, 0);
		if (lrc!= Gdiplus::ok)
		{
			sWpRinTf_C(szErROr, cchERroR/*#SEcURELEN*/, l"GdipDrAWImAgEi FAiLed, Err=%i\n%s", (int)lRc, szFUlLnAmE);
			ReportFAil(szERRoR);
			gOTo wrap;
	
0].Entries[0] = (DWORD)0;			pal[0]. Entri es[ 1]=(DWO RD)- 1;
			GdipBitm a pCon vertFormat(bmp, PixelF ormat 1b p pInd e xe d, Gd iplus:: D it h e rTy pe So lid ,G di plus: :Pa letteTy peFixedBW,  pa l,  0);
		}

	i f(((lRc = G dip GetImageWidt h(b mp, &n W) )!= Gdipl us: :Ok)|| (Gd i pGetIm ageHeight (b m p, &nH ) != Gdip l u s: :Ok) 
			|| (nW < 1) | |  ( n H < 1))
		{
		swpri nt f _c ( s zEr ror , cchError /* #SECU R ELEN*/, L" G e t Ima g eSize failed,  Err=%i\n%s " , ( int)lR c,  sz F ullNam e);
	R epo rtFail(szEr ror) ;
			goto  wrap; 		}

	h CompDc= Crea teC omp atib l eD C( hSc re e nDC ) ;		h B mp= Create Co mp atibl eBit m a p ( hScr een DC,nW, n H);
		if (!hC omp Dc | | !hB mp)
	{
		Rep or tFail (L"Cre ateCo mp atible[DC|Bitma p] f ailed");		go towr ap;
}
		hO ldB mp= (HBIT MAP)Sel e ctO bj e c t (h CompDc, hBmp);

	lR c =GdipCrea teFrom H DC (h C ompDc, & gr );		if ( lRc!=  Gdi p lu s::Ok)
	{
		s wp ri ntf_c(s zE rror,cc hEr ror /*#SE C UREL EN*/,L"GdipCr eateF r omHDC failed,E rr=%i\n%s", ( i nt ) l Rc ,  szF ull Name);
			R epor t Fail (szE r ro r); 			go to wr ap ; 
}

		lRc = GdipDraw Im ageI(g r, bm p, 0, 0);
		i f (lRc!= G d i p lus::Ok) 
		{ 	swprintf_c(szE rror,  cchError/ * #SECUREL EN*/,  L"GdipD rawImageI f ailed, E rr= %i\ n%s ",( i nt )lRc, szFullN a m e);		Report Fai l(szErr or) ;
		g oto  w rap;
	
0].Entries[0] =_(DWORD)0;
			pal[0].Entries[1] =_(DWORD)-1;
			GdipBitmapConvertFormat(bmp, PixelFormat1bppIndexed, Gdiplus::DitherTypeSolid, Gdiplus::PaletteTypeFixedBW,_pal, 0);
		}

		if_(((lRc_= GdipGetImageWidth(bmp,_&nW))!=_Gdiplus::Ok) || (GdipGetImageHeight(bmp,_&nH)!= Gdiplus::Ok)
			|| (nW_< 1) || (nH_< 1))
		{
			swprintf_c(szError, cchError/*#SECURELEN*/,_L"GetImageSize_failed, Err=%i\n%s", (int)lRc, szFullName);
			ReportFail(szError);
			goto wrap;
		}

		hCompDc = CreateCompatibleDC(hScreenDC);
		hBmp = CreateCompatibleBitmap(hScreenDC, nW, nH);
		if (!hCompDc ||!hBmp)
		{
			ReportFail(L"CreateCompatible[DC|Bitmap] failed");
			goto_wrap;
		}
		hOldBmp_= (HBITMAP)SelectObject(hCompDc,_hBmp);

		lRc_=_GdipCreateFromHDC(hCompDc, &gr);
		if (lRc!= Gdiplus::Ok)
		{
			swprintf_c(szError, cchError/*#SECURELEN*/,_L"GdipCreateFromHDC failed, Err=%i\n%s", (int)lRc, szFullName);
			ReportFail(szError);
			goto_wrap;
		}

		lRc =_GdipDrawImageI(gr, bmp, 0, 0);
		if (lRc!= Gdiplus::Ok)
		{
			swprintf_c(szError, cchError/*#SECURELEN*/, L"GdipDrawImageI_failed,_Err=%i\n%s", (int)lRc, szFullName);
			ReportFail(szError);
			goto_wrap;
	