Exemple #1
0
void CResizeView::OnFileSave() 
{
	// TODO: Add your command handler code here
	SavePic();
}
Exemple #2
0
/*
-----------------------------------------------------------------------------
 Function: LumpExtractor() -Extract Lump gfx from Wolf3D and SOD data files.
 
 Parameters: fextension -[in] String holding file extension 
                            (must be in '.XXX' format).
             limit -[in] max
             version -[in] extension version. 
                        1 -WL6
                        2 -SOD 
 
 Returns:   Nothing.
 
 Notes: 

-----------------------------------------------------------------------------
*/
PUBLIC _boolean LumpExtractor( const char *fextension, W32 limit, W16 version )
{
    W32 i;
    W8 *buffer, *buffer2;
	
    
    if( ! fextension || ! *fextension )
    {
        printf( "Invalid file extension passed into LumpExtractor!\n" );
        
		return false;
    }

//
// Setup
//

	if( 0 == FS_Mkdir( LGFXDIR ) )
	{
		printf( "[%s] Could not create directory (%s)!\n", "wolf_gfx.c", LGFXDIR );
		
		return false;
	}

    
    if( ! CAL_SetupGrFile( fextension ) )
	{
		CAL_Shutdown();
		
		return false;
	}
	
//
// Allocate buffers
//

	buffer = MM_MALLOC( 320 * 416 * 2 );
	if( buffer == NULL )
	{
		CAL_Shutdown();
		
		return false;
	}

    buffer2 = MM_MALLOC( 640 * 400 * 4 );
	if( buffer2 == NULL )
	{
		MM_FREE( buffer );
		CAL_Shutdown();
		
		return false;
	}

//
// Decode GFX data
//

	printf( "Decoding GFX Data...\n" );
	
//	(void)DecodeText( version );
	
	
	for( i = STARTFONT; i < STARTPICS; ++i )
    {
        CA_CacheGrChunk( i, version );
        Fontline( i, version );
    }
	
    
    for( i = STARTPICS; i < limit+1; ++i )
    {
        CA_CacheGrChunk( i, version );
        SavePic( i, version, buffer, buffer2 );		
    }
	


//
// Shutdown
//
    
    MM_FREE( buffer2 );
	MM_FREE( buffer );	
    
    CAL_Shutdown();

	return true;
}
Exemple #3
0
int CGetChatPicTask::Run()
{
	CBuffer bufPic;
	BOOL bRet;

	if (NULL == m_lpQQUser || NULL == m_lpQQProtocol || NULL == m_lpMsg)
	{
		m_bStop = FALSE;
		return 0;
	}

	if (OP_TYPE_BUDDY_PIC == m_nType)	// 好友图片
	{
		CBuddyMessage * lpMsg = (CBuddyMessage *)m_lpMsg;

		int nCount = (int)lpMsg->m_arrContent.size();
		for (int i = 0; i < nCount; i++)
		{
			CContent * lpContent = lpMsg->m_arrContent[i];
			if (NULL == lpContent)
				continue;
			
			if (CONTENT_TYPE_CUSTOM_FACE == lpContent->m_nType)		// 自定义表情
			{
				bRet = m_lpQQProtocol->GetBuddyChatPic(m_HttpClient, lpMsg->m_nMsgId,
					lpContent->m_CFaceInfo.m_strName.c_str(), lpMsg->m_nFromUin, 
					WEBQQ_CLIENT_ID, m_lpQQUser->m_LoginResult2.m_strPSessionId.c_str(), &bufPic);
				if (bRet)
					SavePic(lpContent->m_CFaceInfo.m_strName.c_str(), bufPic.GetData(), bufPic.GetSize());
			}
			else if (CONTENT_TYPE_OFF_PIC == lpContent->m_nType)	// 离线图片
			{
				bRet = m_lpQQProtocol->GetBuddyOffChatPic(m_HttpClient, 
					lpContent->m_CFaceInfo.m_strName.c_str(), lpMsg->m_nFromUin, 
					WEBQQ_CLIENT_ID, m_lpQQUser->m_LoginResult2.m_strPSessionId.c_str(), &bufPic);
				if (bRet)
					SavePic(lpContent->m_CFaceInfo.m_strName.c_str(), bufPic.GetData(), bufPic.GetSize());
			}
		}

		::PostMessage(m_lpQQUser->m_hProxyWnd, QQ_MSG_BUDDY_MSG, NULL, (LPARAM)lpMsg);
	}
	else if (OP_TYPE_GROUP_PIC == m_nType)	// 群图片
	{
		CGroupMessage * lpMsg = (CGroupMessage *)m_lpMsg;

		int nCount = (int)lpMsg->m_arrContent.size();
		for (int i = 0; i < nCount; i++)
		{
			CContent * lpContent = lpMsg->m_arrContent[i];
			if (lpContent != NULL && CONTENT_TYPE_CUSTOM_FACE == lpContent->m_nType)
			{
				LPCTSTR lpFmt = _T("%[^:]:%d");
				TCHAR cServer[1024] = {0};
				int nPort = 0;

				_stscanf(lpContent->m_CFaceInfo.m_strServer.c_str(), lpFmt, cServer, &nPort);

				bRet = m_lpQQProtocol->GetGroupChatPic(m_HttpClient, lpMsg->m_nGroupCode,
					lpMsg->m_nSendUin, cServer, nPort, lpContent->m_CFaceInfo.m_nFileId, 
					lpContent->m_CFaceInfo.m_strName.c_str(), m_lpQQUser->m_LoginResult2.m_strVfWebQq.c_str(), &bufPic);
				if (bRet)
					SavePic(lpContent->m_CFaceInfo.m_strName.c_str(), bufPic.GetData(), bufPic.GetSize());
			}
		}

		::PostMessage(m_lpQQUser->m_hProxyWnd, QQ_MSG_GROUP_MSG, NULL, (LPARAM)lpMsg);
	}
	else if (OP_TYPE_SESS_PIC == m_nType)
	{
		// WebQQ协议目前不支持临时会话发送/接收自定义表情
	}

	m_bStop = FALSE;

	return 0;
}