Ejemplo n.º 1
0
        public void LoadEntry(ApplicationEntry entry)
        {
            _entry = entry;
            imageIndex = Random.Next(1,6);

            Bitmap sbmp = new Bitmap(400,120);
            Image simg = new Bitmap(Assembly.GetExecutingAssembly().GetManifestResourceStream(string.Format("BasiK.BasiKLauncher.Resources.transpbox{0}_selected.png", imageIndex)));

            Bitmap ubmp = new Bitmap(400, 120);
            Image uimg = new Bitmap(Assembly.GetExecutingAssembly().GetManifestResourceStream(string.Format("BasiK.BasiKLauncher.Resources.transpbox{0}_unselected.png", imageIndex)));

            Graphics g = Graphics.FromImage(sbmp);
            g.Clear(Color.Transparent);
            if (_entry.DisplayImage != null)
                g.DrawImage(_entry.DisplayImage, new Rectangle(70, 22, 65, 65));

            int textHeight = 30;
            foreach (string subs in _entry.DisplayName.Split(new char[] { ':' }))
            {
                if (string.IsNullOrEmpty(subs.Trim()))
                    continue;
                g.DrawString(subs.Trim(), new Font("Arial", 14, FontStyle.Bold), new SolidBrush(Color.Black), 152, textHeight);
                textHeight += 22;
            }
            g.DrawImage(simg, new Rectangle(0, 0, 400, 120));
            _selectedBitmap = sbmp;

            g = Graphics.FromImage(ubmp);
            g.Clear(Color.Transparent);
            if (_entry.DisplayImage != null)
                g.DrawImage(_entry.DisplayImage, new Rectangle(70, 22, 65, 65));

            textHeight = 30;
            foreach (string subs in _entry.DisplayName.Split(new char[] { ':' }))
            {
                if (string.IsNullOrEmpty(subs.Trim()))
                    continue;
                g.DrawString(subs.Trim(), new Font("Arial", 14, FontStyle.Bold), new SolidBrush(Color.Black), 152, textHeight);
                textHeight += 22;
            }
            g.DrawImage(uimg, new Rectangle(0, 0, 400, 120));
            _unselectedBitmap = ubmp;
        }
Ejemplo n.º 2
0
 public void AddApplication(ApplicationEntry entry)
 {
     if (entry != null)
         _applicationEntries.Add(entry);
 }