Programming guides for beginner...
Any comments are welcomed....
I hope it helps!!! Thanks for drop by...

Monday, January 4, 2016

Advance Copy - My first published app in Google Play

It's been a while since my last post.
Recently I had published my first app in Google Play - Advance Copy.

Logo from my app.


Advance Copy monitoring copied text and identify url. If there is any url, there will be a pop up screen to allow user to open in browser or share with other apps.

This is helpful for those apps that don't link up url. It is another shortcut to open browser or sharing what you have copied to another app.

Hope to see some comments here after you have download so that I can improve on the app.
Thank you.

Saturday, March 9, 2013

Free Screen Capture Program by VB.NET



       My new program coded in VB.Net called SCapture. SCapture is a screen capture program with the following function in capturing: 
  1. Capture the screen with a fixed Rectangular size.
  2. Capture the screen with an adjustable Rectangular.
  3. Capture an active window.
  4. Capture full screen.
Beside that, it also has setting to save the captured image in:
  1. Edit with paint 
  2. Copy to Clipboard for Paste
  3. Save in Directory
Here is a video that shows how it works.



In this post, I will explain about how the concept that I use in this program.
       
      To capture the program with rectangular size (also for adjustable size), once capture button is clicked or when shortcut key is pressed, a window form with a Picture box appear. The picture box show the screen as image and just simple mouse click and drag will draw a rectangular. In adjustable mode, the rectangular can be adjust after drew.

In later post, I will show my coding (Only if I got some reviews in comments) . For those who want to try this SCapture program, you can download it from my website. Please feel free to leave comments. Thank you.








Tuesday, January 1, 2013

Simple Tic Tac Toe game for Gadget

As you can see from my Gadget sidebar, there is a Tic Tac Toe game. Anyone of you can have it now.
Just follow the following guide.

1) Add a html/javascript gadget to your sidebar. (or anything that can used for javascript)
2) Add this line into it :

3) Save and it all done, a tic tac toe game in your sidebar for others to play.

This tic tac toe game did not have a pro computer. All steps are randomly pick by computer and it did not store any scores after you refresh the page. It only store the scores in client's browser (the one that playing the game) and it reset after refresh.
Besides that, this tic tac toe game can only be used once in a page. I didn't manage it to be multiple. If multiple in a page, there might be some problems.

Please feel free to update it to your blog/website. Please leave a comment if you like this.


Wednesday, June 20, 2012

Winx Youtube Downloader


Youtube nowadays had been one of the top ranking website and is the top video-sharing website. A lot people found that there is not enough tools to download video from Youtube.
Today, I would like to share about this free tool from Digiarty called Winx Youtube Downloader. Winx Youtube Downloader is a free software where you can download Youtube’s videos in few formats. It is a free tool that able to download HD videos from Youtube. Winx Youtube Downloader can detect Youtube’s videos automatically after you paste an url into it(show in picture below).
                         1
                                                       Steps to paste the url and analyze it.
You can add few url before start downloading. When you want to download, press the download button at the bottom right corner. There is a built-in small video player which you can use to preview the video before you press the download button.
                      2
                                  You can choose from various formats and resolutions after you press analyze button.
                         3
                                           You can play preview using the video player on the right while downloading.
Pros.
  • It is free.
  • Able to download Youtube’s videos in difference formats including HD-formats.
  • Able to do multiple download.
  • Download format that directly play in IOs or Android without converting.
  • Preview videos in a small player before download or while downloading.
Cons:
  • Icons do not have tooltips.
  • Preview player cannot resize. (The size of the player is a bit too small)

Rating: 3.8 out of 5 (This is my personal rating for this tool after tested for few days.)
Download link : http://winxdvd.com/youtube-downloader
This is a nice tool to use to download videos from Youtube.

Thursday, March 22, 2012

Simple tutorial for color picker


     This tutorial is made for my previous post for simple color picker application. First, I will explain about the program flow. When shortcut key is pressed after setting, a print screen will be captured and will appeared as the top-most among all the windows. Then when mouse left-button is clicked, a panel will appear beside the mouse cursor. The panel will show the color where the mouse cursor is pointing at in RGB format.
This will be a simple tutorial. To start with this tutorial,
1) You need to have visual basic 2008 or equivalent.
(I assume from here, you should have at least simple knowledge of programming. )
2) Create a new project for visual basic windows application. Type in project name as you like.
3) Design your own interface.
  • You need to have setting for shortcut keys. (Must be at least a combination of ALT/CTRL/Shift with normal keys. Button is required to confirm/set/apply.)
  • A standby button which use to hide the application when you going to pick color.
  • Optional : A checkbox to copy code to clipboard.
You may follow my interface as following:
1
4) Now is coding time! In order to have keyboard hook so that the program will be called when you click the shortcut keys you set previously, you need to have a low level keyboard hook. I had been using an example from here(KBHook by Julien). To use this example, you need to add KBHook project into the solution. Make sure that you convert KBHook project to your visual studio/basic first.
Start using kbhook by the following coding:
  Private WithEvents m_Hook As New LowLevelKBhook

Private Sub m_HookKeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles m_Hook.KeyDown
               
‘**************************************You coding goes here*************************************************
’It is up to you to design how you going to check the shortcut keys. I will give a simple example here.
            If e.shift = true Then ‘If user press shift and hold it
                    If e.KeyCode.ToString = “F1” Then   'Here I hard-coded F1. If user hold shift and press F1 
                             StartColorPick()         ‘If both shift and F1 is pressed, a function called StartColorPick will trigger.
                     End If
           End If
End Sub


Before I explain about what “StartColorPick()” function does, there are some important coding needed for getting print screen(which I mention in the program flow).

