Color etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster
Color etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster
20 Kasım 2014 Perşembe
C Sharp Form da Sistem Saatini Form Üzerinde Görsel Olarak Gösterme
11 Şubat 2014 Salı
C Sharp Uygulamalar Graphics Nesnesini Kullanarak Rastgele Şekiller Çizdirme
KONU : C Sharp Uygulamalar - C Sharp ( C# ) graphics nesnesini kullanarak rastgele şekillerde grafikler çizdirme
ETİKETLER: c sharp çizgi çizme| c sharp elips çizme | c sharp grafik çizme | c sharp dikdörtgen çizme | c sharp rastgele şekil çizme | c sharp resim yapma | c sharp form üzerinde grafik çizdirme | c# grafik | c sharp grafik nesnesinin kullanımı | c sharp draw pie - c sharp draw pie filling - c sharp içi dolu pasta dilimi çizme - c sharp random sınıfı kullanımı | c sharp random | c# random sınıfı
UYGULAMAYI İNDİR
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;
using System.Drawing.Imaging;
namespace C_Sharp_GDI_Kullanımı
{
public partial class Form1 : Form
{
List< Pen > pens;
List< Brush > brushes;
Random random;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
pens = new List< Pen >();
brushes = new List< Brush >();
random = new Random();
pens.Add(new Pen(Color.Blue));
pens.Add(new Pen(Color.Red));
pens.Add(new Pen(Color.Green));
pens.Add(new Pen(Color.Black));
pens.Add(new Pen(Color.White));
brushes.Add(Brushes.Blue);
brushes.Add(Brushes.Red);
brushes.Add(Brushes.Green);
brushes.Add(Brushes.Black);
brushes.Add(Brushes.White);
}
private void drawEllipse(Graphics graphic)
{
graphic.DrawEllipse(pens[random.Next(0, 5)], random.Next(0, 100), random.Next(0, 100), random.Next(0, 100), random.Next(0, 100));
bmp = new Bitmap(panel1.Width, panel1.Height, graphic);
}
private void drawPie(Graphics graphic)
{
try
{
graphic.DrawPie(pens[random.Next(0, 5)], random.Next(0, 100), random.Next(0, 100), random.Next(0, 100), random.Next(0, 100), 0, 60);
}
catch (Exception)
{
}
}
private void DrawRandomFigure(Graphics graphic)
{
Point[] ps = {
new Point(0,random.Next(0, 100)),
new Point(100,random.Next(0, 100)),
new Point(100,random.Next(100, 200)),
new Point(0,random.Next(100, 200))
};
graphic.FillClosedCurve(brushes[random.Next(0, 5)], ps);
}
private void DrawFillPie(Graphics graphic)
{
int width = random.Next(100, 100);
int height = width;
graphic.FillPie(brushes[random.Next(0, 5)], random.Next(0, 100), random.Next(0, 100), width, height, random.Next(0, 360), random.Next(0, 360));
}
private void btnElippseDraw_Click(object sender, EventArgs e)
{
drawEllipse(panel1.CreateGraphics());
}
private void btnPieDraw_Click(object sender, EventArgs e)
{
drawPie(panel1.CreateGraphics());
}
private void btnSquareDraw_Click(object sender, EventArgs e)
{
int width = random.Next(10, panel1.Width-10);
int height =random.Next(10, panel1.Height-10);
Bitmap bitMap = new Bitmap(width, height);
Rectangle rec = new Rectangle(5, 5, width, height);
Graphics g = panel1.CreateGraphics();
g.DrawRectangle(pens[random.Next(0, 5)], rec);
}
private void btnDrawFigure_Click(object sender, EventArgs e)
{
DrawRandomFigure(panel1.CreateGraphics());
}
private void btnFillPie_Click(object sender, EventArgs e)
{
DrawFillPie(panel1.CreateGraphics());
}
}
}
9 Ocak 2014 Perşembe
C Sharp Form Uygulamalar Color FormArgb Metodunun Kullanımı
KONU : C Sharp Uygulamalar - C Sharp ( C# ) form uygulamalar color formargb kullanarak renkli kutucuklar çizme. formu fare ile hareket ettirme. Formu kapatma. Başlıksız form uygulaması oluşturma.
ETİKETLER: c sharp argb - c sharp formargb - c sharp color - c sharp solidbrush - c sharp fillrectangle - c sharp renk
UYGULAMAYI İNDİR
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
namespace ARGB
{
public partial class Drawing : Form
{
public Drawing()
{
InitializeComponent();
}
public const int WM_NCLBUTTONDOWN = 0xA1;
public const int HT_CAPTION = 0x2;
[DllImportAttribute("user32.dll")]
public static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam);
[DllImportAttribute("user32.dll")]
public static extern bool ReleaseCapture();
private void Drawing_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
ReleaseCapture();
SendMessage(Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 0);
}
}
private void CizimYap()
{
Graphics g;
g = cizimAlani.CreateGraphics();
//Kırmızı dikdörtgen
g.FillRectangle(new SolidBrush(Color.FromArgb(100, 255, 0, 0)), 40, 40, 100, 100);
//Yeşil dikdörtgen
g.FillRectangle(new SolidBrush(Color.FromArgb(100, 0, 255, 0)), 80, 80, 170, 170);
//Mavi dikdörtgen
g.FillRectangle(new SolidBrush(Color.FromArgb(100, 0, 0, 255)), 190, 40, 100, 100);
//Sarı dikdörtgen
g.FillRectangle(new SolidBrush(Color.FromArgb(100, 255, 255, 0)), 40, 190, 100, 100);
//Beyaz dikdörtgen
g.FillRectangle(new SolidBrush(Color.FromArgb(100, 255, 255, 255)), 190, 190, 100, 100);
}
private void btnKapat_Click(object sender, EventArgs e)
{
//Programı kapat
this.Close();
}
private void cizimAlani_Paint(object sender, PaintEventArgs e)
{
CizimYap();
}
private void btnCiz_Click(object sender, EventArgs e)
{
CizimYap();
}
}
}
29 Aralık 2013 Pazar
C Sharp Uygulamalar Rastgele Seçilen Şehir İsmi Bulmaca Oyunu Oyna
KONU : C Sharp Uygulamalar - C Sharp ( C# ) şehir ismi bulmaca oyunu uygulaması. textbox ve label kullanarak kelimeyi harflere bölme. Label nesnesinin backcolor ve forecolor özelliklerini kullanarak oyun alanı oluşturma.
UYGULAMAYI İNDİR
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 C_Sharp_Textbox_Label_Uygulamasi
{
public partial class Form1 : Form
{
string[] sehirlerListesi = { "İstanbul", "Ankara", "İzmir", "Adana", "Adıyaman",
"Afyonkarahisar", "Ağrı", "Aksaray", "Amasya", "Antalya",
"Ardahan", "Artvin", "Aydın", "Balıkesir", "Bartın", "Batman",
"Bayburt", "Bilecik", "Bingöl", "Bitlis", "Bolu", "Burdur",
"Bursa", "Çanakkale", "Çankırı", "Çorum", "Denizli",
"Diyarbakır", "Düzce", "Edirne", "Elazığ", "Erzincan",
"Erzurum", "Eskişehir", "Gaziantep", "Giresun", "Gümüşhane",
"Hakkari", "Hatay", "Iğdır", "Isparta", "Kahramanmaraş",
"Karabük", "Karaman", "Kars", "Kastamonu", "Kayseri",
"Kırıkkale", "Kırklareli", "Kırşehir", "Kilis", "Kocaeli",
"Konya", "Kütahya", "Malatya", "Manisa", "Mardin", "Mersin",
"Muğla", "Muş", "Nevşehir", "Niğde", "Ordu", "Osmaniye", "Rize",
"Sakarya", "Samsun", "Siirt", "Sinop", "Sivas", "Şırnak",
"Tekirdağ", "Tokat", "Trabzon", "Tunceli", "Şanlıurfa", "Uşak",
"Van", "Yalova", "Yozgat", "Zonguldak" };
string bulunacakSehirIsmi = "";
int bulunanHarfSayisi = 0;
int kalanHak = 4;
Random rastgele;
public Form1()
{
InitializeComponent();
}
private void btnOyunuBaslat_Click(object sender, EventArgs e)
{
bulunanHarfSayisi = 0;
btnHarfGir.Enabled = true;
btnTahminEt.Enabled = true;
lblGirilenHarfler.Text = "";
kalanHak = 4;
lblKalanHak.Text = kalanHak.ToString();
YeniSehirSec();
grpOyunAlani.Controls.Clear();
for (int i = 0; i < bulunacakSehirIsmi.Length; i++)
{
Label label = new Label();
label.Location = new Point(20*i+30,20);
label.Text = bulunacakSehirIsmi[i].ToString();
label.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.50F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(162)));
label.Size = new System.Drawing.Size(15, 20);
label.BackColor = Color.Red;
label.ForeColor = Color.Red;
grpOyunAlani.Controls.Add(label);
}
}
private void btnHarfGir_Click(object sender, EventArgs e)
{
bool harfVarMi = false;
if (txtHarf.Text.Length != 1)
{
MessageBox.Show("Lütfen tek harf giriniz.", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
else
{
if (lblGirilenHarfler.Text.Contains(txtHarf.Text))
{
MessageBox.Show("Bu harfi daha önce girdiniz.", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Warning);
txtHarf.Text = "";
txtHarf.Focus();
return;
}
foreach (Control item in grpOyunAlani.Controls)
{
if (item is Label)
{
Label label = item as Label;
if (label.Text.ToUpper() == txtHarf.Text.ToUpper())
{
label.ForeColor = Color.Black;
label.BackColor = Color.Lime;
harfVarMi = true;
bulunanHarfSayisi++;
}
}
}
}
if (!harfVarMi)
{
kalanHak--;
lblKalanHak.Text = kalanHak.ToString();
if (kalanHak == 0)
{
btnHarfGir.Enabled = false;
btnTahminEt.Enabled = false;
MessageBox.Show("Oyun Bitti. Kaybettiniz. Yeni Oyun için yeni kelime giriniz. \n Cevap : " + bulunacakSehirIsmi, "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
lblGirilenHarfler.Text += txtHarf.Text + " ";
if (bulunanHarfSayisi == bulunacakSehirIsmi.Length)
{
btnHarfGir.Enabled = false;
btnTahminEt.Enabled = false;
MessageBox.Show("Oyun Bitti. Kazandınız. Yeni Oyun için yeni kelime giriniz.", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
txtHarf.Text = "";
txtHarf.Focus();
}
private void Form1_Load(object sender, EventArgs e)
{
btnHarfGir.Enabled = false;
btnTahminEt.Enabled = false;
rastgele = new Random();
this.AcceptButton = btnHarfGir;
}
private void YeniSehirSec()
{
int rastgeleSayi = rastgele.Next(0, sehirlerListesi.Length);
bulunacakSehirIsmi = sehirlerListesi[rastgeleSayi];
}
private void btnTahminEt_Click(object sender, EventArgs e)
{
if (bulunacakSehirIsmi.ToUpper() == txtKelime.Text.ToUpper())
{
foreach (Control item in grpOyunAlani.Controls)
{
if (item is Label)
{
Label label = item as Label;
label.ForeColor = Color.Black;
label.BackColor = Color.Lime;
}
}
MessageBox.Show("Oyun Bitti. Tebrikler Kazandınız. Yeni Oyun için yeni kelime giriniz.", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
{
MessageBox.Show("Oyun Bitti. Kaybettiniz. Yeni Oyun için yeni kelime giriniz. \n Cevap : " + bulunacakSehirIsmi, "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
btnHarfGir.Enabled = false;
btnTahminEt.Enabled = false;
}
}
}
8 Temmuz 2013 Pazartesi
C Sharp Form Uygulamalar Tam EkranEkran Koruyucu Yapma
KONU : C Sharp Uygulamalar ( C# ) form da dinamik grafik sınıfını kullanarak ekran koruyucu yapma, c# da ekran koruyucu yapmak, Grafik nesnesini kullanarak c sharp da ekran koruyucu yapmak
ETİKETLER: csharp ekran koruyucu - C# ekran koruyucu - ekran koruyucu indir - ekran koruyucu - ekran koruyucu programı - ekran koruyucu yapma - ekran koruyucu uygulama - ekran koruyucu uygulaması - ekran koruyucu örnekleri
UYGULAMAYI İNDİR
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 Ekrankoruyucu
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
g = this.CreateGraphics();
}
string[] isimler={"onur","ECE","Fatih","hakan","ismet","ebru"};
Random rdm = new Random();
Color[] renkler = { Color.Black, Color.Yellow, Color.Tomato, Color.SpringGreen, Color.Maroon };
PointF nokta = new PointF();
Font yazi = new Font("Verdana", 20, FontStyle.Italic);
private void Form1_Load(object sender, EventArgs e)
{
}
//grafik nesnesini ekrana rastgele yazı yazdırmak için kullanacağım
Graphics g = null;
private void timer1_Tick(object sender, EventArgs e)
{
string isim=isimler[rdm.Next(0,isimler.Length)];
float yaziGenisligi=g.MeasureString(isim,yazi).Width;
float yaziYuksekligi = g.MeasureString(isim, yazi).Height;
nokta.X = rdm.Next(10,Convert.ToInt16(this.ClientSize.Width-yaziGenisligi));
nokta.Y = rdm.Next(10, Convert.ToInt16(this.ClientSize.Height - yaziYuksekligi));
Color renk=renkler[rdm.Next(0,renkler.Length)];
g.DrawString(isim, yazi, new SolidBrush(renk), nokta);
}
private void çıkışToolStripMenuItem_Click(object sender, EventArgs e)
{
// sağ tıklayınca meu strip açılsın ve çıkış seçeneği aktif olsun
this.Close();
}
private void Form1_MouseClick(object sender, MouseEventArgs e)
{
//ekran üzerinde mouse a sağ tıklanınca menustring görünür olsun
if (e.Button == MouseButtons.Right)
contextMenuStrip1.Visible = true;
}
private void Form1_KeyDown(object sender, KeyEventArgs e)
{
if(e.KeyCode == Keys.F4)
e.Handled = true;
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
// if (e.CloseReason == CloseReason.TaskManagerClosing || e.CloseReason == CloseReason.UserClosing)
// e.Cancel = true;
if (e.CloseReason == CloseReason.TaskManagerClosing)
e.Cancel = true;
}
}
}
6 Nisan 2013 Cumartesi
C Sharp Uygulamaları RGB den Color Sınıfına Renk Dönüştürme İşlemleri
KONU : C Sharp Uygulamalar - C Sharp ( C# ) Form Uygulamalar RGB formatındaki renk kodunu color renk koduna çevirme, html renk kodu, color renk kodu, renkleri farklı formlara dönüştürme
UYGULAMAYI İNDİR
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 color_rgb_convert_color_rgb_donusum
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
this.groupBox1.Name = "groupBox1";
this.groupBox1.Text = "Renk dönüşüm (Color Convertion)";
//Pencere eleamnalırına renk verme ve
//Değişik formlarda bulunan renk kodlarını (rgb kodlarını)
//color sınıfı türüne çeviren fonksiyonları kullanma
//web colors,web renkleri (C#)
System.Drawing.Color color = System.Drawing.Color.Black;
this.BackColor = color;
//System Color, Sistem renkleri (C#)
System.Drawing.Color color_1 = System.Drawing.SystemColors.ActiveCaption;
this.button1.BackColor = color_1;
this.button1.Text = color_1.Name;
//web colors,web renkleri (C#)
System.Drawing.Color color_2 = System.Drawing.Color.Red;
this.button2.BackColor = color_2;
this.button2.Text = color_2.Name;
//RGB den renk (color) olarak çevirmek için (C#)(RGB converet to COLOR)
//FromArgb(int red, int green, int blue ) (C#)
System.Drawing.Color color_3 = System.Drawing.Color.FromArgb(((int)(((byte)(16)))),
((int)(((byte)(15)))), ((int)(((byte)(15)))));
this.button3.BackColor = color_3;
this.button3.ForeColor = System.Drawing.Color.White;
this.button2.Text = color_3.Name;
//FromArgb(int alpha, int red, int green, int blue ) (C#)(RGB converet to COLOR)
System.Drawing.Color color_4 = System.Drawing.Color.FromArgb(((int)(((byte)(112)))),
((int)(((byte)(16)))), ((int)(((byte)(15)))), ((int)(((byte)(15)))));
this.button4.BackColor = color_4;
this.button4.Text = color_4.Name;
//ARGB den Renge dönüşüm(C#)(Convert ARGB value to COLOR )
System.Drawing.Color color_5 = System.Drawing.Color.FromArgb(788888888);
this.button5.BackColor = color_5;
this.button5.Text = color_5.Name;
//HTMLcolor dan Renge Dönüşüm (Convert HtmlColor to COLOR)
//Hexadecimal değeri Renge dönüştür(C#)(Convert Hexadecimal values to Color)
System.Drawing.Color color_6 = System.Drawing.ColorTranslator.FromHtml("#0000FF");
this.button6.BackColor = color_6;
this.button6.Text = color_6.Name;
//Renk ismi ile renk oluşturmak (C#) (convert Colorname to COLOR)
System.Drawing.Color color_7 = System.Drawing.Color.FromName("red");
this.button7.BackColor = color_7;
this.button7.Text = color_7.Name;
//System Color, Sistem renkleri (C#)
System.Drawing.Color color_8 = System.Drawing.Color.YellowGreen;
this.button8.BackColor = color_8;
this.button8.Text = color_8.Name;
//System Color, Sistem renkleri (C#)
System.Drawing.Color color_9 = System.Drawing.Color.Pink;
this.button9.BackColor = color_9;
this.button9.Text = color_9.Name;
//System Color, Sistem renkleri (C#)
System.Drawing.Color color_10 = System.Drawing.Color.Blue;
this.button10.BackColor = color_10;
this.button10.Text = color_10.Name;
//System Color, Sistem renkleri (C#)
System.Drawing.Color color_11 = System.Drawing.Color.White;
this.groupBox1.BackColor = color_11;
}
}
}
Kaydol:
Kayıtlar
(
Atom
)




