Exemplo n.º 1
0
        public void setImageWaterMake()
        {
            Setpath(_source);
            if (CobImgGroup.SelectedItem == null)
            {
                _source.IsImageWater = false;
                return;
            }
            WaterImageManage water = new WaterImageManage();


            image.Source = null;

            Image imageTarget = CobImgGroup.SelectedItem as Image;

            int    imageTargetthree = imageTarget.Source.ToString().IndexOf("///");
            string imageTargetpath  = imageTarget.Source.ToString().Substring(imageTargetthree + 3);

            ImagePosition position = GetImagePosition(CobPoint.SelectionBoxItem.ToString());

            _source.ImagepositionWordImg = position;
            _source.OptintyImg           = (float)SLIop.Value;
            string wordsName = water.DrawImage(fileName, imageTargetpath, (float)SLIop.Value, position, path);

            _source.ImgString      = imageTargetpath;
            toolboxItem.Thumbnails = path + wordsName;
            imagesource            = new BitmapImage(new Uri(path + wordsName, UriKind.RelativeOrAbsolute));



            image.BeginInit();


            image.Source = imagesource;


            image.EndInit();

            _source.IsImageWater = true;
        }
        public void setImageWaterMake()
        {
            Setpath(_source);
            if (txtName.Text.Trim() == "")
            {
                _source.IswordWater = false;
                return;
            }
            WaterImageManage water     = new WaterImageManage();
            object           floatsize = CobFontsize.SelectionBoxItem;

            image.Source = null;

            ImagePosition imageposition = GetImagePosition(poition);

            System.Drawing.FontStyle fontstylevalue = GetFontStyle(fontstyle);


            _source.ImagepositionWord = imageposition;
            _source.fontfailydraw     = fontfamily;
            _source.drawfontSize      = itemFloat;
            _source.Optintyword       = (float)(SLIop.Value);
            _source.WaterContent      = txtName.Text;
            _source.fontstyle         = fontstylevalue;
            string wordsName = water.DrawWords(fileName, txtName.Text, (float)(SLIop.Value), fontfamily, itemFloat, imageposition, path, fontstylevalue);

            toolboxItem.Thumbnails = path + wordsName;

            imagesource = new BitmapImage(new Uri(path + wordsName, UriKind.RelativeOrAbsolute));


            image.BeginInit();


            image.Source = imagesource;

            image.EndInit();
            _source.IswordWater = true;
        }