Example #1
0
void RAUser::LoadUserImageFromFile()
{
	SetCurrentDirectory( g_sHomeDir );
	char sPath[1024];
	sprintf_s( sPath, 1024, RA_DIR_DATA "%s.png", m_sUsername );

	m_hUserImage = LoadLocalPNG( sPath, 64, 64 );
}
Example #2
0
HBITMAP LoadOrFetchUserPic( const std::string& sUserName, const RASize& sz )
{
	SetCurrentDirectory( Widen( g_sHomeDir ).c_str() );

	if( !_FileExists( RA_DIR_USERPIC + sUserName + ".png" ) )
	{
		PostArgs args;
		args['u'] = sUserName;
		//	Ensure it's not in the queue to be processed or has been processed, waiting for handling:
		if( !RAWeb::HTTPRequestExists( RequestUserPic, sUserName ) && !RAWeb::HTTPResponseExists( RequestUserPic, sUserName ) )
			RAWeb::CreateThreadedHTTPRequest( RequestUserPic, args, sUserName );

		return NULL;
	}
	else
	{
		return LoadLocalPNG( RA_DIR_USERPIC + sUserName + ".png", sz );
	}
}
Example #3
0
HBITMAP LoadOrFetchBadge( const std::string& sBadgeURI, const RASize& sz )
{
	SetCurrentDirectory( Widen( g_sHomeDir ).c_str() );

	if( !_FileExists( RA_DIR_BADGE + sBadgeURI + ".png" ) )
	{
		PostArgs args;
		args[ 'b' ] = sBadgeURI;
		//	Ensure it's not in the queue to be processed or has been processed, waiting for handling:
		if( !RAWeb::HTTPRequestExists( RequestBadge, sBadgeURI ) && !RAWeb::HTTPResponseExists( RequestBadge, sBadgeURI ) )
			RAWeb::CreateThreadedHTTPRequest( RequestBadge, args, sBadgeURI );

		return NULL;
	}
	else
	{
		return LoadLocalPNG( RA_DIR_BADGE + sBadgeURI + ".png", sz );
	}
}