StPendl StPendl Jan 10, 2008 - "Reverted to Oct 9, 2007 7:42 pm: to correct the contents"

Creating Submit Articles Here for Liberty BASIC Programmer's Encyclopedia

Liberty BASIC Programmer's Encyclopedia

Anybody can submit articles to the Liberty BASIC Programmer's Encyclopedia. You do not need to be a member of Wikispaces or of this site.

License
By adding content to the Liberty BASIC Programmer's Encyclopedia, you are bound by the license. If you do not want to release your work under this license, do not submit articles. Click HERE to read the License.

Article Guidelines
The Liberty BASIC Programmer's Encyclopedia is a place for full-length technical articles. Authors should make sure that articles are well-structured, that words are spelled correctly, and that all code works properly. Click HERE for help on technical writing.

When you submit an Image Map By: Mark Lee January 10, 2008 Download a zip file containing article, be aware this is not the end of your involvement. Few of us get it Just Right the very first time. Expect an example An image map LBPE editor to contact you with questions, suggestions, possible edits, etcetera for you to look over and take the proper action.

Adding Articles
  1. Click the edit button at the top of this page.
  2. Add your article to the list at the bottom of this page by typing a name for your page inside of double square brackets. If your article is a picture with clickable regions. Image maps are typically found on WebPages as navigational tools, allowing users to called "Using Arrays", your link would look like this: * [[Using Arrays]]
  3. Save the editing of this page.
  4. View this page and click on pictures the link you just created.
  5. On the new page, click the edit link and type or sections of a picture to go to paste your article.
  6. Please place your name and the date at the top of your article, along with a descriptive title.
  7. Save your edits. That's all there is to it!

Editing Articles
To learn how to use WikiText markup to edit site content, click HERE. You don't need to know WikiText, though. When you are editing a page, there is a button near the bottom to "Use Visual Editor." If you want to try some editing in a safe place where you can do no harm, play in the Test Area . Before finalizing the article, you can click the "Preview" button to see how your article will appear, and make changes as needed.

Additional Files
If your article requires images or other pages. How To Create an image with solid colored regions. Bitmaps (Bmps) take up a lot of space, so using high quality Jpegs might additional files, simply upload them and include links in your article. When you are editing a page there is a link in the upper right for "Images". Click this to view a list of all available files and images.

Article Placement
One of the organizers of the Liberty BASIC Programmer's Encyclopedia will tag your article for editing. If the organizers find it to be the better option. If you choose to use Jpegs, however, don’t use Microsoft Paint to save the Jpeg. The quality will not be good enough to create an image map. For my image map example, I used Adobe Photoshop Elements to save the Jpegs at the highest quality available. The next step is to convert the RGB color codes of the solid color regions to single numbers, which are used by windows to read pixel values. I used the following code to do this. [begin] input red input green input blue print RGB(red, green, blue) input again$ if again$ = "y" then [begin] end Function RGB(red, green, blue) RGB= red + (green * 256) + (blue * 65536) End Function Now, write a program to scan your image, indexing the color of each pixel in the clickable regions. Store this information in a Random Access File database. Colors that are not part of the clickable regions may be ignored or grouped together in a Case Else statment. Here's a code snippet of the scan process. 'index the pixels PixelNumber = 1 a viable article for yVar = 0 to 629 'Cycle through the height of the image to be scanned for xVar = 0 to 319 'Cycle through the width of the image to be scanned pixelLong = pixelLong(xVar, yVar) Select Case pixelLong Case 8421504 ' Face Part$ = "1" PUT #Body, PixelNumber PixelNumber = PixelNumber + 1 Case 16711553 ' Neck Part$ = "2" PUT #Body, PixelNumber PixelNumber = PixelNumber + 1 Case 16512 ' Shoulders Part$ = "3" PUT #Body, PixelNumber PixelNumber = PixelNumber + 1 Case 16646144 'Chest Part$ = "4" PUT #Body, PixelNumber PixelNumber = PixelNumber + 1 Case 254 ' Arms Part$ = "5" PUT #Body, PixelNumber PixelNumber = PixelNumber + 1 Case 131071 ' Hands Part$ = "6" PUT #Body, PixelNumber PixelNumber = PixelNumber + 1 Case 16711807 ' Stomach Part$ = "7" PUT #Body, PixelNumber PixelNumber = PixelNumber + 1 Case 16744448 ' Hips Part$ = "8" PUT #Body, PixelNumber PixelNumber = PixelNumber + 1 Case 98304 ' Legs Part$ = "9" PUT #Body, PixelNumber PixelNumber = PixelNumber + 1 Case 8388863 ' Feet Part$ = "10" PUT #Body, PixelNumber PixelNumber = PixelNumber + 1 Case Else 'Non Body Part Part$ = "0" PUT #Body, PixelNumber PixelNumber = PixelNumber + 1 End Select next xVar next yVar Such a program may run for several minutes to index large pictures. It took my computer about 8 minutes to index a little more than 200,000 pixels. (That’s a 320 x 630 size image.) The use of a few API/DLL calls, including the GetPixel function, the encyclopedia, it will be required. Function pixelLong(xVar, yVar) hGBox = hWnd(#t.box) hDC = hDC(hGBox) Open "gdi32"for DLL added to the all appropriate categories.

Confirmation
Organizers of the Liberty BASIC Programmer's Encyclopedia will make any modifications they feel are needed. Authors may accept or reject these changes before articles are listed in the appropriate categories and locked.

Article Modification in the Future
One of the advantages of this format is that it affords us the ability to update and modify the information. Organizers reserve the right to modify, expand, or delete articles as #gdi CallDLL #gdi, "GetPixel",_ hDC as Ulong,_ xVar as Long,_ yVar as Long,_ pixelLong as Long Close #gdi CallDLL#user32,"ReleaseDC", _ hGBox as Ulong, _ hDC as Ulong, _ result as Long End Function Function hDC(hGBox) Open "user32" for dll as #user CallDLL #user, "GetDC",_ hGBox as Ulong,_ hDC as Ulong Close #user End Function Each clickable region they determine such actions to be appropriate.

Who Can Edit Articles
Articles can have a separate picture associated with it. The new picture may replace the old picture when the mouse moves over the region or when a mouse button is either pressed or released. For that matter, a different picture could be triggered with each of the mentioned events. Options at this point are only hindered edited by your imagination. The Image Scan program included in the download at the top of this article demonstrates the scan step, and the Image Map program demonstrates using the stored information to simulate an image map. I would like to thank Alyce for the use of her DLL for viewing jpegs, and I would like to thank Janet for her suggestions and tips. the original authors and by the site organizers. Others should suggest changes via the site's dicussion feature.



LIST ARTICLES HERE