Example #1
0
        private MBitmap CreateYoteiIconBitmap(int x, int y, int width, int height, YOTEI_ICON_TYPE type)
        {
            //ビットマップを宣言
            MBitmap m_bitmap = new MBitmap();

            if (type == YOTEI_ICON_TYPE.YOTEI_TODAY)
            {
                //イメージをセット
                m_bitmap.SetBitmap(imgKensaToday);
            }
            else if (type == YOTEI_ICON_TYPE.YOTEI_TODAY_BLINK)
            {
                //イメージをセット
                m_bitmap.SetBitmap(imgKensaTodayBlink);
                m_bitmap.Visible = false;
            }
            // TODO その他のアイコンも用意・表示する

            m_bitmap.LayerNo = ICON_LAYER_NO;
            //m_bitmap.Style = 2;  //白抜き部分をBackColor,黒色部分をForeColorで表示する
            m_bitmap.Style = 0;  //0だと色変わらない(Bitmapをそのまま表示)
            if (type == YOTEI_ICON_TYPE.YOTEI_TODAY)
            {
                m_bitmap.ForeColor = Color.Red;
                m_bitmap.BackColor = Color.Aqua;
            }
            m_bitmap.X = x;
            m_bitmap.Y = y;
            m_bitmap.Height = height;
            m_bitmap.Width = width;

            m_bitmap.MinX = m_bitmap.X - 1000;
            m_bitmap.MaxX = m_bitmap.X + 1000;
            m_bitmap.MinY = m_bitmap.Y - 1000;
            m_bitmap.MaxY = m_bitmap.Y + 1000;

            return m_bitmap;
        }
Example #2
0
        // 指定検査予定のアイコンを生成する
        private KensaYoteiIcon CreateKensaYoteiIcon(MObjects objects, string key, int x, int y, string yoteiDate, string yoteiMemo, YOTEI_ICON_TYPE type)
        {
            KensaYoteiIcon icon = new KensaYoteiIcon();

            icon.key = key;

            // TODO 表示スケールに応じてサイズを調整する場合は、ここで細工をする(+,KenyaYotei内部クラスに、スケール更新用メソッドを設ける)
            icon.kensaYoteiIconBitMap = CreateYoteiIconBitmap(x, y, 40, 40, type);
            icon.kensaYoteiIconBitMapBlink = CreateYoteiIconBitmap(x, y, 40, 40, type + 1);
            icon.kensaYoteiDateLabel = CreateYoteiDateLabel(yoteiDate, x, y + 500);
            icon.kensaYoteiMemoLabel = CreateToolTipLabel(yoteiMemo, x, y + 750);
            //icon.kensaYoteiSelectRect = CreateSelectRect(x, y);

            // アイコンのビットマップオブジェクトをマップに設定
            object id = objects.Add(icon.kensaYoteiIconBitMap);
            objects.Add(icon.kensaYoteiIconBitMapBlink);
            // 予定日ラベルのオブジェクトをマップに設定
            objects.Add(icon.kensaYoteiDateLabel);
            // メモラベルのオブジェクトをマップに設定
            objects.Add(icon.kensaYoteiMemoLabel);
            // 選択矩形を設定
            //objects.Add(icon.kensaYoteiSelectRect);

            yoteiIconDataKeyMap.Add(key, icon);
            yoteiIconObjectIDMap.Add(id, icon);

            return icon;
        }