All pixels cleared.
"); msgwinpxcld.document.write("
"); msgwinpxcld.document.close(); } function xbmst() { var rowofnibs = ""; for ( i3=0; i3 < 256; i3 += 8 ) { var dubnibble = ""; for ( i5=4; i5 >= 0; i5 -= 4 ) { var incipnibble = 0; var whichbitinnibble = 1; for ( i4=0; i4 < 4; i4++ ) { var temp4 = i3 + i4 + i5; if ( tracker[temp4] ) { incipnibble = incipnibble + whichbitinnibble; } whichbitinnibble *= 2; } if ( incipnibble > 9 ) { incipnibble = incipnibble - 10; incipnibble = incipnibble + ""; if ( incipnibble == "0" ) incipnibble = "a"; if ( incipnibble == "1" ) incipnibble = "b"; if ( incipnibble == "2" ) incipnibble = "c"; if ( incipnibble == "3" ) incipnibble = "d"; if ( incipnibble == "4" ) incipnibble = "e"; if ( incipnibble == "5" ) incipnibble = "f"; } dubnibble = dubnibble + incipnibble; } rowofnibs = rowofnibs + dubnibble; // string concatenation } var Xbmvars = new Array(32); for ( i6=0; i6 < 32; i6++ ) { var temp8; if ( rowofnibs.length > 0 ) { temp8 = rowofnibs.substring(0,2); rowofnibs = rowofnibs.substring(2,rowofnibs.length); Xbmvars[i6] = temp8; } } var bitmapportion = " 0x"; for ( i7=0; i7 < 32; i7++ ) { bitmapportion = bitmapportion + Xbmvars[i7]; if ( !(( i7 + 1 ) == 32 ) ) { bitmapportion = bitmapportion + ", 0x"; } } // addendum for cross-browser if ( navigator.appName=="Netscape" && parseFloat(navigator.appVersion) < 4.0 ) { var xstrgpic = "#define xbm_width 16 \n#define xbm_height 17 \nstatic char xbm_bits[] = \{"; xstrgpic = xstrgpic + " 0x00,0x00," + bitmapportion + " \};"; return xstrgpic; } else { var xstrgpic = "#define xbm_width 16 \n#define xbm_height 16 \nstatic char xbm_bits[] = \{"; xstrgpic = xstrgpic + bitmapportion + " \};"; return xstrgpic; } }; function imageThisXBM(leaveunlessdemo) { var temp10 = xbmst(); var imgXBMwin = window.open("","imageXBMwin","width=237,height=277,toolbar=no,menubar=yes,status=no"); imgXBMwin.document.open("text/html"); if (!leaveunlessdemo) { imgXBMwin.document.write("\n"); } else { imgXBMwin.document.write("\n"); } imgXBMwin.document.write("
\nembedded X-Bitmap image from Xgraphics.html\n"); } else { imgXBMwin.document.write(" vspace='1' hspace='1' width='16' height='16'>\n"); } imgXBMwin.document.write("
\n XBM code (save in a file with .xbm extension):

"); imgXBMwin.document.write("
\n\n"); if (!leaveunlessdemo) { imgXBMwin.document.write("\\<\!\-\-\n\nfunction lastdemoalert() \{\n alert(\"\\n Demo complete. To view additional 'Xgraphics' usage help, see the 'Help' link at bottom.\\n\")\;\n close()\;\} \n\/\/ \-\-\>\n\<\/SCRIPT\>"); } imgXBMwin.document.write(""); imgXBMwin.document.close(); } function demoXgraphics() { for (i5=0; i5<256; i5++ ) { tracker[i5]=false; document.images[i5].src = a[0].src; } alert("\n First, the user of this program clicks on each cell they want to be black. (In case of a mistake, one just clicks again on that cell, and it goes back to white. One may click on any number of cells any number of times, and in any order.)\n\n Each cell in the grid represents a 'pixel' (-that's a single picture element, in this case either black or white.)\n\n A demonstration example will be filled in for you now...\n"); tracker[3]=true; tracker[19]=true; tracker[33]=true; tracker[37]=true; tracker[48]=true; tracker[54]=true; for ( i=18; i<115; i+=16 ) tracker[i]=true; for ( i2=20; i2<118; i2+=16 ) tracker[i2]=true; for ( i3=0; i3<128; i3++ ) { if ( tracker[i3] == true ) document.images[i3].src = a[1].src; } alert("\n Next, this image will be displayed as it will look, along with the code you would need to copy and save into a file with the .XBM or .xbm filename extension that will tell browsers that the MIME type is 'image/x-xbitmap'.\n\n (This file type can't be viewed with all browsers; MS Internet Explorer(tm) below version 5.5, or Netscape browsers below version 3, may not show this image type.)\n"); imageThisXBM(false); for ( i4=0; i4<256; i4++ ) { tracker[i4]=false; document.images[i4].src = a[0].src; } } // -->

Xgraphics      1.32 for Navigator 3.x

 



Help with Xgraphics