StPendl
Jan 10, 2008
- "Reverted to Oct 9, 2007 7:42 pm: to correct the contents"
=Creating an Image Map= ===By: Mark Lee=== January 10, 2008 [[http://www.geocities.com/msl_007/ImageMapProgram.zip|Download]] a zip file containing an example=Submit Articles Here for Liberty BASIC Programmer's Encyclopedia= [[home|Liberty BASIC Programmer's Encyclopedia]]An image map isAnybody can submit articles to the Liberty BASIC Programmer's Encyclopedia. You do not need to be apicture with clickable regions. Image maps are typically found on WebPages as navigational tools, allowing users to click on picturesmember of Wikispaces orsectionsofa picture to go to other pages.this site.==How To==**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. [[License|Click HERE to read the License.]]Create an image with solid colored regions. Bitmaps (Bmps) take up**Article Guidelines** The Liberty BASIC Programmer's Encyclopedia is alot of space, so using high quality Jpegs might 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.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. [[tech.writing|Click HERE for help on technical writing.]][[image:http://www.geocities.com/msl_007/Body.jpg]]When you submit an article, be aware this is not the end of your involvement. Few of us get it Just Right the very first time. Expect an LBPE editor to contact you with questions, suggestions, possible edits, etcetera for you to look over and take the proper action.The next step is to convert**Adding Articles** # Click theRGB color codes ofedit button at thesolid color regionstop of this page. # Add your article tosingle numbers, which are usedthe [[http://lbpe.wikispaces.com/Submit#list|list at the bottom of this page]] bywindows to read pixel values. I usedtyping a name for your page inside of double square brackets. If your article is called "Using Arrays", your link would look like this: ``* [[Using Arrays]] `` # Save thefollowing codeediting of this page. # View this page and click on the link you just created. # On the new page, click the edit link and type or paste your article. # Please place your name and the date at the top of your article, along with a descriptive title. # Save your edits. That's all there is todo this.it![[code format="php"]] [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 [[code]]**Editing Articles** To learn how to use WikiText markup to edit site content, click [[www:wikitext|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 [[TestArea|Test Area]]. Before finalizing the article, you can click the "Preview" button to see how your article will appear, and make changes as needed.Now, write a program to scan**Additional Files** If yourimage, indexing the color of each pixelarticle requires images or other additional files, simply upload them and include links in your article. When you are editing a page there is a link in theclickable regions. Storeupper right for "Images". Click thisinformation into view aRandom Access File database. Colors that are not partlist ofthe clickable regions may be ignored or grouped together in a Case Else statment. Here's a code snippet of the scan process.all available files and images.[[code format="vb"]] 'index**Article Placement** One of thepixels PixelNumber = 1 for yVar = 0 to 629 'Cycle through the heightorganizers of theimageLiberty BASIC Programmer's Encyclopedia will tag your article for editing. If the organizers find it to bescanned for xVar = 0a viable article for the encyclopedia, it will be added to319 'Cycle throughthewidth of the image to be scannedall appropriate categories.pixelLong = pixelLong(xVar, yVar)**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.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 [[code]] 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**Article Modification in theGetPixel function, will be required. [[code format="vb"]] Function pixelLong(xVar, yVar) hGBox = hWnd(#t.box) hDC = hDC(hGBox) Open "gdi32"for DLL 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 [[code]] Each clickable region 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 eachFuture** One of thementioned events. Options at this point are only hindered by your imagination. The Image Scan program included in the download at the topadvantages of thisarticle demonstratesformat is that it affords us thescan step,ability to update and modify theImage Map program demonstrates usinginformation. Organizers reserve thestored informationright tosimulate an image map. I would likemodify, expand, or delete articles as they determine such actions tothank [[http://alycesrestaurant.com/|Alyce]] for the use of her DLL for viewing jpegs, and I would like to thank [[http://www.janetterra.com/|Janet]] for her suggestions and tips.be appropriate. **Who Can Edit Articles** Articles can be edited by the original authors and by the site organizers. Others should suggest changes via the site's dicussion feature. ----[[#list]] **LIST ARTICLES HERE** * [[Scientific precision]] - by Grahame King - ADDED TO NUMBERS AND MATH [[user:Alyce|1156422124]] * [[file.operations|copying,moving,deleting and renaming files]] - by Alex Barfoot - added to Using Files, Windows API [[user:Alyce|1156793631]] * [[Listview, trapping double click]] - by Eldron Gill - Added to Windows API [[user:JanetTerra]], October 10, 2006 * [[CryptographyWithLB102]] - by Cryptoman - Added to Strings and Text [[user:JanetTerra|1161815650]] * [[A True API Popup Menu - By Duncan B]] - added to Windows API [[user:Alyce|1174581409]] * [[Calculating the Value of PI]] - By Frank West added to Numbers and Math [[user:Alyce|1180528538]] * [[Running a LB program from the System Tray]] - By Duncan B. (added to Advanced Tutorials by [[user:Alyce]] ) * [[TOE Charts|Programming Using TOE Charts]] - By Noble D. Bell (added to General tutorials by [[user:Alyce]] ) * [[Sprite Boundary Detection Tip]] - By Ben Jimenez - Added to Graphics and Games > Sprite Games [[user:JanetTerra]] * [[Managing Multiple Windows]] - By Harmon V. * [[Byte Mode Programming]] - Added to General Tutorial [[user:Alyce]] * [[Indexed Random Access in Native LB]] [[user:Alincon2001]] - added to [[uncategorized|Uncategorized Contributions]]* [[Creating and Image Map]] - by Mark Lee