示例#1
0
 private void LoadPreviewImage()
 {
     if (location != null)
     {
         pbPreviewImage.Image = ImageLoader.GetImageFromFile(Globals.ImagesDir + location.NavigatorPathId + "\\" + location.ImageName, pbPreviewImage.Width, pbPreviewImage.Height);
     }
 }
示例#2
0
 private void LoadValues()
 {
     if (shop != null)
     {
         lblName.Text     = shop.Name;
         lblTagline.Text  = shop.Tagline;
         pbShopIcon.Image = ImageLoader.GetImageFromFile(Globals.SettingsResourceDir + shop.IconName, pbShopIcon.Width, pbShopIcon.Height);
     }
 }
示例#3
0
        private void rbChooseNewFile_CheckedChanged(object sender, EventArgs e)
        {
            btnBrowse.Enabled         = lblFilename.Enabled = true;
            cmbResourceImages.Enabled = false;

            if (rbChooseNewFile.Checked && String.IsNullOrEmpty(selectedFile) == false)
            {
                pbHotSpotImage.Image = ImageLoader.GetImageFromFile(selectedFile, pbHotSpotImage.Width, pbHotSpotImage.Height);
            }
        }
示例#4
0
        public void LoadControl()
        {
            lblImageName.Text    = hotSpot.ImageName;
            pbImagePreview.Image = ImageLoader.GetImageFromFile(Globals.SettingsResourceDir + hotSpot.ImageName, pbImagePreview.Width, pbImagePreview.Height);

            // Load locations
            pnlHotSpotItems.Controls.Clear();
            foreach (HotspotLocation location in hotSpot.Locations)
            {
                HotSpotItemCtrl ctrl = CreateHotSpotItemCtrl(location);
                pnlHotSpotItems.Controls.Add(ctrl);
            }
        }
示例#5
0
        public void UpdateControl()
        {
            LogoSettings.Load();
            if (LogoSettings.Instance == null || String.IsNullOrEmpty(LogoSettings.Instance.FileName))
            {
                pbLogo.Image = defaultLogo;
            }
            else
            {
                pbLogo.Image = ImageLoader.GetImageFromFile(Globals.SettingsResourceDir + LogoSettings.Instance.FileName, LogoSettings.Instance.Size.Width, LogoSettings.Instance.Size.Height);
            }

            this.Size = pbLogo.Image.Size;
        }
示例#6
0
        private void btnBrowse_Click(object sender, EventArgs e)
        {
            OpenFileDialog dlg = new OpenFileDialog();

            dlg.Filter           = "Image files (.jpg, .jpeg, .bmp, .gif, .png)|*.jpg;*.jpeg;*.bmp;*.gif;*.png";
            dlg.Multiselect      = false;
            dlg.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                selectedFile     = dlg.FileName;
                lblFilename.Text = selectedFile;

                pbHotSpotImage.Image = ImageLoader.GetImageFromFile(selectedFile, pbHotSpotImage.Width, pbHotSpotImage.Height);
            }
        }
示例#7
0
        void itemCtrl_ConfigItemSelected(object sender, EventArgs e)
        {
            AdConfigItemCtrl itemCtrl = (AdConfigItemCtrl)sender;

            foreach (Control ctrl in pnlConfigItems.Controls)
            {
                if (ctrl is AdConfigItemCtrl)
                {
                    ((AdConfigItemCtrl)ctrl).IsSelected = (ctrl == itemCtrl);
                }
            }
            string filename = Globals.SettingsResourceDir + itemCtrl.AdSettings.FileName;

            pbSelectedImage.Image = ImageLoader.GetImageFromFile(filename, pbSelectedImage.Width, pbSelectedImage.Height);
        }
        private void LoadSelectedMap(Map map)
        {
            selectedMap = map;
            // load map
            string filename = Globals.MapsDir + map.Name;

            actualMapImage = ImageLoader.GetImageFromFile(filename);

            loadedMapImage = ImageLoader.GetImageFromFile(filename, pbMap.Width + (zoomIndex * zoomIncrement), pbMap.Height + (zoomIndex * zoomIncrement));
            graphics       = Graphics.FromImage(loadedMapImage);

            // draw all lines
            LoadMapPaths(map);

            // draw stars
            LoadMapStars();

            pbMap.Image = GetDisplayImage();
        }
示例#9
0
        private void btnBrowse_Click(object sender, EventArgs e)
        {
            HotSpotImageForm imageForm = new HotSpotImageForm();
            string           resFile   = string.Empty;

            if (imageForm.ShowDialog() == DialogResult.OK)
            {
                if (imageForm.ResourceImageSelected && imageForm.SelectedImage != null)
                {
                    resFile = Globals.SettingsResourceDir + imageForm.SelectedResourceImageFileName + ".png";
                    imageForm.SelectedImage.Save(resFile);
                }
                else if (imageForm.ResourceImageSelected == false && String.IsNullOrEmpty(imageForm.SelectedFile) == false)
                {
                    resFile = Globals.SettingsResourceDir + Path.GetFileName(imageForm.SelectedFile);
                    IOSupport.CopyFile(imageForm.SelectedFile, resFile);
                }

                pbImagePreview.Image = ImageLoader.GetImageFromFile(resFile, pbImagePreview.Width, pbImagePreview.Height);

                hotSpot.ImageName = Path.GetFileName(resFile);
                HotspotManager.Save();
            }
        }
示例#10
0
        private void DisplayAd()
        {
            string filename = Globals.SettingsResourceDir + currentAdSettings.FileName;

            pbAd.Image = ImageLoader.GetImageFromFile(filename, pbAd.Width, pbAd.Height);
        }
示例#11
0
 public void LoadImage(string imagePath)
 {
     this.imagePath = imagePath;
     pbImage.Image  = ImageLoader.GetImageFromFile(imagePath, pbImage.Width, pbImage.Height);
     pbImage.Refresh();
 }
示例#12
0
 private Image GetImage(string filename, string pathId)
 {
     return(ImageLoader.GetImageFromFile(Globals.ImagesDir + pathId + "\\" + filename, pbNavigationImage.Width, pbNavigationImage.Height));
 }