<------------------------------------------------------------------>
first i made the software, but it kept drawing ontop of it self all teh time, so a added clear.
graphicsObj.Clear(Color.Aqua);
and its workig just fine :):):)
<------------------------------------------------------------------>
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace test_drawing
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
//text variablelen
public string teXt;
public void Form1_Load(object sender, EventArgs e)
{
}
//tegne ned texten
public void Form1_Paint(object sender, PaintEventArgs e)
{
}
//timed ticker updater
private void timer1_Tick(object sender, EventArgs e)
{
string file_name = "c:\\temp\\test.txt";
{
System.IO.StreamReader objReader;
objReader = new System.IO.StreamReader(file_name);
//textBox1.Text = objReader.ReadToEnd();
teXt = objReader.ReadToEnd();
objReader.Close();
}
System.Drawing.Graphics graphicsObj;
graphicsObj = this.CreateGraphics();
graphicsObj.Clear(Color.Aqua);
Font myFont = new System.Drawing.Font("Helvetica", 40, FontStyle.Italic);
Brush myBrush = new SolidBrush(System.Drawing.Color.Red);
graphicsObj.DrawString(teXt, myFont, myBrush, 30, 30);
}
}
}
Abonner på:
Legg inn kommentarer (Atom)
Ingen kommentarer:
Legg inn en kommentar