MCPcopy Create free account
hub / github.com/cinience/RedisStudio / DrawImageString

Method DrawImageString

DuiLib/Core/UIRender.cpp:932–1048  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

930}
931
932bool CRenderEngine::DrawImageString(HDC hDC, CPaintManagerUI* pManager, const RECT& rc, const RECT& rcPaint,
933 LPCTSTR pStrImage, LPCTSTR pStrModify)
934{
935 if ((pManager == NULL) || (hDC == NULL)) return false;
936
937 // 1��aaa.jpg
938 // 2��file='aaa.jpg' res='' restype='0' dest='0,0,0,0' source='0,0,0,0' corner='0,0,0,0'
939 // mask='#FF0000' fade='255' hole='false' xtiled='false' ytiled='false'
940
941 CDuiString sImageName = pStrImage;
942 CDuiString sImageResType;
943 RECT rcItem = rc;
944 RECT rcBmpPart = {0};
945 RECT rcCorner = {0};
946 DWORD dwMask = 0;
947 BYTE bFade = 0xFF;
948 bool bHole = false;
949 bool bTiledX = false;
950 bool bTiledY = false;
951
952 int image_count = 0;
953
954 CDuiString sItem;
955 CDuiString sValue;
956 LPTSTR pstr = NULL;
957
958 for( int i = 0; i < 2; ++i,image_count = 0 ) {
959 if( i == 1)
960 pStrImage = pStrModify;
961
962 if( !pStrImage ) continue;
963
964 while( *pStrImage != _T('\0') ) {
965 sItem.Empty();
966 sValue.Empty();
967 while( *pStrImage > _T('\0') && *pStrImage <= _T(' ') ) pStrImage = ::CharNext(pStrImage);
968 while( *pStrImage != _T('\0') && *pStrImage != _T('=') && *pStrImage > _T(' ') ) {
969 LPTSTR pstrTemp = ::CharNext(pStrImage);
970 while( pStrImage < pstrTemp) {
971 sItem += *pStrImage++;
972 }
973 }
974 while( *pStrImage > _T('\0') && *pStrImage <= _T(' ') ) pStrImage = ::CharNext(pStrImage);
975 if( *pStrImage++ != _T('=') ) break;
976 while( *pStrImage > _T('\0') && *pStrImage <= _T(' ') ) pStrImage = ::CharNext(pStrImage);
977 if( *pStrImage++ != _T('\'') ) break;
978 while( *pStrImage != _T('\0') && *pStrImage != _T('\'') ) {
979 LPTSTR pstrTemp = ::CharNext(pStrImage);
980 while( pStrImage < pstrTemp) {
981 sValue += *pStrImage++;
982 }
983 }
984 if( *pStrImage++ != _T('\'') ) break;
985 if( !sValue.IsEmpty() ) {
986 if( sItem == _T("file") || sItem == _T("res") ) {
987 if( image_count > 0 )
988 DuiLib::DrawImage(hDC, pManager, rc, rcPaint, sImageName, sImageResType,
989 rcItem, rcBmpPart, rcCorner, dwMask, bFade, bHole, bTiledX, bTiledY);

Callers

nothing calls this directly

Calls 4

DrawImageFunction · 0.85
IsEmptyMethod · 0.80
EmptyMethod · 0.45
GetDataMethod · 0.45

Tested by

no test coverage detected