获取股票的瞬时图C#
来源:互联网 发布:设计软件源码 编辑:程序博客网 时间:2024/06/04 18:06
获取时时线。欢迎转载啊。
private void getnewpic(string num) { try { string url = @"http://image2.sinajs.cn/newchart/min/n/sh" + num + ".gif"; HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); System.IO.Stream s = request.GetResponse().GetResponseStream(); Image img2 = System.Drawing.Bitmap.FromStream(s); s.Close(); //生成Bitmap对像 Bitmap img = new Bitmap(img2, 545, 300); //生成绘图对像 Graphics g = Graphics.FromImage(img); //定义黑色画笔 Pen Bp = new Pen(Color.Black); LinearGradientBrush Bluebrush = new LinearGradientBrush(new Rectangle(0, 0, img.Width, img.Height), Color.Blue, Color.Blue, 1.2F, true); LinearGradientBrush Transpentbrush = new LinearGradientBrush(new Rectangle(0, 0, img.Width, img.Height), Form1.DefaultBackColor, Form1.DefaultBackColor, 1.2F, true); //string info = " 曲线图生成时间:" + DateTime.Now.ToString(); Font Tfont = new Font("Arial", 9); //g.DrawString(info, Tfont, Bluebrush, 40, 25); g.FillRectangle(Transpentbrush, 5, 287, 535, 15); g.FillRectangle(Transpentbrush, 497, 228, 35, 30); //保存绘制的图片 MemoryStream stream = new MemoryStream(); img.Save(stream, System.Drawing.Imaging.ImageFormat.Jpeg); this.pictureBox1.Image = img; } catch (Exception ex) { } }
获取日K线。
private void getKpic(string num) { try { string url = @"http://image2.sinajs.cn/newchart/daily/n/sh" + num + ".gif"; HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); System.IO.Stream s = request.GetResponse().GetResponseStream(); Image img2 = System.Drawing.Bitmap.FromStream(s); s.Close(); //生成Bitmap对像 Bitmap img = new Bitmap(img2,545, 300); //生成绘图对像 Graphics g = Graphics.FromImage(img); //定义黑色画笔 Pen Bp = new Pen(Color.Black); LinearGradientBrush Bluebrush = new LinearGradientBrush(new Rectangle(0, 0, img.Width, img.Height), Color.Blue, Color.Blue, 1.2F, true); LinearGradientBrush Transpentbrush = new LinearGradientBrush(new Rectangle(0, 0, img.Width, img.Height), Form1.DefaultBackColor, Form1.DefaultBackColor, 1.2F, true); //string info = " 曲线图生成时间:" + DateTime.Now.ToString(); Font Tfont = new Font("Arial", 9); //g.DrawString(info, Tfont, Bluebrush, 40, 25); g.FillRectangle(Transpentbrush, 5, 287, 535, 15); //保存绘制的图片 MemoryStream stream = new MemoryStream(); img.Save(stream, System.Drawing.Imaging.ImageFormat.Jpeg); this.pictureBox1.Image = img; } catch (Exception ex) { MessageBox.Show(ex.Message); } }
- 获取股票的瞬时图C#
- 股票数据的获取
- 股票历史数据的获取
- 获取股票的数据
- 股票历史数据的获取
- 股票数据的获取方法
- Python 股票历史数据的获取
- 股票实时数据的获取
- 股票数据的获取分析
- 获取股票信息的程序
- C# 股票 蜡烛图 显示
- 瞬时动作的函数
- 获取网站的实时股票数据
- 获取股票实时交易数据的方法
- 获取股票实时交易数据的方法
- 获取股票实时交易数据的方法
- 获取股票实时交易数据的方法
- 股票数据的获取方法(转载)
- I2C总线原理及应用实例
- 将数字变为货币符号
- 学英语……
- Javascript 实现连续可停止 滚动字幕
- Select Top在不同数据库中的使用用法
- 获取股票的瞬时图C#
- 读书笔记
- InflateRect
- Tomat 连接数据连接池
- SQL Server 2005中的T-SQL增强
- 对于追加数据必须有事务操作的补充
- sql server日期时间函数
- 谁收入最高?程序员收入大比拼(图)
- 关于Profile在App_Code文件夹中自定义类中的使用