使用soui开发的mbc,只支持windows版本
w1146869587
2022-01-24 479b1995ef435713c2cf4f0da8de3a6af6c30922
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
// MBOrgFunc.cpp : implementation file
//
 
#include "stdafx.h"
#include "mborg.h"
#include "MBOrgFunc.h"
 
 
// CMBOrgFunc
 
CMBOrgFunc::CMBOrgFunc()
{
}
 
CMBOrgFunc::~CMBOrgFunc()
{
}
 
 
// CMBOrgFunc member functions
 
//==================================================
// ÅжÏÊÇ·ñΪÔÚÏßÓû§
//==================================================
bool CMBOrgFunc::IsOnlineUser( int nStatus )
{
    if( nStatus == AM_USERSTATUS_NLN || 
        nStatus == AM_USERSTATUS_AWY ||
        nStatus == AM_USERSTATUS_BSY ||
        nStatus == AM_USERSTATUS_BRB ||
        nStatus == AM_USERSTATUS_PHN ||
        nStatus == AM_USERSTATUS_LUN ||
        nStatus == AM_USERSTATUS_AAY ||
        nStatus == AM_USERSTATUS_AWM ||
        nStatus == AM_USERSTATUS_AWP ||
        nStatus == AM_USERSTATUS_AWO )
        return true;
    return false;
}
int CMBOrgFunc::GetElementCount(CString strStuff,CString strApart)
{
    int            nCount = 0;
    CString        strTemp,strTempItem;
    
    strTemp = strStuff;
    while( GetElementItem(strTemp, strTempItem,strApart) )
        nCount++;
 
    return nCount;
}
BOOL CMBOrgFunc::GetElementItem(CString &strStuff, CString &strItem,CString strApart)
{
    if( strStuff.GetLength() == 0 )
    {
        strItem = _T("");
        return FALSE;
    }
    int pos = strStuff.Find(strApart);
    if( pos >= 0 )
    {
        strItem = strStuff.Left(pos);
        strStuff = strStuff.Right( strStuff.GetLength() - pos - strApart.GetLength() );
    }
    else
    {
        strItem        = strStuff;
        strStuff    = _T("");
    }
    return TRUE;
}
 
CAutoRefPtr<IBitmap> CMBOrgFunc::GetFixSizeImage(IBitmap * pBitmap,int nWidth,int nHeight) 
{
    //if (!m_pSkin) return NULL;
    CAutoRefPtr<IRenderTarget> pRT; 
    if( !(nWidth > 0 && nHeight > 0 ))
    {
        return pBitmap;
    }
    SOUI::CRect rc(0,0,nWidth,nHeight);
    GETRENDERFACTORY->CreateRenderTarget(&pRT, nWidth,nHeight);
    rc.MoveToXY(0, 0);
    pRT->ClearRect(&rc, 0);
    CAutoRefPtr<IBrush> br;
    pRT->CreateSolidColorBrush(RGBA(0xBA, 0xB3, 0x99, 0xFF), &br);
    pRT->SelectObject(br);
    pRT->FillEllipse(&rc);
    pRT->SetXfermode(kSrcIn_Mode);
    if( pBitmap != NULL )
    {
        FilterLevel  fl = FilterLevel::kHigh_FilterLevel;
        SOUI::CRect rcImg(SOUI::CPoint(0,0),pBitmap->Size());
        pRT->DrawBitmapEx(rc, pBitmap, &rcImg, MAKELONG(EM_STRETCH, fl));
    }
    IBitmap * pBmp = NULL;
    IBitmap * pTempBmp = (IBitmap*)(pRT->GetCurrentObject(OT_BITMAP));
    pTempBmp->Clone(&pBmp);
    return pBmp;
}