private void Page_Load(object sender, System.EventArgs e)
 {
     if (!IsPostBack)
     {
         ImageBrowserConfig cfg = (ImageBrowserConfig)ReadConfig(typeof(ImageBrowserConfig));
         if (cfg != null)
         {
             txtPictureVirtualDirectory.Text = cfg.PictureVirtualDirectory;
             txtRootName.Text = cfg.RootName;
         }
     }
 }
        private void lnkSave_Click(object sender, System.EventArgs e)
        {
            ImageBrowserConfig cfg = (ImageBrowserConfig)ReadConfig(typeof(ImageBrowserConfig));
            if(cfg == null)
            {
                cfg = new ImageBrowserConfig();
            }

            cfg.PictureVirtualDirectory = txtPictureVirtualDirectory.Text;
            cfg.RootName = txtRootName.Text;

            WriteConfig(cfg);
            RedirectBack();
        }
        private void lnkSave_Click(object sender, System.EventArgs e)
        {
            ImageBrowserConfig cfg = (ImageBrowserConfig)ReadConfig(typeof(ImageBrowserConfig));

            if (cfg == null)
            {
                cfg = new ImageBrowserConfig();
            }

            cfg.PictureVirtualDirectory = txtPictureVirtualDirectory.Text;
            cfg.RootName = txtRootName.Text;

            WriteConfig(cfg);
            RedirectBack();
        }
Example #4
0
        private void Save()
        {
            // Save Configuration.
            ImageBrowserConfig cfg = (ImageBrowserConfig)ReadConfig(typeof(ImageBrowserConfig));

            if (cfg == null)
            {
                cfg = new ImageBrowserConfig();
            }

            cfg.PictureVirtualDirectory = txtPictureVirtualDirectory.Text;
            cfg.ThumbnailCols           = Convert.ToInt32(txtThumbnailCols.Text);
            cfg.ThumbnailRows           = Convert.ToInt32(txtThumbnailRows.Text);
            cfg.PreviewCfg.MaxSize      = Convert.ToInt32(txtPreviewMax.Text);
            cfg.PreviewCfg.JpegQuality  = Convert.ToByte(txtPreviewJpegQuality.Text);
            cfg.ThumbCfg.MaxSize        = Convert.ToInt32(txtThumbnailMax.Text);
            cfg.ThumbCfg.JpegQuality    = Convert.ToByte(txtThumbJpegQuality.Text);

            cfg.PreviewCfg.Shadow             = chkPreviewShadow.Checked;
            cfg.PreviewCfg.ShadowWidth        = Convert.ToInt32(txtPvShadowWidth.Text);
            cfg.PreviewCfg.ShadowTransparency = Convert.ToDouble(txtPvShadowTrans.Text) / 100;
            cfg.PreviewCfg.BackgroundColor    = PvBgColor.SelectedColor.ToArgb();
            cfg.PreviewCfg.ShadowColor        = PvShColor.SelectedColor.ToArgb();
            cfg.PreviewCfg.BorderColor        = PvBColor.SelectedColor.ToArgb();
            cfg.PreviewCfg.SoftShadow         = chkPvSoftShadow.Checked;

            cfg.ThumbCfg.Shadow             = chkThumbnailShadow.Checked;
            cfg.ThumbCfg.ShadowWidth        = Convert.ToInt32(txtTnShadowWidth.Text);
            cfg.ThumbCfg.BorderWidth        = Convert.ToInt32(txtTnBorderWidth.Text);
            cfg.ThumbCfg.ShadowTransparency = Convert.ToDouble(txtTnShadowTrans.Text) / 100;
            cfg.ThumbCfg.BackgroundColor    = TnBgColor.SelectedColor.ToArgb();
            cfg.ThumbCfg.ShadowColor        = TnShColor.SelectedColor.ToArgb();
            cfg.ThumbCfg.BorderColor        = TnBColor.SelectedColor.ToArgb();
            cfg.ThumbCfg.SoftShadow         = chkTnSoftShadow.Checked;
            WriteConfig(cfg);

            // Build shadow files.
            ImageTools it = new ImageTools(this);

            it.CreateShadowParts(cfg.PreviewCfg, cfg.ShadowPath);
        }
