A Visual Basic PaintBrush / Imaging Program


Full Text Search: The Key to Better Natural Language Queries for NoSQL in Node.js

This excellent example from Stefaan Casier shows the basics of creating a professional paint program and how to implement many of the features that users expect for granted. Be sure to study this code well and learn from it.

Standard Screen:


Zoomed Image:

Screen-shot 2

Paint256 v1.05 10/07/99 - translated 18/03/2000


The program has to be run in a 256 colors-screen modus state, since it concentrates on making bitmaps with a 256 colors pallet, containing gradient or fluent colors. Besides using fluent colors, the program also has a feature adding shade to all drawings. The fact, to apply fluent colors and shade is made so easy, makes this program special. It is at least a good addition to other painting programs.

Most functions work in such an obvious way, they need no explanation. So I provide you here with those things that are not so obvious.


Absolute maximum = 1024 x 1024 pixels.

Each scale- or zoom factor has its own maximum (XY):

x1 1024 - maybe higher with more RAM? (here 48M)
x2 1024
x4 546
x6 364
x8 273

This a mathematic maximum that would produce an Overflow if passed over (prevented by the program). If you have less available RAM memory on your PC, those maximum values will be lower. Then you'll have to judge it yourself. The moment Windows virtual memory (hard disc) is addressed, everything slows down, sometimes to a point it isn't workable anymore. What you learn from this: it is a program more for making smaller pictures than opposite.


  1. Get to know the program using a small size like 100*100
  2. Without using the grid, everything works faster


You change or set it, F I R S T , because it alters the existing pallet/content.