Public m_ImgBitMap As Bitmap = New Bitmap(My.Computer.Screen.Bounds.Width, My.Computer.Screen.Bounds.Height, Imaging.PixelFormat.Format32bppArgb)
’m_ImgBitMap is a declaration name that I give for a new Bitmap object

Public m_gfx As Graphics = Graphics.FromImage(m_ImgBitMap)
‘m_gfx is a graphics type which get Image from Bitmap object (m_ImgBitMap)


Now we back to “StartColorPick()”. This function will call a form (I called it as MyScreen) to show.

Private Sub StartColorPick()
                   MyScreen.Show()
                   m_gfx.CopyFromScreen(My.Computer.Screen.Bounds.X, My.Computer.Screen.Bounds.Y, 0, 0, _
                                                                    Screen.PrimaryScreen.Bounds.Size, CopyPixelOperation.SourceCopy)
End Sub

Change the properties of the object(By default, properties window should be at right bottom corner when you click on the object. If you can’t find it, press F4 to launch the window.)
MyScreen will have the following properties:
  1. FormBorderStyle : None
  2. StartPosition : Manual
  3. ShowInTaskbar : False
  4. TopMost : True
and contain
  1. a picture box object.
  2. a hidden panel
Picture box object will have the following properties:
  1. Dock : Fill
Now we will focus on coding for MyScreen.
Screen Load.


Private Sub Screen_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load     
                  Me.PictureBox1.Image = ColorPicker.m_ImgBitMap                               
                  Me.Size = New Point(My.Computer.Screen.Bounds.Width,My.Computer.Screen.Bounds.Height)
End Sub


PictureBox click.

Private Sub PictureBox1_MouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseClick
            Dim TempBitmap As New Bitmap(PictureBox1.Image)
            Dim MyColor As Color
            MyColor = TempBitmap.GetPixel(e.X, e.Y)
            Panel1.BringToFront()
            Panel1.Location = New Point(CalPanelPos(e.X, e.Y))
            Label1.TextAlign = ContentAlignment.MiddleCenter
            Label1.BackColor = Color.White
            Label1.Text = MyColor.ToString
            Panel1.AutoSize = True
            Panel1.BackColor = MyColor
            Label1.Location = New Point(CalLabelPos(Label1.Width, Panel1.Width), Label1.Location.Y)
   End Sub


MouseMove on Picture Box

Private Sub PictureBox1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseMove
          Dim TempBitmap As New Bitmap(PictureBox1.Image)
          Dim MyColor As Color
          MyColor = TempBitmap.GetPixel(e.X, e.Y)
          Panel1.Location = New Point(CalPanelPos(e.X, e.Y))
          Label1.Location = New Point(CalLabelPos(Label1.Width, Panel1.Width), Label1.Location.Y)
          Label1.Text = MyColor.ToString
          Panel1.BackColor = MyColor
  End Sub


CalLabelPos & CalPanelPos function that I call on above.

Private Function CalLabelPos(ByVal labelwidth As Integer, ByVal Panelwidth As Integer) As Integer
         CalLabelPos = (Panelwidth - labelwidth) / 2
         Return CalLabelPos
End Function

Private Function CalPanelPos(ByVal mousex As Integer, ByVal mousey As Integer) As Point
         Dim int_ComWidth As Integer = My.Computer.Screen.WorkingArea.Width
         Dim int_ComHeight As Integer = My.Computer.Screen.WorkingArea.Height                                                   
         If mousex > (int_ComWidth - 220) Then
             CalPanelPos.X = mousex – 220
         Else
             CalPanelPos.X = mousex + 20
         End If
         If mousey > (int_ComHeight - 50) Then
             CalPanelPos.Y = mousey – 50
        Else
             CalPanelPos.Y = mousey + 20
        End If
        Return CalPanelPos
End Function


And finally KeyDown event

Private Sub MyScreen_PreviewKeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.PreviewKeyDownEventArgs) Handles Me.PreviewKeyDown     
       If e.KeyCode = Keys.Escape Then
             ColorPicker.TextBox1.Text = Me.Label1.Text
             Me.Close()
             ColorPicker.Show()     
       ElseIf e.KeyCode = Keys.Enter Then
        
                 If ColorPicker.CPClipboard.Checked Then
                         My.Computer.Clipboard.SetText(Me.Label1.Text)
                 End If
             ColorPicker.TextBox1.Text = Me.Label1.Text
             Me.Close()
             ColorPicker.Show()
      End If 
End Sub


For those who want to have full source code, please provide me your email and I will send it to you asap.

Tuesday, November 29, 2011

Simple Color Picker

I had been lazy to update this blog for few months. Today, I will be showing one of my simple project. I had been doing web design for the last few months and I found out that picking a color is quite a difficult job. I design a simple color picker application.
This application is quite simple but might be a bit lagging when moving the mouse around to pick color. I am lazy to fix some of the bugs since it didn't cause any error.

I will show the step of using the program and for those who interested, you can download the program at here.

Step 1:
Start the program.


The program will look like the above picture.

Set your shortcut keys by checking the checkbox and choosing your key from the combo box.
Press the set button to Set it.
Then press Stand by button to start monitoring.

Step 2:

Press the shortcut keys you set before. In this example was (Alt +1 ). After that, you can start clicking on anywhere you want on your desktop.

The color that show in the panel above the picture was the color that you pick. You may move your mouse around (might cause lagging) and when you got your color, press enter.
If you check on the checkbox for "Copy Color Picker Code to Clipboard", then the color code (as what you can see from the picture "Color[A=255, R=104, G=165, B=64]") will be copy.
You can also press escape to stop picking. Nothing will be copied to the clipboard when escape was press.

Hope you enjoy the program. Please report any bug to me if you want it to be solved.
I will try to solve if possible.

For those who want to download, please visit my website at here.