Click here for source files.
"RGB Value Calculator" is a desktop application developed using Visual Basic version 6.0. The main objective of this application is to generate the RGB values and save that value in a file for future. With easy use of objects and file handling (Random access file), this project can be beneficial.
Features :
The features included in this project are mentioned below :
- Slide bar for changing the values of R, G and B.
- Shows demo of color whose values can be copied.
- Prevents the data redundancy before saving.
- Save RGB values in a file .
- Preview of RGB values as color which are saved in a file.
- Removal of content of file.
Objects used
For developing this kind of application, we need to have the knowledge of following objects :- Form
- Frame
- Command button
- Label
- Text box
- Horizontal scroll bar (HScrollBar)
Concepts description
Generation of RGB values
The horizontal scroll bar (HScrollBar) object is used for changing the RGB values whose color value is previewed in a real-time. The minimum and maximum values are set to 0 and 255 respectively. Even the currently generated RGB value is showed as labels which can be copied to clipboard. This feature is more useful when a task is to be accomplished in short period of time.
Data redundancy check and saving the value
Before saving a new RGB value in a file, first of all, current RGB value is compared to each content (value) present in a file. If and only if no data redundancy is ensured, new RGB value is saved in a file, otherwise program warns with the dialog box.
Preview of color value for RGB values saved in a file
Also, the values stored in a file are previewed along with the color. On the side of textbox for showing RGB value, copy and delete command buttons have been placed, which, on choosing copy, copies the RGB value in a clipboard and on choosing delete button, deletes the content from a file
How a RGB value is deleted from a file?
When building this desktop application, personally, I found file handling topic more complex as I have used random file access. Because the file index starts from 1 not 0 (zero), it gets harder to trace the content location. Before writing to a file, first, what we need to do is to count the number of content present in a file. Doing this eradicated the data loss problem.
No comments:
Post a Comment