//BitmapBuddy .5 include"bb-aux .5" string fulltitle; int scale; int bmpwidth, bmpheight; int bmp[400]; //positions of bmps int top, left, bot, right, minitop,minileft; //button bmp strings and height recorders: int butDoneY; string butDone; int butLoadY; string butLoad; int programDone; int pow2[10]; initPow2(){ int k;int n; n=1; for(k=0;k<10;k++){ pow2[k]=n; n=n*2; } } displayHex(){ int i,j, intsInRow; string s; graph_off(); clear(); s=hex(bmpwidth); s=strright(s,strlen(s)-2); if(strlen(s)==1) s="0"+s; puts(s); intsInRow = bmpwidth / 4; if(bmpwidth % 4 != 0) intsInRow = intsInRow + 1; for(j = 0; j < bmpheight ; j++) { for(i = 0; i < intsInRow ; i++) { puts(strright(hex(bmp[(j*10) + i]),1)); } } } drawFrames(){ frame(1,left,top,right,bot,0); frame(1,minileft,minitop,minileft + bmpwidth,minitop+bmpheight,0); } initButtons(){ butDone = "14fffff8000180001a88bb904ababeab904bba88018000180001800018000180001b125daab51aaad9aaa51b125d80001fffff"; butDoneY=130; butLoad="14fffff80001aa801b5415a0509af495a05c9af495a0509af415a0401bfc0180001a1131a2aa9a2aa9a2ba9b92b180001fffff"; butLoadY=105; } drawButtons(){ //frame(1,140,butDoneY,159,butDoneY+20,3); //text(141,butDoneY+4," ->T"); //frame(1,140,butLoad,159,butLoad+20,3); //text(141,butLoadY+4," <-T"); bitmap(140,butLoadY,butLoad); bitmap(140,butDoneY,butDone); } paintSquare(int color, int myxc, int myyc){ int tx,ty; tx=left+(myxc*scale); ty=top+(myyc*scale); rect(color, tx,ty, tx+scale,ty+scale,0); line(color,minileft+myxc,minitop+ myyc, minileft+myxc,minitop+ myyc); } repaint(){ int a,b,temp; for(b=0; b=butDoneY && uy<=butDoneY+20){ displayHex(); programDone=1; } if(uy>=butLoadY && uy<=butLoadY+20){ load(gets("memo name?")); } } isInCanvas(int myx, int myy){ return(myx>left&&myx top && myy =140){ checkButton(penx(),peny()); } if(e==2 || e==4){ x=penx(); y=peny(); if(isInCanvas(x,y)){ xc=getSquare(x,left); yc=getSquare(y,top); temp = ((yc*40)+xc); whichint = temp/4; whichbit = 3-(temp%4); currentcolor = isBitOn(bmp[whichint],whichbit); if(e==2) {//pendown, find color if(currentcolor == 1)pencolor=0; else pencolor = 1; } if(pencolor != currentcolor){ if(pencolor==1) bitOn(whichint, whichbit); else bitOff(whichint, whichbit); paintSquare(pencolor,xc,yc); }//end changed } } }//end pen move } } else alert("max size40 x 40"); }