Example #1
0
 private static void Blend_(ref Bitmap src, Image dst, psd.BlendMode mode)
 {
     using (var g = Graphics.FromImage(src))
     {
         g.DrawImage(dst, 0, 0);
     }
 }
Example #2
0
        /// <summary>
        ///获取每个发射机的频段信息
        /// </summary>
        public static List <FrequencyBand> GetTxFrequenceBand(string txpath, string setuppath, int txindex)
        {
            List <FrequencyBand> TxFrequenceBand = new List <FrequencyBand>();
            List <TxObject>      txs             = TxReader(txpath);
            SetupObject          setupfile       = SetupFileProceed.GetSetupFile.GetSetup(setuppath);
            WaveformStp          txwaveform      = GetTxWaveForm(txs[txindex], setupfile);

            if (txwaveform.type == null)
            {
                throw new Exception("波形信息错误");
            }
            if (txwaveform.type == "Sinusoid")
            {
                if (txwaveform.bandwidth < 2)
                {
                    FrequencyBand temp = new FrequencyBand((int)(txwaveform.CarrierFrequency - 1), (int)(txwaveform.CarrierFrequency + 1), (txs[txindex].at.power));
                    TxFrequenceBand.Add(temp);
                }
                else
                {
                    FrequencyBand temp = new FrequencyBand((int)(txwaveform.CarrierFrequency - txwaveform.bandwidth / 2), (int)(txwaveform.CarrierFrequency + txwaveform.bandwidth / 2), (txs[txindex].at.power));
                    TxFrequenceBand.Add(temp);
                }
            }
            else
            {
                psd          TxDivFrequence = new psd(txwaveform.type, txwaveform.PulseWidth, (long)txwaveform.CarrierFrequency, txwaveform.Rolloff, txwaveform.FrequencyVariation, txwaveform.StartFrequency, txwaveform.StopFrequency);
                DivFrequency Frequencyinfo  = TxDivFrequence.GetFandPSD();
                TxFrequenceBand = GetBandInformation((txs[txindex].at.power), Frequencyinfo);
            }
            return(TxFrequenceBand);
        }
Example #3
0
        public void AddLayer(psd.File.LayerHeaderInfo layerInfo, Image layerImage)
        {
            var thumbnail = Converter.CreateThumbnail(40, 40, layerImage);

            if (this.dataGridView.InvokeRequired)
            {
                this.dataGridView.Invoke((MethodInvoker)delegate
                {
                    this.dataGridView.Rows.Add(layerInfo.Visible, thumbnail, layerInfo.Name);
                });
            }
            else
            {
                this.dataGridView.Rows.Add(layerInfo.Visible, thumbnail, layerInfo.Name);
            }

            this.layerDic[this.dataGridView.Rows.Count - 1] = new Layer(layerInfo, layerImage, thumbnail);
        }
Example #4
0
        public static Image LoadLayer(psd.File.HeaderInfo header, psd.File.LayerHeaderInfo layerInfo)
        {
            var infile = string.Format(@"{0}[{1}]", header.FileName, layerInfo.Index);
            var outfile = string.Format(@"{0}\{1}_{2}.png", Env.Instance.TempDirectory, Path.GetFileName(header.FileName), layerInfo.Index);
            Converter.Convert_(infile, outfile);

            var bitmap = new Bitmap(header.Width, header.Height);
            using (Graphics g = Graphics.FromImage(bitmap))
            {
                var rect = new Rectangle(
                    layerInfo.Left, layerInfo.Top,
                    layerInfo.Right - layerInfo.Left, layerInfo.Bottom - layerInfo.Top
                    );
                g.DrawImage(Image.FromFile(outfile), rect);
            }
            //bitmap.Save(Path.GetDirectoryName(outfile) + "\\_" + Path.GetFileName(outfile));

            return bitmap;
        }
Example #5
0
 public Layer(psd.File.LayerHeaderInfo info, Image image, Image thumb)
 {
     this.Info = info;
     this.Image = image;
     this.Thumb = thumb;
 }