<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="pl-pl">
<link rel="self" type="application/atom+xml" href="https://forum.atnel.pl/feed.php?f=61&amp;t=11240&amp;mode" />

<title>ATNEL tech-forum</title>
<link href="https://forum.atnel.pl/index.php" />
<updated>2015-03-31T20:50:24+01:00</updated>

<author><name><![CDATA[ATNEL tech-forum]]></name></author>
<id>https://forum.atnel.pl/feed.php?f=61&amp;t=11240&amp;mode</id>
<entry>
<author><name><![CDATA[domcio512]]></name></author>
<updated>2015-03-31T20:50:24+01:00</updated>
<published>2015-03-31T20:50:24+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=11240&amp;p=125201#p125201</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=11240&amp;p=125201#p125201"/>
<title type="html"><![CDATA[[VB2013] Generator kolorów w systemie hexadecymalnym]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=11240&amp;p=125201#p125201"><![CDATA[
Witam,<br /><br />Chciałbym przedstawić wam (autorski) program do generowania kolorów w systemie szesnastkowym. Używane są one najczęściej w języku HTML. Dokładny opis działania znajdziecie pod <a href="http://j.gs/6914192/generator-kolorow"  class="postlink">TYM LINKIEM</a><br /><br />Screen programu: <br /><a href="http://forum.atnel.pl/_obrazki/o/3200/679166b2f09db0e4a244060bc0368b4b.jpg"  class="postlink"><img src="http://forum.atnel.pl/_obrazki/o/3200/679166b2f09db0e4a244060bc0368b4b.jpg" alt="Obrazek" /></a><br /><br />Cały program został napisany w Visual Studio Express 2013. Poniżej wstawiam kod programu:<br /><br />[syntax=vbnet]Public Class Form1<br /><br />    Dim red, green, blue As Byte    'zmienne przechowujące wartości danych kolorów<br />    Dim hex_red, hex_green, hex_blue As String  'zmienne pomocnicze<br /><br />    Private Sub HScrollBar1_Scroll(sender As Object, e As ScrollEventArgs) Handles HScrollBar1.Scroll<br /><br />        red = HScrollBar1.Value     'wpisywanie wartości suwaka do zmiennej odpowiadającej kolorowi czerwonemu<br />        Panel1.BackColor = Color.FromArgb(red, green, blue) 'zmiana koloru Panel1 (podgląd koloru)<br /><br />        hex_red = Hex(red)  'konwersja z liczby decymalnej na hexadecymalną<br />        hex_green = Hex(green)  'konwersja z liczby decymalnej na hexadecymalną<br />        hex_blue = Hex(blue)    'konwersja z liczby decymalnej na hexadecymalną<br /><br />        'początek formatowania kodu<br /><br />        Select Case hex_red<br />            Case &quot;0&quot;, &quot;1&quot;, &quot;2&quot;, &quot;3&quot;, &quot;4&quot;, &quot;5&quot;, &quot;6&quot;, &quot;7&quot;, &quot;8&quot;, &quot;9&quot;, &quot;A&quot;, &quot;B&quot;, &quot;C&quot;, &quot;D&quot;, &quot;E&quot;, &quot;F&quot;<br />                hex_red = &quot;0&quot; &amp; hex_red<br />        End Select<br /><br />        Select Case hex_green<br />            Case &quot;0&quot;, &quot;1&quot;, &quot;2&quot;, &quot;3&quot;, &quot;4&quot;, &quot;5&quot;, &quot;6&quot;, &quot;7&quot;, &quot;8&quot;, &quot;9&quot;, &quot;A&quot;, &quot;B&quot;, &quot;C&quot;, &quot;D&quot;, &quot;E&quot;, &quot;F&quot;<br />                hex_green = &quot;0&quot; &amp; hex_green<br />        End Select<br /><br />        Select Case hex_blue<br />            Case &quot;0&quot;, &quot;1&quot;, &quot;2&quot;, &quot;3&quot;, &quot;4&quot;, &quot;5&quot;, &quot;6&quot;, &quot;7&quot;, &quot;8&quot;, &quot;9&quot;, &quot;A&quot;, &quot;B&quot;, &quot;C&quot;, &quot;D&quot;, &quot;E&quot;, &quot;F&quot;<br />                hex_blue = &quot;0&quot; &amp; hex_blue<br />        End Select<br />        'koniec formatowania kodu<br /><br />        RichTextBox1.Text = (&quot;#&quot; &amp; hex_red &amp; hex_green &amp; hex_blue)  'wyświetlanie kodu w RichTextBox1<br />    End Sub<br /><br />    Private Sub HScrollBar2_Scroll(sender As Object, e As ScrollEventArgs) Handles HScrollBar2.Scroll<br />        green = HScrollBar2.Value 'wpisywanie wartości suwaka do zmiennej odpowiadającej kolorowi zielonemu<br />        Panel1.BackColor = Color.FromArgb(red, green, blue) 'zmiana koloru Panel1 (podgląd koloru)<br /><br />        hex_red = Hex(red)  'konwersja z liczby decymalnej na hexadecymalną<br />        hex_green = Hex(green)  'konwersja z liczby decymalnej na hexadecymalną<br />        hex_blue = Hex(blue)    'konwersja z liczby decymalnej na hexadecymalną<br /><br />        'początek formatowania kodu<br />        Select Case hex_red<br />            Case &quot;0&quot;, &quot;1&quot;, &quot;2&quot;, &quot;3&quot;, &quot;4&quot;, &quot;5&quot;, &quot;6&quot;, &quot;7&quot;, &quot;8&quot;, &quot;9&quot;, &quot;A&quot;, &quot;B&quot;, &quot;C&quot;, &quot;D&quot;, &quot;E&quot;, &quot;F&quot;<br />                hex_red = &quot;0&quot; &amp; hex_red<br />        End Select<br /><br />        Select Case hex_green<br />            Case &quot;0&quot;, &quot;1&quot;, &quot;2&quot;, &quot;3&quot;, &quot;4&quot;, &quot;5&quot;, &quot;6&quot;, &quot;7&quot;, &quot;8&quot;, &quot;9&quot;, &quot;A&quot;, &quot;B&quot;, &quot;C&quot;, &quot;D&quot;, &quot;E&quot;, &quot;F&quot;<br />                hex_green = &quot;0&quot; &amp; hex_green<br />        End Select<br /><br />        Select Case hex_blue<br />            Case &quot;0&quot;, &quot;1&quot;, &quot;2&quot;, &quot;3&quot;, &quot;4&quot;, &quot;5&quot;, &quot;6&quot;, &quot;7&quot;, &quot;8&quot;, &quot;9&quot;, &quot;A&quot;, &quot;B&quot;, &quot;C&quot;, &quot;D&quot;, &quot;E&quot;, &quot;F&quot;<br />                hex_blue = &quot;0&quot; &amp; hex_blue<br />        End Select<br /><br />        'koniec formatowania kodu<br /><br />        RichTextBox1.Text = (&quot;#&quot; &amp; hex_red &amp; hex_green &amp; hex_blue)  'wyświetlanie kodu w RichTextBox1<br />    End Sub<br /><br />    Private Sub HScrollBar3_Scroll(sender As Object, e As ScrollEventArgs) Handles HScrollBar3.Scroll<br />        blue = HScrollBar3.Value 'wpisywanie wartości suwaka do zmiennej odpowiadającej kolorowi niebieskiemu<br />        Panel1.BackColor = Color.FromArgb(red, green, blue) 'zmiana koloru Panel1 (podgląd koloru)<br /><br />        hex_red = Hex(red)  'konwersja z liczby decymalnej na hexadecymalną<br />        hex_green = Hex(green)  'konwersja z liczby decymalnej na hexadecymalną<br />        hex_blue = Hex(blue)    'konwersja z liczby decymalnej na hexadecymalną<br /><br />        'początek formatowania kodu<br />        Select Case hex_red<br />            Case &quot;0&quot;, &quot;1&quot;, &quot;2&quot;, &quot;3&quot;, &quot;4&quot;, &quot;5&quot;, &quot;6&quot;, &quot;7&quot;, &quot;8&quot;, &quot;9&quot;, &quot;A&quot;, &quot;B&quot;, &quot;C&quot;, &quot;D&quot;, &quot;E&quot;, &quot;F&quot;<br />                hex_red = &quot;0&quot; &amp; hex_red<br />        End Select<br /><br />        Select Case hex_green<br />            Case &quot;0&quot;, &quot;1&quot;, &quot;2&quot;, &quot;3&quot;, &quot;4&quot;, &quot;5&quot;, &quot;6&quot;, &quot;7&quot;, &quot;8&quot;, &quot;9&quot;, &quot;A&quot;, &quot;B&quot;, &quot;C&quot;, &quot;D&quot;, &quot;E&quot;, &quot;F&quot;<br />                hex_green = &quot;0&quot; &amp; hex_green<br />        End Select<br /><br />        Select Case hex_blue<br />            Case &quot;0&quot;, &quot;1&quot;, &quot;2&quot;, &quot;3&quot;, &quot;4&quot;, &quot;5&quot;, &quot;6&quot;, &quot;7&quot;, &quot;8&quot;, &quot;9&quot;, &quot;A&quot;, &quot;B&quot;, &quot;C&quot;, &quot;D&quot;, &quot;E&quot;, &quot;F&quot;<br />                hex_blue = &quot;0&quot; &amp; hex_blue<br />        End Select<br />        'koniec formatowania kodu<br /><br />        RichTextBox1.Text = (&quot;#&quot; &amp; hex_red &amp; hex_green &amp; hex_blue)  'wyświetlanie kodu w RichTextBox1<br />    End Sub<br /><br />    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load<br />        Panel1.BackColor = Color.Black<br /><br />    End Sub<br /><br />    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click<br />        Clipboard.Clear()<br /><br />        Clipboard.SetText(RichTextBox1.Text)<br />    End Sub<br />End Class[/syntax]<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=3200">domcio512</a> — 31 mar 2015, o 20:50</p><hr />
]]></content>
</entry>
</feed>