256 Colors in a Visual Basic Picture Box Control !!!! ===================================================== The enclosed files (see below) show how to display a 256 bitmap in a Visual Basic picture box control. The technique uses a DLL to read the bitmap file into memory and create a palette which can then be selected into the picture box's device context and subsequently realized (I can't take any credit for the code within the DLL ... it was lifted with very little modification from a couple of SAMPLE programs supplied with the Microsoft Windows SDK.) Hopefully, the code will be easy to read (famous last words), but if you have difficulty following what's happening, feel free to holler a question and I'll do my best to help out. The demo (256PICBX) does have one "hidden" item which you may have trouble finding. The PicPreviewSource picture box can be found by sizing the form downwards while in design mode. Enjoy, rpb 70742,3332 Files: 256picbx.bas Ä¿ 256picbx.frm ³ Files for the demo VB application 256picbx.mak ÄÙ 256picbx.exe Precompiled version of demo application makefile ÄÄ¿ errors.c ³ Source code for the bitmap utility library errors.h ³ the makefile is for MSC 6.0, but can be used with QCWin dib.c ³ by changing the CC = cl line to read CC = cl -qc and dib.h ³ changing the line CFLAGS_R_WDLL = /Ox /DNDEBUG to dibutil.c ³ CFLAGS_R_WDLL = /O /DNDEBUG dibutil.def ³ dibutil.h ÄÄÙ dibutil.dll Precompiled bitmap utility library