Date: 02-16-2022
Return to Index
created by gbSnippets
'The BMP Tutor Series consists of about 10 reference/tutorial
'snippets. These include some code.
'All of the BMP Tutor Series snippets are intended to covered
'24bit and 32bit bitmaps only. Much of the code works for bitmaps
'of any resolution. But examples of data structure member values,
'pallettes, and color array data are written specifically for 24/32bit
'bitmaps.
'There are several basic ways a PowerBASIC programmer can load a
'bitmap from a file, edit the image, and save the changes to a file.
'1. Load the bitmap file with the LoadImage API, select it into a
' device context, use various API to modify the content and then
' save the DC content to a file.
'2. Use GRAPHIC statements to load the bitmap directly into a graphic
' target, use various GRAPHIC statements to modify the image, and
' then use GRAPHIC SAVE to place the image into a file.
'3. Read the two headers (file and info) and the image color data
' using GET statements (placing the color data directly into an array),
' modify the array elements (color data), then use PUT to write
' the headers and array to a file.
'When complete, the series will also include the following snippets:
'10 Read *.bmp (file) --> hBMP LoadImage
'11 Read *.bmp (resource) --> hBMP LoadImage
'12 Read *.bmp (file) --> hDIB LoadImage
'12 Read *.bmp (file) --> hBMP Get/Put
'13 Read *.ico --> hIcon LoadImage
'14 Read *.ico --> hIcon Get/Put
'15 Read *.jpg --> hBMP
'16 Read *.png --> hBMP
'17 Read *.gif --> hBMP
'20 Read Clipboard --> hBMP
'21 Capture Screen --> hBMP
'30 Manually Create --> hBMP
'31 Manually Create --> hDIB
'41 Convert hDIB --> hBMP 'create one from the other
'42 Convert hBMP --> hDIB 'create one from the other
'50 Save DC --> *.bmp
'51 Save DC --> *.ico
'52 Save DC --> *.jpg
'53 Save DC --> *.png
'54 Save DC --> *.gif
'54 Save DC --> Clipboard
'60 Create *.bmp by Code
'61 Create *.ico by Code
'62 Create *.jpg by Code
'63 Create *.png by Code
'64 Create *.gif by Code
'70 Get Bitstring From DC DC --> bmp$
'71 Apply Bitstring To DC bmp$ --> DC
'72 Get ColorArray From DC DC --> Colors(x,y)
'73 Apply ColorArray To DC Colors(x,y) --> DC
'74 Convert bmp$ --> Colors(x,y)
'75 Convert Colors(x,y) --> bmp$
'80 Convert *.jpg --> *.bmp
'81 Convert *.png --> *.bmp
'82 Convert *.gif --> *.bmp
'83 Convert *.ico --> *.bmp
'84 Convert *.bmp --> *.ico
'85 Convert *.bmp --> *.jpg
'86 Convert *.bmp --> *.png
'87 Convert *.bmp --> *.gif
'In no particular order, here are URLs from which I've found information
'of value in creating these 'BMP Tutor' snippets/tutorials.
http://www.runicsoft.com/bmp.php
http://www.mvps.org/user32/gditutorial.html
http://www.functionx.com/win32/
http://www.functionx.com/win32/Lesson13.htm
http://windows-programming.suite101.com/article.cfm/win32_drawing_and_bitmaps_howto
http://www.winprog.org/tutorial/bitmaps.html
http://Local.wasp.uwa.edu.au/~pbourke/dataformats/bmp/
http://www.relisoft.com/Win32/Bitmap.html
http://en.wikipedia.org/wiki/BMP_file_format
http://www.codeproject.com/KB/graphics/gditutorial.aspx?msg=910181
http://edais.mvps.org/Tutorials/GDI/DDB/DDBch1.html
http://www.suite101.com/reference/device_context
http://www.vbexplorer.com/VBExplorer/gdi.asp
AndreaVB
VBAccelerator
CodeProject.com
VBExplorer
'gbs_00533
'Date: 03-10-2012
http://www.garybeene.com/sw/gbsnippets.htm