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;

        }
    }
}


UYGULAMAYI İNDİR

Hiç yorum yok :

Yorum Gönder