ホーム » VC » E_MetaF クラスの使い方

E_MetaF クラスの使い方

以前作成した EMF を扱うクラスのサンプルを用意.
次の様に利用可能.

bool	test	(c_tstring& str)
{
	std::tout << str << std::endl ;
	HWND	hWnd = ::GetConsoleHwnd() ;
	RECT	rect =	{	0	} ;
	{
		::GetClientRect(hWnd,&rect) ;
		}
	{
		HDC	hDC  = ::GetDC(hWnd) ;
		{
			::DrawText(hDC,str.c_str(),-1,&rect,DT_CENTER | DT_VCENTER | DT_SINGLELINE) ;
			}
		::ReleaseDC(hWnd,hDC) ;
		}
	tstring	emf_name ;
	{
		emf_name = ::Get_TMP_path() + _T("\\") + str + _T(".emf") ;
		}
	{
		E_MetaF	e_mf(emf_name.c_str()) ;
		HDC	eDC = e_mf.Get_HDC() ;
		{
			::DrawText(eDC,str.c_str(),-1,&rect,DT_CENTER | DT_VCENTER | DT_SINGLELINE) ;
			}
		}
	return	E_MetaF::Play(hWnd,emf_name.c_str()) ;
	}

次の画像は E_MetaF::Play(::GetConsoleHwnd(),emf_path.c_str()) としたもの.
E_MetaF::Play(::GetConsoleHwnd(),emf_path.c_str()) ;
https://itl.mish.work/i_Tools/Doc/blog/vc/T_emf.zip

Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.