- This topic has 1 reply, 2 voices, and was last updated 12 years ago by String.
-
AuthorPosts
-
June 8, 2012 at 5:57 pm #186874ChiNaAdministrator
Hello Guys this is my first VB Program, I ever released + the Source Code. (ChiNa-ColorPicker). I am gonna show you how to make one, and I am gonna help you! Here is a tutorial how to make one under 7 Minutes, but I cheated a bit, I had the Source code ready to add.. But anyways, took me to build one in 20 minutes from scratch.. Good Luck!
PLEASE WATCH THE VIDEO FOR TUTORIAL
[youtube]vypOqvH19cM[/youtube]Example Image from :
Download the Example I made in video:
http://www.mediafire.com/?fu5u8pemyjnjey5Tutorial:
Imporatnt to Follow the video, from the start…. And build your “1st Form”, like showen in the video!
And at last you need to add the SOURCE CODE INSIDE the “2nd Form”! You can also put your own ICON and build it using your own ICON for the EXE file, Good luck guys, if anything, please ask me!:::::::::::::: SOURCE CODE IN PARTS :::::::::::::::
A Section in Form1:
Private Declare Function GetAsyncKeyState Lib “user32” (ByVal vKey As Long) As Integer
STbtn:
Timer1.Start()STPbtn:
Timer1.Stop()Timer1:
Dim BMP As New Drawing.Bitmap(1, 1) Dim GFX As System.Drawing.Graphics = System.Drawing.Graphics.FromImage(BMP) GFX.CopyFromScreen(New Drawing.Point(MousePosition.X, MousePosition.Y), _ New Drawing.Point(0, 0), BMP.Size) Dim Pixel As Drawing.Color = BMP.GetPixel(0, 0) CPpanel.BackColor = Pixel Redtxt.Text = Pixel.R Greentxt.Text = Pixel.G Bluetxt.Text = Pixel.BSSChk:
If (GetAsyncKeyState(117)) Then Timer1.Start() End If If (GetAsyncKeyState(118)) Then Timer1.Stop() End If
:::::::::::::: FULL SOURCE CODE (READY TO ADD) ::::::::::::::::
Public Class Form1 Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer Private Sub STbtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles STbtn.Click Timer1.Start() End Sub Private Sub STPbtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles STPbtn.Click Timer1.Stop() End Sub Private Sub SSchk_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SSchk.Tick If (GetAsyncKeyState(117)) Then Timer1.Start() End If If (GetAsyncKeyState(118)) Then Timer1.Stop() End If End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick Dim BMP As New Drawing.Bitmap(1, 1) Dim GFX As System.Drawing.Graphics = System.Drawing.Graphics.FromImage(BMP) GFX.CopyFromScreen(New Drawing.Point(MousePosition.X, MousePosition.Y), _ New Drawing.Point(0, 0), BMP.Size) Dim Pixel As Drawing.Color = BMP.GetPixel(0, 0) CPpanel.BackColor = Pixel Redtxt.Text = Pixel.R Greentxt.Text = Pixel.G Bluetxt.Text = Pixel.B End Sub End Class End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick Dim BMP As New Drawing.Bitmap(1, 1) Dim GFX As System.Drawing.Graphics = System.Drawing.Graphics.FromImage(BMP) GFX.CopyFromScreen(New Drawing.Point(MousePosition.X, MousePosition.Y), _ New Drawing.Point(0, 0), BMP.Size) Dim Pixel As Drawing.Color = BMP.GetPixel(0, 0) CPpanel.BackColor = Pixel Redtxt.Text = Pixel.R Greentxt.Text = Pixel.G Bluetxt.Text = Pixel.B End Sub End Class
June 8, 2012 at 8:38 pm #186875StringMemberIn your “: FULL SOURCE CODE (READY TO ADD) :” section, You might want to add a comment mentioning what Timer1’s interval is.
Good post, thanks for sharing.
-
AuthorPosts
Related
- You must be logged in to reply to this topic.