Example #5
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            if (!IsPostBack)
            {
                ImageBrowserConfig cfg = (ImageBrowserConfig)ReadConfig(typeof(ImageBrowserConfig));
                if (cfg == null)
                {
                    cfg = new ImageBrowserConfig();
                }

                txtPictureVirtualDirectory.Text = cfg.PictureVirtualDirectory;
                txtThumbnailCols.Text           = cfg.ThumbnailCols.ToString();
                txtThumbnailRows.Text           = cfg.ThumbnailRows.ToString();
                txtPreviewMax.Text         = cfg.PreviewCfg.MaxSize.ToString();
                txtPreviewJpegQuality.Text = cfg.PreviewCfg.JpegQuality.ToString();
                txtThumbnailMax.Text       = cfg.ThumbCfg.MaxSize.ToString();
                txtThumbJpegQuality.Text   = cfg.ThumbCfg.JpegQuality.ToString();

                chkPreviewShadow.Checked = cfg.PreviewCfg.Shadow;
                txtPvShadowWidth.Text    = cfg.PreviewCfg.ShadowWidth.ToString();
                txtPvShadowTrans.Text    = (cfg.PreviewCfg.ShadowTransparency * 100).ToString();
                PvBgColor.SelectedColor  = Color.FromArgb(cfg.PreviewCfg.BackgroundColor);
                PvShColor.SelectedColor  = Color.FromArgb(cfg.PreviewCfg.ShadowColor);
                PvBColor.SelectedColor   = Color.FromArgb(cfg.PreviewCfg.BorderColor);
                chkPvSoftShadow.Checked  = cfg.PreviewCfg.SoftShadow;

                chkThumbnailShadow.Checked = cfg.ThumbCfg.Shadow;
                txtTnShadowWidth.Text      = cfg.ThumbCfg.ShadowWidth.ToString();
                txtTnBorderWidth.Text      = cfg.ThumbCfg.BorderWidth.ToString();
                txtTnShadowTrans.Text      = (cfg.ThumbCfg.ShadowTransparency * 100).ToString();
                TnBgColor.SelectedColor    = Color.FromArgb(cfg.ThumbCfg.BackgroundColor);
                TnShColor.SelectedColor    = Color.FromArgb(cfg.ThumbCfg.ShadowColor);
                TnBColor.SelectedColor     = Color.FromArgb(cfg.ThumbCfg.BorderColor);
                chkTnSoftShadow.Checked    = cfg.ThumbCfg.SoftShadow;

                chkThumbnailShadow_CheckedChanged(null, null);
                chkPreviewShadow_CheckedChanged(null, null);
            }
        }
    private void Page_Load(object sender, System.EventArgs e)
    {
      if (!IsPostBack)
      {
        ImageBrowserConfig cfg = (ImageBrowserConfig)ReadConfig(typeof(ImageBrowserConfig));
        if (cfg == null)
          cfg = new ImageBrowserConfig();

        txtPictureVirtualDirectory.Text = cfg.PictureVirtualDirectory;
        txtThumbnailCols.Text = cfg.ThumbnailCols.ToString();
        txtThumbnailRows.Text = cfg.ThumbnailRows.ToString();
        txtPreviewMax.Text = cfg.PreviewCfg.MaxSize.ToString();
        txtPreviewJpegQuality.Text = cfg.PreviewCfg.JpegQuality.ToString();
        txtThumbnailMax.Text = cfg.ThumbCfg.MaxSize.ToString();
        txtThumbJpegQuality.Text = cfg.ThumbCfg.JpegQuality.ToString();

        chkPreviewShadow.Checked = cfg.PreviewCfg.Shadow;
        txtPvShadowWidth.Text = cfg.PreviewCfg.ShadowWidth.ToString();
        txtPvShadowTrans.Text = (cfg.PreviewCfg.ShadowTransparency * 100).ToString();
        PvBgColor.SelectedColor = Color.FromArgb(cfg.PreviewCfg.BackgroundColor);
        PvShColor.SelectedColor = Color.FromArgb(cfg.PreviewCfg.ShadowColor);
        PvBColor.SelectedColor = Color.FromArgb(cfg.PreviewCfg.BorderColor);
        chkPvSoftShadow.Checked = cfg.PreviewCfg.SoftShadow;

        chkThumbnailShadow.Checked = cfg.ThumbCfg.Shadow;
        txtTnShadowWidth.Text = cfg.ThumbCfg.ShadowWidth.ToString();
        txtTnBorderWidth.Text = cfg.ThumbCfg.BorderWidth.ToString();
        txtTnShadowTrans.Text = (cfg.ThumbCfg.ShadowTransparency * 100).ToString();
        TnBgColor.SelectedColor = Color.FromArgb(cfg.ThumbCfg.BackgroundColor);
        TnShColor.SelectedColor = Color.FromArgb(cfg.ThumbCfg.ShadowColor);
        TnBColor.SelectedColor = Color.FromArgb(cfg.ThumbCfg.BorderColor);
        chkTnSoftShadow.Checked = cfg.ThumbCfg.SoftShadow;

        chkThumbnailShadow_CheckedChanged(null, null);
        chkPreviewShadow_CheckedChanged(null, null);
      }
    }
    private void Save()
    {
      // Save Configuration.
      ImageBrowserConfig cfg = (ImageBrowserConfig)ReadConfig(typeof(ImageBrowserConfig));
      if (cfg == null)
      {
        cfg = new ImageBrowserConfig();
      }

      cfg.PictureVirtualDirectory = txtPictureVirtualDirectory.Text;
      cfg.ThumbnailCols = Convert.ToInt32(txtThumbnailCols.Text);
      cfg.ThumbnailRows = Convert.ToInt32(txtThumbnailRows.Text);
      cfg.PreviewCfg.MaxSize = Convert.ToInt32(txtPreviewMax.Text);
      cfg.PreviewCfg.JpegQuality = Convert.ToByte(txtPreviewJpegQuality.Text);
      cfg.ThumbCfg.MaxSize = Convert.ToInt32(txtThumbnailMax.Text);
      cfg.ThumbCfg.JpegQuality = Convert.ToByte(txtThumbJpegQuality.Text);

      cfg.PreviewCfg.Shadow = chkPreviewShadow.Checked;
      cfg.PreviewCfg.ShadowWidth = Convert.ToInt32(txtPvShadowWidth.Text);
      cfg.PreviewCfg.ShadowTransparency = Convert.ToDouble(txtPvShadowTrans.Text) / 100;
      cfg.PreviewCfg.BackgroundColor = PvBgColor.SelectedColor.ToArgb();
      cfg.PreviewCfg.ShadowColor = PvShColor.SelectedColor.ToArgb();
      cfg.PreviewCfg.BorderColor = PvBColor.SelectedColor.ToArgb();
      cfg.PreviewCfg.SoftShadow = chkPvSoftShadow.Checked;

      cfg.ThumbCfg.Shadow = chkThumbnailShadow.Checked;
      cfg.ThumbCfg.ShadowWidth = Convert.ToInt32(txtTnShadowWidth.Text);
      cfg.ThumbCfg.BorderWidth = Convert.ToInt32(txtTnBorderWidth.Text);
      cfg.ThumbCfg.ShadowTransparency = Convert.ToDouble(txtTnShadowTrans.Text) / 100;
      cfg.ThumbCfg.BackgroundColor = TnBgColor.SelectedColor.ToArgb();
      cfg.ThumbCfg.ShadowColor = TnShColor.SelectedColor.ToArgb();
      cfg.ThumbCfg.BorderColor = TnBColor.SelectedColor.ToArgb();
      cfg.ThumbCfg.SoftShadow = chkTnSoftShadow.Checked;
      WriteConfig(cfg);

      // Build shadow files.
      ImageTools it = new ImageTools(this);
      it.CreateShadowParts(cfg.PreviewCfg, cfg.ShadowPath);
    }