There are some different ways to set a new pallet:

  • Make or load a Paint256 pallet (*.BKL). Using max. 16 base colors, 240 fluent colors are generated. The pallet is completed with 16 Quick Basic Colors.
  • Load a JASC-PAL pallet (*.PAL) : originates from Paint Shop Pro (and others?).
  • Extract a pallet from an existing bitmap (*.BMP), so you can edit a bitmap with its own pallet (only necessary when the picture uses more than 16 or 20 colors (see pictures).

One of the powers of Paint256 is working with fluent colors. When they are unavailable, a number of functions become useless.


Many functions react differently depending on whether selection-modus is on or not. If the selection-modus is on, most functions will act on the current delimited selection, otherwise it will be on the whole image. This is the case with: Save, Copy, Pallet-Rotation, Move, Mirror, Delete, Replace (click the mouse with the mouse - nice no?) ... Open en Paste have something similar.

Moving over a button with the mouse causes a tip to popup, with the button's name or description.

KEYS (in main-window)

C            Copy
E            Exit
O            Open
P            Paste
B            Save
A            Size+Zoomfactor
U            Undo
W            Clear
S            Shades dialog
V            Fill modes dialog
space         Repeat previous action (<> filling)
shift+ M      Pattern-Mask (to use with small sizes - testing)
K            Show real size image

Cursor Keys:

  • Selection box
  • Normal Enlarge
  • +shift Smaller
  • +control Move

You can move, copy/paste a selection with the mouse combined with the shift- or control-keys. Without any key, you only move the rubber box.

Clicking in the image combined with the Alt-key, will change the current (left/right) mouse color into the color under the mouse pointer.

You select the background-color in the pallet, holding the Alt-key down.


This is a browser looking for bitmaps on disk. You can check the saved results. Delete doubles... You can copy bitmaps to the clipboard to paste them later...

If you want to mix different bmp's you will have to check their pallet for compatibility. In most cases the pallets have to be identical.

- Always load & select the pallet of a bmp-file, before you paste the bmp itself.


10 in a row, from top to bottom:

  1. Select
  2. Points
  3. Lines
  4. Rectangle-ellipse *
  5. Filled rectangle-ellipse *
  6. Filling (doesn't work on black surfaces !)
  7. Formula *
  8. Text *
  9. Shade Frames *
  10. Arrows *

* = click them with the right mouse button to set their parameters by means of a dialog.

In most cases you can repeat the last action with new left/right color settings. You can Undo before, or not. This way you can try things out until you find the best setting.

STYLE (three buttons bottom-right side of the pallet)

  1. Shade
  2. Pen Width
  3. Fill-modus

----> do experiment, you will see, it's easy


A multi-line text you can align (left/right/center). A single line of text you can tilt or turn over. To place it in your image you can think of it as a stamp. Click in the image, without releasing the mouse button. A 'rubber box' you can move around, will appear showing the size of the stamp. The stamp is made the moment you release the mouse button.


A condition to use this is of course there has to be a pallet with gradient fluent colors. Pallets extracted from a bitmap, will probably not have such a pallet...

Select in the pallet on the left, the Start color with the left mouse button and the End color with the right mouse button. Then you choose in the Fill-modus dialog, the preferred color pattern. Each following drawing action will use these selected settings and produce fluent colors.

Download Zipped Source Code (97k)
Download Zipped EXE and Help File (127k)


  • How do i download the zip files

    Posted by VBBUFF on 12/19/2005 12:57am

    I want to download the source zip & the help files, but i can't download. please help

    • Where is the sources ?

      Posted by Rodrigo Raposo on 12/19/2005 01:16pm

      I can't download the zip containing the sources. Please help !

  • excellent work..

    Posted by Legacy on 08/25/2003 12:00am

    Originally posted by: Subbu

    its a excellent. Work I am looking at how to print a text on a dark back ground.. I am not able to print a text on a dark back ground I think you have managed it some how.. so I am trying to lear that stuff out of your..program.. I hope it should help me out..

    if you can put some inputs u r most welcome. u can catch me at psubbu@ipwrs.com


  • Nice

    Posted by Legacy on 07/24/2003 12:00am

    Originally posted by: Arif Qurishi

    Its a nice utility

  • GREAT...

    Posted by Legacy on 04/26/2003 12:00am

    Originally posted by: Miss AJ

    Its really a great work something i was really looking for hope to c more from u'r programming abilities

  • vbprogram

    Posted by Legacy on 04/01/2003 12:00am

    Originally posted by: alimudin siddiqui

    nice program

  • Nice Program

    Posted by Legacy on 03/29/2003 12:00am

    Originally posted by: Neeraj

    Realy you have made a nice paint brush. I want to mention one thing you please provide the eraser. Through this any body can remove the certain part of the image

    Neeraj sinha

  • This is an Ideal Graphics Project. Thank U Very Much !!!

    Posted by Legacy on 03/23/2003 12:00am

    Originally posted by: Mr.Fantastic

    I don't Know what to say. But this one seems to be perfect.
    You r really agood teacher, I hope that I would be in half of your strength in this field of programming. Thank you again, brother. With all my best wishes for more Progress.

  • I just need such a program, thanks a lot!

    Posted by Legacy on 02/24/2003 12:00am

    Originally posted by: Effun

    It's so good!


    Posted by Legacy on 02/06/2003 12:00am

    Originally posted by: RAJESH KARIA




  • Excellent for Starter

    Posted by Legacy on 08/02/2002 12:00am

    Originally posted by: Chaitanya

    I being new to VB need some sort of starting interface to learn the concept of graphics in VB in real time.
    This served as a best example.
    Keep guiding all,
    bye to all

  • Loading, Please Wait ...

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • As all sorts of data becomes available for storage, analysis and retrieval - so called 'Big Data' - there are potentially huge benefits, but equally huge challenges...
  • The agile organization needs knowledge to act on, quickly and effectively. Though many organizations are clamouring for "Big Data", not nearly as many know what to do with it...
  • Cloud-based integration solutions can be confusing. Adding to the confusion are the multiple ways IT departments can deliver such integration...

Most Popular Programming Stories

More for Developers

RSS Feeds

Thanks for your registration, follow us on our social networks to keep up-to-date