Older Version
Newer Version
StPendl
Jun 3, 2009
=HTML Coder= The purpose of this is to simply the creation of a web page involving graphic images, a block of text, and a Heading. I find it useful sometimes in converting untidy emails such as those set left of centre, with unnecessary massive TPI print, and inter line spacing. A number of such conversions can often bee seen from contributions I receive each day at <span style="color: black;"><span style="color: #0000cc;">[[http://www.sigord.co.uk/News.htm]]</span> <span style="mso-spacerun: yes;"> </span>A number of sites host the complete package such as at </span> [[http://download.cnet.com/HTMLcoder/3000-10247_4-10906797.html?tag=mncol]] As you can see it allows for a variety of options such selecting the Text, heading and background colours along with the size of fonts, and width of the images. The height of the images are adjusted accordingly. Text is COPY and Pasted in, allowing for automatic reformatting to remove all extra line and word spacing. Also any single CHR$ such as the dreaded < can be removed. An extra option allows reformatted text to be saved as a TXT file. The HTML coding is fairly simple with my limitations, but others may be able to include greater improvements for their use. Gordon<span style="mso-spacerun: yes;"> </span>nomainwin<span style="mso-spacerun: yes;"> </span>'[[code format="vbnet"]] nomainwin ' Beginners HTML Thanks to Alyce for image323.dll<span style="mso-spacerun: yes;"> </span>dimdim dir$(10,3) : dim pic$(60,2)<span style="mso-spacerun: yes;"> </span>head$head$ = "" : hfile$ = "" : tfile$ = "" : this$ = DefaultDir$<span style="mso-spacerun: yes;"> </span>tcol$tcol$ = "000000" : bcol$ = "FFFFFF"<span style="mso-spacerun: yes;"> </span>txtsize$txtsize$ = "3" : headsize$ = "5" : imagewidth$ = "500"<span style="mso-spacerun: yes;"> </span>openopen "image323.dll" for dll as #im [main]<span style="mso-spacerun: yes;"> </span>WindowWidthWindowWidth = 800 : WindowHeight = 600<span style="mso-spacerun: yes;"> </span>buttonbutton #h, "Text Colour", [textcol], UL, 140, 140<span style="mso-spacerun: yes;"> </span>buttonbutton #h, "Back Colour", [backcol], UL, 320, 140<span style="mso-spacerun: yes;"> </span>buttonbutton #h, "Heading", [heading], UL, 470, 140<span style="mso-spacerun: yes;"> </span>buttonbutton #h, "Colour", [headcol], UL, 540, 140<span style="mso-spacerun: yes;"> </span>buttonbutton #h, "Text Window", [text], UL, 175, 180<span style="mso-spacerun: yes;"> </span>buttonbutton #h, "Insert JPGs", [jpg], UL, 296, 180<span style="mso-spacerun: yes;"> </span>buttonbutton #h, "Save web page", [page], UL, 416, 180<span style="mso-spacerun: yes;"> </span>buttonbutton #h, "Save text", [file], UL, 550, 180<span style="mso-spacerun: yes;"> </span>buttonbutton #h,"<span style="mso-spacerun: yes;"> </span>Text"Text Size ", [textsize], UL, 180, 220<span style="mso-spacerun: yes;"> </span>buttonbutton #h, "Heading Size ", [headsize], UL, 350, 220<span style="mso-spacerun: yes;"> </span>buttonbutton #h, "Images Width", [imgwidth], UL, 520, 220<span style="mso-spacerun: yes;"> </span>buttonbutton #h, "Display HTML", [show], UL, 180, 280<span style="mso-spacerun: yes;"> </span>buttonbutton #h, "Test web page", [test], UL, 300, 280<span style="mso-spacerun: yes;"> </span>buttonbutton #h, "Display .txt", [tfile], UL, 430, 280<span style="mso-spacerun: yes;"> </span><span style="mso-ansi-language: FR;">buttonbutton #h, "* QUIT *", [quit], UL, 550, 280</span> <span style="mso-ansi-language: FR; msoansilanguage: FR; msospacerun: yes;"> </span>openopen "Simple Web Pages" for graphics_nsb as #h<span style="mso-spacerun: yes;"> </span>#h#h "trapclose [quit]; font arial 18 bold; place 280 40; down"<span style="mso-spacerun: yes;"> </span>#h#h "\Simple Web Pages"<span style="mso-spacerun: yes;"> </span>#h#h "font arial 8 bold; color black; place 250 56"<span style="mso-spacerun: yes;"> </span>#h#h "\Produced with Liberty Basic - ver 2.1- Gordon Sweet"<span style="mso-spacerun: yes;"> </span>#h#h "font arial 10 bold; place 180 80; color darkgreen"<span style="mso-spacerun: yes;"> </span>#h#h "\You can import any text by using COPY then Text Window Options to"<span style="mso-spacerun: yes;"> </span>#h#h "\PASTE, up to 50 JPGs must be placed in an adjoining folder to this"<span style="mso-spacerun: yes;"> </span>#h#h "\program. The HTML file that is saved and the folder must be uploaded."<span style="mso-spacerun: yes;"> </span>#h#h "\Note the display of samples such as the colours etc is only temporary."<span style="mso-spacerun: yes;"> </span>#h#h "font fixedsys 9; color black; place 250 160 " : #h "\Sample"<span style="mso-spacerun: yes;"> </span><span style="mso-ansi-language: PT-BR;">#h#h "place 610 160" : #h "\Sample"</span> <span style="mso-ansi-language: PT-BR;"><span style="mso-spacerun: yes;"> </span>#h#h "color darkblue"</span> <span style="mso-ansi-language: PT-BR;"><span style="mso-spacerun: yes;"> </span>#h#h "place 180 320" : #h "|Web page = ";hfile$</span> <span style="mso-ansi-language: PT-BR; msoansilanguage: PT-BR; msospacerun: yes;"> </span>#h#h "place 180 340" : #h "|Text file = ";tfile$<span style="mso-spacerun: yes;"> </span>#h#h "place 180 360" : #h "\HEADING = ";head$<span style="mso-spacerun: yes;"> </span>#h#h "place 180 260" : #h "\Current Text size 3, Heading size 5, Images width 500"<span style="mso-spacerun: yes;"> </span>#h#h "place 420 164; box 440 140; flush"<span style="mso-spacerun: yes;"> </span>'get'get DC of graphicbox<span style="mso-spacerun: yes;"> </span>gDC=GetDC(hwnd(#h)) <span style="mso-spacerun: yes;"> </span>'creategDC=GetDC(hwnd(#h)) 'create memory DC<span style="mso-spacerun: yes;"> </span>mDC=CreateCompatibleDC(gDC) <span style="mso-spacerun: yes;"> </span>hW=hwnd(#h)<span style="mso-spacerun: yes;"> </span>'graphicboxmDC=CreateCompatibleDC(gDC) hW=hwnd(#h)'graphicbox handle<span style="mso-spacerun: yes;"> </span>waitwait [textcol]<span style="mso-spacerun: yes;"> </span>gosubgosub [colours] : tcol$ = html$<span style="mso-spacerun: yes;"> </span>#h#h "place 250 160; color " + col$ : #h "\Sample"<span style="mso-spacerun: yes;"> </span>#h#h "color black"<span style="mso-spacerun: yes;"> </span>waitwait [backcol]<span style="mso-spacerun: yes;"> </span>gosubgosub [colours] : bcol$ = html$<span style="mso-spacerun: yes;"> </span>#h#h "backcolor ";col$ : #h "place 420 164; boxfilled 440 140"<span style="mso-spacerun: yes;"> </span>#h#h "backcolor white"<span style="mso-spacerun: yes;"> </span>waitwait [colours]<span style="mso-spacerun: yes;"> </span>colordialogcolordialog "red", col$<span style="mso-spacerun: yes;"> </span>ifif val(col$) = 0 then col$ ="0 0 0" : notice "black selected"<span style="mso-spacerun: yes;"> </span>r$r$ = word$(col$,1) : g$ = word$(col$,2) : b$ = word$(col$,3)<span style="mso-spacerun: yes;"> </span>html$html$ = RIGHT$("0"+dechex$(val(r$)),2)<span style="mso-spacerun: yes;"> </span>html$html$ = html$ + RIGHT$("0"+dechex$(val(g$)),2)<span style="mso-spacerun: yes;"> </span>html$html$ = html$ + RIGHT$("0"+dechex$(val(b$)),2)<span style="mso-spacerun: yes;"> </span>returnreturn [heading]<span style="mso-spacerun: yes;"> </span>promptprompt "Enter a heading";head$ : if head$ = "" then wait<span style="mso-spacerun: yes;"> </span>#h#h "place 180 360" : #h "\HEADING = ";head$ : wait [headcol]<span style="mso-spacerun: yes;"> </span>gosubgosub [colours] : hcol$ = html$<span style="mso-spacerun: yes;"> </span>#h#h "place 610 160; color " + col$ : #h "\Sample"<span style="mso-spacerun: yes;"> </span>#h#h "color black"<span style="mso-spacerun: yes;"> </span>waitwait [page]<span style="mso-spacerun: yes;"> </span>DefaultDir$DefaultDir$ = this$<span style="mso-spacerun: yes;"> </span>promptprompt "Enter filename.htm";hfile$<span style="mso-spacerun: yes;"> </span>ifif hfile$ = "" then wait<span style="mso-spacerun: yes;"> </span>openopen hfile$ for output as #2<span style="mso-spacerun: yes;"> </span>#2#2 "<html><head><title>Text & Images</title></head>"<span style="mso-spacerun: yes;"> </span>t$t$ ="<body><body bgcolor="+bcol$+">"<span style="mso-spacerun: yes;"> </span><span style="mso-ansi-language: FR;">#2#2 t$</span> <span style="mso-ansi-language: FR;"><span style="mso-spacerun: yes;"> </span>t$t$ = "<font face=arial><font size="+headsize$+"><font color="+hcol$+">"</span> <span style="mso-ansi-language: FR;"><span style="mso-spacerun: yes;"> </span>#2#2 t$</span> <span style="mso-ansi-language: FR;"><span style="mso-spacerun: yes;"> </span>t$t$ = "<br><b><center>"+head$+"</center></b><font>"</span> <span style="mso-ansi-language: FR;"><span style="mso-spacerun: yes;"> </span>#2#2 t$</span> <span style="mso-ansi-language: FR;"><span style="mso-spacerun: yes;"> </span>#2#2 "</center></b><font><br>"</span> <span style="mso-ansi-language: FR;"><span style="mso-spacerun: yes;"> </span>t$t$ = "<font face=arial><font size="+textsize$+"><font color="+tcol$+">"</span> <span style="mso-ansi-language: FR; msoansilanguage: FR; msospacerun: yes;"> </span><span style="mso-ansi-language: DE;">#2#2 t$</span> <span style="mso-ansi-language: DE;"><span style="mso-spacerun: yes;"> </span>#2#2 "<BLOCKQUOTE><b>"</span> <span style="mso-ansi-language: DE;"><span style="mso-spacerun: yes;"> </span>#2#2 new$</span> <span style="mso-ansi-language: DE;"><span style="mso-spacerun: yes;"> </span>#2#2 "</b></BLOCKQUOTE>"</span> <span style="mso-ansi-language: DE;"><span style="mso-spacerun: yes;"> </span>#2#2 t$</span> <span style="mso-ansi-language: DE; msoansilanguage: DE; msospacerun: yes;"> </span>forfor N = 1 to qtyFiles<span style="mso-spacerun: yes;"> </span>t$="<center><imgt$="<center><img src="+pic$(N,1)<span style="mso-spacerun: yes;"> </span>t$t$ = t$ +" width="+imagewidth$+" height="+pic$(N,2)+"></center><p>"<span style="mso-spacerun: yes;"> </span>ifif qtyFiles > 0 then #2 t$<span style="mso-spacerun: yes;"> </span>nextnext N<span style="mso-spacerun: yes;"> </span>#2#2 "</body><html>"<span style="mso-spacerun: yes;"> </span>closeclose #2<span style="mso-spacerun: yes;"> </span><span style="mso-ansi-language: PT-BR;">#h#h "place 180 320" : #h "|Web page = ";hfile$;</span> <span style="mso-ansi-language: PT-BR; msoansilanguage: PT-BR; msospacerun: yes;"> </span>#h#h "place 180 340" : #h "|Text file = ";tfile$<span style="mso-spacerun: yes;"> </span>waitwait [file]<span style="mso-spacerun: yes;"> </span>DefaultDir$DefaultDir$ = this$<span style="mso-spacerun: yes;"> </span>promptprompt "Enter filename.txt";tfile$<span style="mso-spacerun: yes;"> </span>ifif tfile$ = "" then wait<span style="mso-spacerun: yes;"> </span>openopen tfile$ for output as #2<span style="mso-spacerun: yes;"> </span>#2#2 new$<span style="mso-spacerun: yes;"> </span>closeclose #2<span style="mso-spacerun: yes;"> </span>#h#h "place 180 320" : #h "|Web page = ";hfile$;<span style="mso-spacerun: yes;"> </span>#h#h "place 180 340" : #h "|Text file = ";tfile$<span style="mso-spacerun: yes;"> </span>waitwait [textsize]<span style="mso-spacerun: yes;"> </span>promptprompt "Enter text size 1/7";textsize$ : q = val(textsize$)<span style="mso-spacerun: yes;"> </span>ifif q < 1 or q > 7 then notice "INVALID ENTRY !":<span style="mso-spacerun: yes;"> </span>textsize$:textsize$ = "3"<span style="mso-spacerun: yes;"> </span>#h#h "place 180 260"<span style="mso-spacerun: yes;"> </span>#h#h "\Current Text size ";textsize$;" Heading size ";headsize$;" Images width";imgwidth$;"<span style="mso-spacerun: yes;"> </span>" <span style="mso-spacerun: yes;"> </span>wait";imgwidth$;"" wait [headsize]<span style="mso-spacerun: yes;"> </span>promptprompt "Enter heading size 1/7";headsize$ : q = val(headsize$)<span style="mso-spacerun: yes;"> </span>ifif q < 1 or q > 7 then notice "INVALID ENTRY !" : headsize$ = "5"<span style="mso-spacerun: yes;"> </span>#h#h "place 180 260"<span style="mso-spacerun: yes;"> </span>#h#h "\Current Text size ";textsize$;" Heading size ";headsize$;" Images width";imgwidth$;"<span style="mso-spacerun: yes;"> </span>" <span style="mso-spacerun: yes;"> </span>wait";imgwidth$;"" wait [imgwidth]<span style="mso-spacerun: yes;"> </span>promptprompt "Enter images width over 99";imagewidth$ : q = val(imagewidth$)<span style="mso-spacerun: yes;"> </span>ifif q < 100 then notice "INVALID ENTRY !" : imagewidth$ = "500"<span style="mso-spacerun: yes;"> </span>#h#h "place 180 260"<span style="mso-spacerun: yes;"> </span>#h#h "\Current Text size ";textsize$;" Heading size ";headsize$;" Images width";imagewidth$;"<span style="mso-spacerun: yes;"> </span>" <span style="mso-spacerun: yes;"> </span>wait";imagewidth$;"" wait [show]<span style="mso-spacerun: yes;"> </span>ifif hfile$ = "" then notice "NO FILE !" : wait<span style="mso-spacerun: yes;"> </span><span style="mso-ansi-language: NL;">op$op$ = "notepad.exe "+hfile$ : run op$</span> <span style="mso-ansi-language: NL; msoansilanguage: NL; msospacerun: yes;"> </span>waitwait [test]<span style="mso-spacerun: yes;"> </span>ifif hfile$ = "" then notice "NO Web Page" : wait<span style="mso-spacerun: yes;"> </span>CALLCALL ShellExecute hWnd, hfile$<span style="mso-spacerun: yes;"> </span>waitwait [tfile]<span style="mso-spacerun: yes;"> </span>ifif tfile$ = "" then notice "NO FILE !" : wait<span style="mso-spacerun: yes;"> </span><span style="mso-ansi-language: NL;">op$op$ = "notepad.exe "+tfile$ : run op$</span> <span style="mso-ansi-language: NL; msoansilanguage: NL; msospacerun: yes;"> </span>waitwait [text]<span style="mso-spacerun: yes;"> </span>closeclose #h<span style="mso-spacerun: yes;"> </span>menumenu #t, "OPTIONS","Paste",[insert],"Clear",[clear],"Remove Blank Lines",[lines],_<span style="mso-spacerun: yes;"> </span>"Erase"Erase Character",[del],"Reformat Text",[format],|,"MAIN MENU", [quitclip]<span style="mso-spacerun: yes;"> </span>openopen "Text" for text as #t<span style="mso-spacerun: yes;"> </span><span style="mso-ansi-language: FR;">#t#t "!trapclose [quitclip]":<span style="mso-spacerun: yes;"> </span>#t:#t "!font fixedsys 9"</span> <span style="mso-ansi-language: FR;"><span style="mso-spacerun: yes;"> </span>wait </span> <span style="mso-ansi-language: FR;"> </span> <span style="mso-ansi-language: FR;">[insert] </span> <span style="mso-ansi-language: FR;"><span style="mso-spacerun: yes;"> </span>#t "!cls" : #t "!paste" : #t "!contents? new$"; </span> <span style="mso-ansi-language: FR;"><span style="mso-spacerun: yes;"> </span>#t "!contents? text$"; : #t "!cls" </span> <span style="mso-ansi-language: FR; msoansilanguage: FR; msospacerun: yes;"> </span>if len(text$) < 50 then notice "Text too short to reformat" : wait <span style="mso-spacerun: yes;"> </span>temp$ = "" : p = 1 : lp = 1: l = len(text$) <span style="mso-spacerun: yes;"> </span>while p < l+1 <span style="mso-spacerun: yes;"> </span>k$ = mid$(text$,p,1) <span style="mso-spacerun: yes;"> </span>k =asc(k$) : p= p + 1 <span style="mso-spacerun: yes;"> </span>new$ = new$ + chr$(k) <span style="mso-spacerun: yes;"> </span><span style="mso-ansi-language: NL;">temp$ = temp$ + chr$(k) : lp = lp + 1 </span> <span style="mso-ansi-language: NL; msoansilanguage: NL; msospacerun: yes;"> </span>if lp > 88 and k = 32 or lp > 124 then <span style="mso-spacerun: yes;"> </span>#t temp$ : temp$ = "" : lp = 0 <span style="mso-spacerun: yes;"> </span>end if <span style="mso-spacerun: yes;"> </span>wend <span style="mso-spacerun: yes;"> </span>#t "!contents? new$"; : #t "!origin 1 1" <span style="mso-spacerun: yes;"> </span>waitwait<span style="mso-spacerun: yes;"> </span>wait[insert] #t "!cls" : #t "!paste" : #t "!contents? new$"; #t "!contents? text$"; : #t "!cls" if len(text$) < 50 then notice "Text too short to reformat" : wait temp$ = "" : p = 1 : lp = 1: l = len(text$) while p < l+1 k$ = mid$(text$,p,1) k =asc(k$) : p= p + 1 new$ = new$ + chr$(k) temp$ = temp$ + chr$(k) : lp = lp + 1 if lp > 88 and k = 32 or lp > 124 then #t temp$ : temp$ = "" : lp = 0 end if wend #t "!contents? new$"; : #t "!origin 1 1" wait wait [clear]<span style="mso-spacerun: yes;"> </span>#t#t "!cls" : text$ = "" : #t "!copy" ;<span style="mso-spacerun: yes;"> </span>waitwait [lines]<span style="mso-spacerun: yes;"> </span>text$text$ = new$<span style="mso-spacerun: yes;"> </span>ifif len(text$) < 5 then notice "NO REAL TEXT !!" : wait<span style="mso-spacerun: yes;"> </span>new$new$ = "" : p = 1 : l = len(text$) : k1 = 0 : ls = 0<span style="mso-spacerun: yes;"> </span>whilewhile p < l+1<span style="mso-spacerun: yes;"> </span>okok = 0<span style="mso-spacerun: yes;"> </span>k$k$ = mid$(text$,p,1) : k = asc(k$)<span style="mso-spacerun: yes;"> </span>ifif k = 13 and k1 <> 999 then ls = 0<span style="mso-spacerun: yes;"> </span>ifif k = 9 or k > 31 and k < 127 then ok = 1<span style="mso-spacerun: yes;"> </span>ifif k = 13 and ls = 0 then<span style="mso-spacerun: yes;"> </span>new$new$ = new$ + chr$(13)+chr$(10)<span style="mso-spacerun: yes;"> </span>lsls = 1 : k1 = 999 : p = p + 1<span style="mso-spacerun: yes;"> </span>endend if<span style="mso-spacerun: yes;"> </span>ifif ok = 1 then new$ = new$ + chr$(k) : k1 = k<span style="mso-spacerun: yes;"> </span>pp = p + 1<span style="mso-spacerun: yes;"> </span>wend <span style="mso-spacerun: yes;"> </span>text$wend text$ = new$ : #t "!cls" : #t text$<span style="mso-spacerun: yes;"> </span><span style="mso-ansi-language: FR;">#t#t "!contents? new$"; : #t "!origin 1 1"</span> <span style="mso-ansi-language: FR; msoansilanguage: FR; msospacerun: yes;"> </span>waitwait [del]<span style="mso-spacerun: yes;"> </span>ifif new$ = "" then notice "NO TEXT !!" : wait<span style="mso-spacerun: yes;"> </span>d$d$ = "" : prompt "Enter one character to delete"; d$<span style="mso-spacerun: yes;"> </span>ifif len(d$) <> 1 then notice "ONE CHARACTER ONLY !!" : wait<span style="mso-spacerun: yes;"> </span><span style="mso-ansi-language: FR;">#t#t "!contents? text$"; : #t "!cls"</span> <span style="mso-ansi-language: FR; msoansilanguage: FR; msospacerun: yes;"> </span>ifif len(text$) < 50 then notice "Text too short to reformat" : wait<span style="mso-spacerun: yes;"> </span>x =asc(d$)x =asc(d$) : new$="""" : p = 1 : l = len(text$)<span style="mso-spacerun: yes;"> </span>whilewhile p < l+1<span style="mso-spacerun: yes;"> </span>okok = 0<span style="mso-spacerun: yes;"> </span>k$k$ = mid$(text$,p,1) : k = asc(k$)<span style="mso-spacerun: yes;"> </span>ifif k = 9 or k > 31 and k < 127 then ok = 1<span style="mso-spacerun: yes;"> </span>ifif k = 13 then<span style="mso-spacerun: yes;"> </span>new$new$ = new$ + chr$(13)+chr$(10)<span style="mso-spacerun: yes;"> </span>pp = p + 1<span style="mso-spacerun: yes;"> </span>endend if<span style="mso-spacerun: yes;"> </span>ifif ok = 1 and k <> x then new$ = new$ + chr$(k)<span style="mso-spacerun: yes;"> </span>pp = p + 1<span style="mso-spacerun: yes;"> </span>wend <span style="mso-spacerun: yes;"> </span>text$wend text$ = new$ : #t "!cls" : #t text$<span style="mso-spacerun: yes;"> </span><span style="mso-ansi-language: FR;">#t#t "!contents? new$"; : #t "!origin 1 1"</span> <span style="mso-ansi-language: FR;"><span style="mso-spacerun: yes;"> </span>wait </span> <span style="mso-ansi-language: FR;"> </span> <span style="mso-ansi-language: FR;">[format] </span> <span style="mso-ansi-language: FR;"><span style="mso-spacerun: yes;"> </span>#twait [format] #t "!contents? text$"; : #t "!cls"</span> <span style="mso-ansi-language: FR; msoansilanguage: FR; msospacerun: yes;"> </span>ifif len(text$) < 50 then notice "Text too short to reformat" : wait<span style="mso-spacerun: yes;"> </span>temp$temp$ = "" : p = 1 : lp = 1<span style="mso-spacerun: yes;"> </span>l =len(text$)l =len(text$) :k1= 0 <span style="mso-spacerun: yes;"> </span>whilek1=0 while p < l+1 : ok = 0<span style="mso-spacerun: yes;"> </span>k$k$ = mid$(text$,p,1)<span style="mso-spacerun: yes;"> </span>k =asc(k$)k =asc(k$) : p=pp + 1<span style="mso-spacerun: yes;"> </span>ifif k = 9 or k > 31 and k < 127 then ok = 1<span style="mso-spacerun: yes;"> </span>ifif k = 13 then k = 32 : ok = 1<span style="mso-spacerun: yes;"> </span>ifif k = 32 and k1 = 32 then ok = 0<span style="mso-spacerun: yes;"> </span>ifif ok = 1 then<span style="mso-spacerun: yes;"> </span>new$new$ = new$ + chr$(k) : k1 = k<span style="mso-spacerun: yes;"> </span><span style="mso-ansi-language: NL;">temp$temp$ = temp$ + chr$(k) : lp = lp + 1</span> <span style="mso-ansi-language: NL; msoansilanguage: NL; msospacerun: yes;"> </span>endend if<span style="mso-spacerun: yes;"> </span>ifif lp > 88 and k = 32 or lp > 124 then<span style="mso-spacerun: yes;"> </span>#t#t temp$ : temp$ = "" : lp = 0<span style="mso-spacerun: yes;"> </span>endend if<span style="mso-spacerun: yes;"> </span>wend <span style="mso-spacerun: yes;"> </span>#twend #t "!contents? new$"; : #t "!origin 1 1"<span style="mso-spacerun: yes;"> </span>waitwait [jpg]<span style="mso-spacerun: yes;"> </span>DefaultDir$DefaultDir$ = left$(DefaultDir$,2)+"\HTMLcode"<span style="mso-spacerun: yes;"> </span>filedialogfiledialog "Select any JPG file","*.jpg", File$<span style="mso-spacerun: yes;"> </span>ifif File$ = "" then wait<span style="mso-spacerun: yes;"> </span>sFile$sFile$ = noPath$(File$):<span style="mso-spacerun: yes;"> </span>plen:plen = len(File$)-len(sFile$)<span style="mso-spacerun: yes;"> </span>path$path$ = left$(File$,plen) : ext$ = "*.jpg"<span style="mso-spacerun: yes;"> </span>filesfiles path$, ext$, dir$()<span style="mso-spacerun: yes;"> </span>qtyFilesqtyFiles = val(dir$(0, 0))<span style="mso-spacerun: yes;"> </span>ifif qtyFiles > 50 then notice "LIMITED to maximum of 50)" : qtyFiles = 50<span style="mso-spacerun: yes;"> </span>'reformat'reformat the file information<span style="mso-spacerun: yes;"> </span>forfor x = 1 to qtyFiles<span style="mso-spacerun: yes;"> </span>dir$(x,dir$(x, 1) =right$("<span style="mso-spacerun: yes;"> </span>"right$("" + dir$(x, 1), 9)<span style="mso-spacerun: yes;"> </span>pic$(x,1) =<span style="mso-spacerun: yes;"> </span>dir$(x,pic$(x,1) =dir$(x, 0)<span style="mso-spacerun: yes;"> </span>nextnext x<span style="mso-spacerun: yes;"> </span>FLFL = len(path$)-1<span style="mso-spacerun: yes;"> </span>forfor TEST = FL to 1 step -1<span style="mso-spacerun: yes;"> </span>ifif mid$(path$,TEST,1)="\" then<span style="mso-spacerun: yes;"> </span>PLPL = FL-TEST : exit for<span style="mso-spacerun: yes;"> </span>endend if<span style="mso-spacerun: yes;"> </span>nextnext TEST<span style="mso-spacerun: yes;"> </span>dpath$dpath$ = right$(path$,PL+1)<span style="mso-spacerun: yes;"> </span>#h#h "place 10 390 " : #h"|";space$(20);qtyFiles;"<span style="mso-spacerun: yes;"> </span>JPGs"|";space$(20);qtyFiles;"JPGs FILESIN<span style="mso-spacerun: yes;"> </span>";dpath$IN";dpath$<span style="mso-spacerun: yes;"> </span>forfor j = 1 to qtyFiles<span style="mso-spacerun: yes;"> </span>jpg$jpg$ = jpg$ + " - ";pic$(j,1)<span style="mso-spacerun: yes;"> </span>ifif len(jpg$) > 70 then #h "\";jpg$ : jpg$ = ""<span style="mso-spacerun: yes;"> </span>pic$(j,1)pic$(j,1) = dpath$ + pic$(j,1) : bmp$ = pic$(j,1)<span style="mso-spacerun: yes;"> </span>gosubgosub [picsize] : f = val(imagewidth$)<span style="mso-spacerun: yes;"> </span>heightheight = int(f/bw * bh)<span style="mso-spacerun: yes;"> </span>pic$(j,2)pic$(j,2) = str$(height)<span style="mso-spacerun: yes;"> </span>nextnext : #h "\";jpg$<span style="mso-spacerun: yes;"> </span>waitwait [picsize]<span style="mso-spacerun: yes;"> </span>hImage=LoadImageFile(hW,bmp$) <span style="mso-spacerun: yes;"> </span>ifhImage=LoadImageFile(hW,bmp$) if hImage=0 then<span style="mso-spacerun: yes;"> </span>noticenotice "Function failed."<span style="mso-spacerun: yes;"> </span>cursorcursor normal<span style="mso-spacerun: yes;"> </span>wait <span style="mso-spacerun: yes;"> </span>endwait end if<span style="mso-spacerun: yes;"> </span>ifif hDemo<>0 then unloadbmp "demo"<span style="mso-spacerun: yes;"> </span>loadbmploadbmp "demo",hImage : hDemo=hbmp("demo")<span style="mso-spacerun: yes;"> </span>ifif bmp$ ="" then notice "NO image" : goto [quit]<span style="mso-spacerun: yes;"> </span>bw=BitmapWidth(hDemo)bw=BitmapWidth(hDemo) : bh=BitmapHeight(hDemo)<span style="mso-spacerun: yes;"> </span>returnreturn [quitclip] close #t : goto [main] [quit]<span style="mso-spacerun: yes;"> </span>ifif hDemo<>0 then unloadbmp "demo"<span style="mso-spacerun: yes;"> </span>ifif hImage<>0 then ok = DeleteObject(hImage)<span style="mso-spacerun: yes;"> </span>callcall ReleaseDC hwnd(#h), gDC<span style="mso-spacerun: yes;"> </span>callcall DeleteDC mDC<span style="mso-spacerun: yes;"> </span>closeclose #h : close #im : end<span style="mso-spacerun: yes;"> </span>FunctionFunction GetDC(hWnd)<span style="mso-spacerun: yes;"> </span>CallDLLCallDLL #user32, "GetDC",_<span style="mso-spacerun: yes;"> </span>hWndhWnd AsLong,_<span style="mso-spacerun: yes;"> </span>'windowLong,_'window or control handle<span style="mso-spacerun: yes;"> </span>GetDCGetDC AsLong<span style="mso-spacerun: yes;"> </span>'returnsLong'returns device context<span style="mso-spacerun: yes;"> </span>EndEnd Function Sub ReleaseDC hWnd, hDC<span style="mso-spacerun: yes;"> </span>CallDLL#user32,"ReleaseDC",_ <span style="mso-spacerun: yes;"> </span>hWndCallDLL#user32,"ReleaseDC",_ hWnd AsLong,_<span style="mso-spacerun: yes;"> </span>'windowLong,_'window or control handle<span style="mso-spacerun: yes;"> </span>hDChDC AsLong,_<span style="mso-spacerun: yes;"> </span>'handleLong,_'handle of DC to delete<span style="mso-spacerun: yes;"> </span>resultresult As Long<span style="mso-spacerun: yes;"> </span>EndEnd Sub Function CreateCompatibleDC(hDC)<span style="mso-spacerun: yes;"> </span>CallDLLCallDLL #gdi32,"CreateCompatibleDC",_<span style="mso-spacerun: yes;"> </span>hDChDC AsLong,_<span style="mso-spacerun: yes;"> </span>'windowLong,_'window DC<span style="mso-spacerun: yes;"> </span>CreateCompatibleDCCreateCompatibleDC AsLong<span style="mso-spacerun: yes;"> </span>'memoryLong'memory DC<span style="mso-spacerun: yes;"> </span>EndEnd Function Sub DeleteDC hDC<span style="mso-spacerun: yes;"> </span>CallDLLCallDLL #gdi32, "DeleteDC",_<span style="mso-spacerun: yes;"> </span>hDChDC AsLong,_<span style="mso-spacerun: yes;"> </span>'memoryLong,_'memory DC to delete<span style="mso-spacerun: yes;"> </span>rr As Boolean<span style="mso-spacerun: yes;"> </span>EndEnd Sub Function BitmapWidth(Hbmp)<span style="mso-spacerun: yes;"> </span>structstruct BITMAP,_<span style="mso-spacerun: yes;"> </span>bmTypebmType As Long,_<span style="mso-spacerun: yes;"> </span>bmWidthbmWidth As Long,_<span style="mso-spacerun: yes;"> </span>bmHeightbmHeight As Long,_<span style="mso-spacerun: yes;"> </span>bmWidthBytesbmWidthBytes As Long,_<span style="mso-spacerun: yes;"> </span>bmPlanesbmPlanes As Word,_<span style="mso-spacerun: yes;"> </span>bmBitsPixelbmBitsPixel As Word,_<span style="mso-spacerun: yes;"> </span>bmBitsbmBits As Long<span style="mso-spacerun: yes;"> </span>nSize=Len(BITMAP.struct) <span style="mso-spacerun: yes;"> </span>CallDLLnSize=Len(BITMAP.struct) CallDLL #gdi32, "GetObjectA", Hbmp As Long,_<span style="mso-spacerun: yes;"> </span>nSizenSize As Long,BITMAP As struct,_<span style="mso-spacerun: yes;"> </span>resultsresults As Long<span style="mso-spacerun: yes;"> </span>BitmapWidth=BITMAP.bmWidth.struct <span style="mso-spacerun: yes;"> </span>EndBitmapWidth=BITMAP.bmWidth.struct End Function Function BitmapHeight(Hbmp)<span style="mso-spacerun: yes;"> </span>structstruct BITMAP,_<span style="mso-spacerun: yes;"> </span>bmTypebmType As Long,_<span style="mso-spacerun: yes;"> </span>bmWidthbmWidth As Long,_<span style="mso-spacerun: yes;"> </span>bmHeightbmHeight As Long,_<span style="mso-spacerun: yes;"> </span>bmWidthBytesbmWidthBytes As Long,_<span style="mso-spacerun: yes;"> </span>bmPlanesbmPlanes As Word,_<span style="mso-spacerun: yes;"> </span>bmBitsPixelbmBitsPixel As Word,_<span style="mso-spacerun: yes;"> </span>bmBitsbmBits As Long<span style="mso-spacerun: yes;"> </span>nSize=Len(BITMAP.struct) <span style="mso-spacerun: yes;"> </span>CallDLLnSize=Len(BITMAP.struct) CallDLL #gdi32, "GetObjectA", Hbmp As Long,_<span style="mso-spacerun: yes;"> </span>nSizenSize As Long,BITMAP As struct,_<span style="mso-spacerun: yes;"> </span>resultsresults As Long<span style="mso-spacerun: yes;"> </span>BitmapHeight=BITMAP.bmHeight.struct <span style="mso-spacerun: yes;"> </span>EndBitmapHeight=BITMAP.bmHeight.struct End Function Function DeleteObject(hObject)<span style="mso-spacerun: yes;"> </span>CallDLLCallDLL #gdi32,"DeleteObject",_<span style="mso-spacerun: yes;"> </span>hObjecthObject AsLong,_<span style="mso-spacerun: yes;"> </span>'handleLong,_'handle of object<span style="mso-spacerun: yes;"> </span>DeleteObjectDeleteObject As Long 'returns whatever<span style="mso-spacerun: yes;"> </span>EndEnd Function Function LoadImageFile(hWnd, file$)<span style="mso-spacerun: yes;"> </span>'load'load an image from file,<span style="mso-spacerun: yes;"> </span>'bmp,'bmp, jpg, emf, wmf, ico<span style="mso-spacerun: yes;"> </span>'returns'returns handle of memory bmp<span style="mso-spacerun: yes;"> </span>calldllcalldll #im, "LoadImageFile",hWnd as ulong,_<span style="mso-spacerun: yes;"> </span>file$file$ as ptr,LoadImageFile as ulong<span style="mso-spacerun: yes;"> </span>EndEnd Function function noPath$(t$)<span style="mso-spacerun: yes;"> </span>whilewhile instr(t$, "\")<span style="mso-spacerun: yes;"> </span>t$t$ = mid$(t$, 2)<span style="mso-spacerun: yes;"> </span>wend <span style="mso-spacerun: yes;"> </span>noPath$wend noPath$ = t$<span style="mso-spacerun: yes;"> </span>endend function Sub ShellExecute hWnd, cf$<span style="mso-spacerun: yes;"> </span>parameterparameter =_SW_SHOWNORMAL<span style="mso-spacerun: yes;"> </span>'_SW_SHOWNORMAL' set up for viewing<span style="mso-spacerun: yes;"> </span>lpszOp$lpszOp$ = "open" +Chr$(0)<span style="mso-spacerun: yes;"> </span>'Chr$(0)' "open" or "play" or "print"<span style="mso-spacerun: yes;"> </span>lpszFile$lpszFile$ = cf$ + Chr$(0)<span style="mso-spacerun: yes;"> </span>lpszDir$lpszDir$ = DefaultDir$ + Chr$(0)<span style="mso-spacerun: yes;"> </span>lpszParams$=""lpszParams$="" + Chr$(0)<span style="mso-spacerun: yes;"> </span>CallDLLCallDLL #shell32, "ShellExecuteA", hWnd As long,lpszOp$ As ptr,lpszFile$ As ptr,_<span style="mso-spacerun: yes;"> </span>lpszParams$lpszParams$ As ptr,lpszDir$ As ptr,parameter As long, result As long<span style="mso-spacerun: yes;"> </span>EndEnd Sub[[code]]