Example #1
0
        static Bitmap m_ImageCard;    //图片资源

        //构造函数
        public SmallCardControl()
        {
            //状态变量
            m_bHorizontal  = true;
            m_bPositively  = false;
            m_bDisplayItem = false;

            //扑克数据
            m_wCardCount = 0;

            for (int i = 0; i < m_CardItemArray.Length; i++)
            {
                m_CardItemArray[i] = new tagCardItem();
            }

            //间隔变量
            m_nXDistance     = DEF_X_DISTANCE;
            m_nYDistance     = DEF_Y_DISTANCE;
            m_nShootDistance = DEF_SHOOT_DISTANCE;

            //位置变量
            m_YCollocateMode = enYCollocateMode.enYTop;
            m_XCollocateMode = enXCollocateMode.enXLeft;
            m_BenchmarkPos   = new Point(0, 0);

            //加载资源
            m_ImageCard = Properties.Resources.SMALL_CARD;

            //获取大小
            //CImageHandle HandleImage(&m_ImageCard);
            m_CardSize = new Size(m_ImageCard.Width, m_ImageCard.Height);

            return;
        }
Example #2
0
        static Bitmap m_ImageWin;                                   //图片资源


        public CardControl()
        {
            //状态变量
            m_bHorizontal  = true;
            m_bPositively  = false;
            m_bDisplayItem = false;

            //扑克数据
            m_cbCardCount = 0;

            for (int i = 0; i < m_CardItemArray.Length; i++)
            {
                m_CardItemArray[i] = new tagCardItem();
            }

            //间隔变量
            m_nXDistance     = DEF_X_DISTANCE;
            m_nYDistance     = DEF_Y_DISTANCE;
            m_nShootDistance = DEF_SHOOT_DISTANCE;

            //位置变量
            m_YCollocateMode = enYCollocateMode.enYTop;
            m_XCollocateMode = enXCollocateMode.enXLeft;
            m_BenchmarkPos   = new Point(0, 0);

            //加载资源
            m_ImageCard     = Properties.Resources.CARD;
            m_ImageCardMask = Properties.Resources.CARD_MASK;
            m_ImageWin      = Properties.Resources.MAX;

            //获取大小
            m_CardSize = new Size(m_ImageCard.Width / 13, m_ImageCard.Height / 5);

            return;
        }
Example #3
0
        //设置扑克
        public bool SetCardData(int wCardCount)
        {
            //ASSERT(wCardCount>=m_wCardCount);
            //if(m_wCardCount==2 && (wCardCount>=m_wCardCount))return false;

            //效验参数
            //ASSERT(wCardCount<=CountArray(m_CardItemArray));
            if (wCardCount > m_CardItemArray.Length)
            {
                return(false);
            }

            //设置变量
            m_wCardCount = wCardCount;

            for (int i = 0; i < m_CardItemArray.Length; i++)
            {
                m_CardItemArray[i] = new tagCardItem();
            }


            return(true);
        }