본문 바로가기

C#6

c# 전역 비트맵. 다시그리기. 이래하면 되는건가.에레이. using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.Drawing.Imaging;using System.Drawing.Drawing2D; namespace ImageByBitmap{public partial class Form1 : Form{Bitmap bmp;Graphics bmpgraphics;Point p1 = new Point();Point p2 = new Point(); public Form1(){InitializeCo.. 2009. 11. 4.
C# 기본 그래픽 // c# 그래픽 - 경로그리기, 선그리기, picturebox에서 이미지 축 회전//Graphics graphics = this.CreateGraphics(); //Graphics graphics = pictureBox1.CreateGraphics();//Pen pen = new Pen(Color.Blue); //pen.Dispose();//graphics .Dispose(); private void drawpath()//경로 그리기{Point[] point = new Point[3];point[0].X = 10;point[0].Y = 10;point[1].X = 200;point[1].Y = 10;point[2].X = 300;point[2].Y = 300;Graphics g = pictureBox1.. 2009. 11. 4.
C# 선그리기. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace Graphic_Study2 { public partial class Form1 : Form { private Graphics gr; public Form1() { InitializeComponent(); } private void Form1_Paint(object sender, PaintEventArgs e) { gr = pictureBox1.CreateGraphics(); Pen pen1 = n.. 2009. 4. 8.
C# 스트링을 숫자로, 숫자를 스트링으로. 스트링을 숫자로 System.String temp1 = "123"; System.Int32 temp2 = Int32.Parse(temp1); Console.WriteLine("숫자 : {0}", temp2); //출력 숫자를 스트링으로 temp2 = 123; temp1 = temp2.ToString(); Console.WriteLine("문자열 : {0}", temp1); //출력 쉽네 c# ㅋㅋㅋ 2009. 4. 3.
C# 데이터 타입과 배열 System.Type로 부터 상속. System.Object 는 어떠한 데이터 타입으로도 변환이 가능. static void WriteObjectInfo(object testObject) { TypeCode typeCode = Type.GetTypeCode( testObject.GetType() ); switch( typeCode ) { case TypeCode.Boolean: Console.WriteLine("Boolean: {0}", testObject); break; case TypeCode.Double: Console.WriteLine("Double: {0}", testObject); break; default: Console.WriteLine("{0}: {1}", typeCode.ToString.. 2009. 4. 3.
C# 간단한 시리얼 프로그램. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.IO.Ports; namespace rs232 { public partial class Form1 : Form { string InputData = String.Empty; // This delegate enables asynchronous calls for setting // the text property on a TextBox control: delegate void SetTextCal.. 2009. 4. 1.