templeos-info/public/Wb/Adam/Gr/SpriteBitMap.HC.HTML

702 lines
71 KiB
HTML
Executable File

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="generator" content="TempleOS V5.03">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="/style/templeos.css">
<script src="/script/templeos.js"></script>
<style type="text/css">
.cF0{color:#000000;background-color:#ffffff;}
.cF1{color:#0000aa;background-color:#ffffff;}
.cF2{color:#00aa00;background-color:#ffffff;}
.cF3{color:#00aaaa;background-color:#ffffff;}
.cF4{color:#aa0000;background-color:#ffffff;}
.cF5{color:#aa00aa;background-color:#ffffff;}
.cF6{color:#aa5500;background-color:#ffffff;}
.cF7{color:#aaaaaa;background-color:#ffffff;}
.cF8{color:#555555;background-color:#ffffff;}
.cF9{color:#5555ff;background-color:#ffffff;}
.cFA{color:#55ff55;background-color:#ffffff;}
.cFB{color:#55ffff;background-color:#ffffff;}
.cFC{color:#ff5555;background-color:#ffffff;}
.cFD{color:#ff55ff;background-color:#ffffff;}
.cFE{color:#ffff55;background-color:#ffffff;}
.cFF{color:#ffffff;background-color:#ffffff;}
</style>
</head>
<body>
<pre id="content">
<a name="l1"></a><span class=cF0>#</span><span class=cF1>help_index</span><span class=cF0> </span><span class=cF6>&quot;Graphics/Sprite;Sprites&quot;</span><span class=cF0>
<a name="l2"></a>
<a name="l3"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>SPBM_EXIT</span><span class=cF0> 0
<a name="l4"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>SPBM_MAIN_MENU</span><span class=cF0> 1
<a name="l5"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>SPBM_COLOR</span><span class=cF0> 2
<a name="l6"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>SPBM_DITHER_COLOR</span><span class=cF0> 3
<a name="l7"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>SPBM_WIDTH</span><span class=cF0> 4
<a name="l8"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>SPBM_PT</span><span class=cF0> 5
<a name="l9"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>SPBM_LINE</span><span class=cF0> 6
<a name="l10"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>SPBM_ARROW</span><span class=cF0> 7
<a name="l11"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>SPBM_RECT</span><span class=cF0> 8
<a name="l12"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>SPBM_CIRCLE</span><span class=cF0> 9
<a name="l13"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>SPBM_TEXT</span><span class=cF0> 10
<a name="l14"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>SPBM_TEXT_BOX</span><span class=cF0> 11
<a name="l15"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>SPBM_TEXT_DIAMOND</span><span class=cF0> 12
<a name="l16"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>SPBM_FLOOD_FILL</span><span class=cF0> 13
<a name="l17"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>SPBM_FLOOD_FILL_NOT</span><span class=cF0> 14
<a name="l18"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>SPBM_POLYLINE</span><span class=cF0> 15
<a name="l19"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>SPBM_POLYPT</span><span class=cF0> 16
<a name="l20"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>SPBM_COPY</span><span class=cF0> 17
<a name="l21"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>SPBM_DELETE</span><span class=cF0> 18
<a name="l22"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>SPBM_PASTE</span><span class=cF0> 19
<a name="l23"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>SPBM_PASTE_TRANSPARENT</span><span class=cF0> 20
<a name="l24"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>SPBM_FIND_AND_REPLACE</span><span class=cF0> 21
<a name="l25"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>SPBM_TRIM_TO_EXTENTS</span><span class=cF0> 22
<a name="l26"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>SPBM_ADD_OUTLINE</span><span class=cF0> 23
<a name="l27"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>SPBM_ETCH</span><span class=cF0> 24
<a name="l28"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>SPBM_UNDO</span><span class=cF0> 25
<a name="l29"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>SPBM_SAVE_GR</span><span class=cF0> 26
<a name="l30"></a>
<a name="l31"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>GrInit4</span><span class=cF0>()
<a name="l32"></a>{
<a name="l33"></a> </span><span class=cF5>DefineLstLoad</span><span class=cF0>(</span><span class=cF6>&quot;ST_SPRITE_BITMAP_MENU&quot;</span><span class=cF0>,
<a name="l34"></a> </span><span class=cF6>&quot;Exit\0Main Menu\0Color\0Dither Color\0Width\0Point\0Line\0Arrow\0&quot;</span><span class=cF0>
<a name="l35"></a> </span><span class=cF6>&quot;Rect\0Circle\0Text\0Text Box\0Text Diamond\0Flood Fill\0&quot;</span><span class=cF0>
<a name="l36"></a> </span><span class=cF6>&quot;Flood Fill Not Color\0PolyLine\0PolyPoint\0Copy\0Delete\0Paste\0&quot;</span><span class=cF0>
<a name="l37"></a> </span><span class=cF6>&quot;Paste Transparent\0Find and Replace\0Trim to Extents\0Add Outline\0&quot;</span><span class=cF0>
<a name="l38"></a> </span><span class=cF6>&quot;Etch\0Undo\0Save GR\0&quot;</span><span class=cF0>);
<a name="l39"></a>}
<a name="l40"></a></span><span class=cF5>GrInit4</span><span class=cF0>;
<a name="l41"></a>
<a name="l42"></a></span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>PopUpSpriteBitMap</span><span class=cF0>(</span><span class=cF9>CColorROPU32</span><span class=cF0> color,</span><span class=cF9>I64</span><span class=cF0> width)
<a name="l43"></a>{
<a name="l44"></a> </span><span class=cF9>I64</span><span class=cF0> res;
<a name="l45"></a> </span><span class=cF1>U8</span><span class=cF0> *st1,*st2,buf[</span><span class=cF3>STR_LEN</span><span class=cF0>];
<a name="l46"></a> </span><span class=cF9>CDoc</span><span class=cF0> *doc=</span><span class=cF5>DocNew</span><span class=cF0>;
<a name="l47"></a>
<a name="l48"></a> </span><span class=cF5>Color2Str</span><span class=cF0>(buf,color);
<a name="l49"></a> </span><span class=cF1>if</span><span class=cF0> (color&amp;</span><span class=cF3>ROPF_DITHER</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l50"></a> st1=</span><span class=cF6>&quot;&quot;</span><span class=cF0>;
<a name="l51"></a> st2=buf;
<a name="l52"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
<a name="l53"></a> st1=buf;
<a name="l54"></a> st2=</span><span class=cF6>&quot;&quot;</span><span class=cF0>;
<a name="l55"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l56"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>&quot;$PURPLE$$TX+CX,\&quot;Sprite BitMap Menu\&quot;$\n&quot;</span><span class=cF0>
<a name="l57"></a> </span><span class=cF6>&quot;$LK+PU+CX,\&quot;Click for Help\&quot;,A=\&quot;FI:::/Doc/SpriteBitMap.DD.Z\&quot;$\n&quot;</span><span class=cF0>
<a name="l58"></a> </span><span class=cF6>&quot;\n$LTBLUE$$MU-UL,\&quot;Color %s\&quot;,LE=SPBM_COLOR$\n&quot;</span><span class=cF0>
<a name="l59"></a> </span><span class=cF6>&quot;$MU-UL,\&quot;Dither Color %s\&quot;,LE=SPBM_DITHER_COLOR$\n&quot;</span><span class=cF0>
<a name="l60"></a> </span><span class=cF6>&quot;$MU-UL,\&quot;Width %d\&quot;,LE=SPBM_WIDTH$\n&quot;</span><span class=cF0>
<a name="l61"></a> </span><span class=cF6>&quot;$MU-UL,\&quot;Find &amp; Replace Color\&quot;,LE=SPBM_FIND_AND_REPLACE$\n&quot;</span><span class=cF0>
<a name="l62"></a> </span><span class=cF6>&quot;$MU-UL,\&quot;Trim to Extents\&quot;,LE=SPBM_TRIM_TO_EXTENTS$\n&quot;</span><span class=cF0>
<a name="l63"></a> </span><span class=cF6>&quot;$MU-UL,\&quot;Add Outline\&quot;,LE=SPBM_ADD_OUTLINE$\n&quot;</span><span class=cF0>
<a name="l64"></a> </span><span class=cF6>&quot;$MU-UL,\&quot;Etch\&quot;,LE=SPBM_ETCH$\n&quot;</span><span class=cF0>
<a name="l65"></a> </span><span class=cF6>&quot;\n$MU-UL,\&quot;Point\&quot;,LE=SPBM_PT$\n&quot;</span><span class=cF0>
<a name="l66"></a> </span><span class=cF6>&quot;$MU-UL,\&quot;Line\&quot;,LE=SPBM_LINE$\n&quot;</span><span class=cF0>
<a name="l67"></a> </span><span class=cF6>&quot;$MU-UL,\&quot;Arrow\&quot;,LE=SPBM_ARROW$\n&quot;</span><span class=cF0>
<a name="l68"></a> </span><span class=cF6>&quot;$MU-UL,\&quot;Rect\&quot;,LE=SPBM_RECT$\n&quot;</span><span class=cF0>
<a name="l69"></a> </span><span class=cF6>&quot;$MU-UL,\&quot;Circle\&quot;,LE=SPBM_CIRCLE$\n&quot;</span><span class=cF0>
<a name="l70"></a> </span><span class=cF6>&quot;$MU-UL,\&quot;Text\&quot;,LE=SPBM_TEXT$\n&quot;</span><span class=cF0>
<a name="l71"></a> </span><span class=cF6>&quot;$MU-UL,\&quot;Text Box\&quot;,LE=SPBM_TEXT_BOX$\n&quot;</span><span class=cF0>
<a name="l72"></a> </span><span class=cF6>&quot;$MU-UL,\&quot;Text Diamond\&quot;,LE=SPBM_TEXT_DIAMOND$\n&quot;</span><span class=cF0>
<a name="l73"></a> </span><span class=cF6>&quot;$MU-UL,\&quot;Flood Fill\&quot;,LE=SPBM_FLOOD_FILL$\n&quot;</span><span class=cF0>
<a name="l74"></a> </span><span class=cF6>&quot;$MU-UL,\&quot;Flood Fill Not Color\&quot;,LE=SPBM_FLOOD_FILL_NOT$\n&quot;</span><span class=cF0>
<a name="l75"></a> </span><span class=cF6>&quot;$MU-UL,\&quot;PolyLine\&quot;,LE=SPBM_POLYLINE$\n&quot;</span><span class=cF0>
<a name="l76"></a> </span><span class=cF6>&quot;$MU-UL,\&quot;PolyPoint\&quot;,LE=SPBM_POLYPT$\n&quot;</span><span class=cF0>
<a name="l77"></a> </span><span class=cF6>&quot;\n$MU-UL,\&quot;Copy to Clip\&quot;,LE=SPBM_COPY$\n&quot;</span><span class=cF0>
<a name="l78"></a> </span><span class=cF6>&quot;$MU-UL,\&quot;Delete to Clip\&quot;,LE=SPBM_DELETE$\n&quot;</span><span class=cF0>
<a name="l79"></a> </span><span class=cF6>&quot;$MU-UL,\&quot;Paste Clip\&quot;,LE=SPBM_PASTE$\n&quot;</span><span class=cF0>
<a name="l80"></a> </span><span class=cF6>&quot;$MU-UL,\&quot;Paste Transparent Clip\&quot;,LE=SPBM_PASTE_TRANSPARENT$\n&quot;</span><span class=cF0>
<a name="l81"></a> </span><span class=cF6>&quot;\n$MU-UL,\&quot;Save GR File\&quot;,LE=SPBM_SAVE_GR$\n&quot;</span><span class=cF0>
<a name="l82"></a> </span><span class=cF6>&quot;\n$MU-UL,\&quot;Undo\&quot;,LE=SPBM_UNDO$\n&quot;</span><span class=cF0>
<a name="l83"></a> </span><span class=cF6>&quot;\n$PURPLE$$MU-UL,\&quot;+] Sprite Main Menu\&quot;,LE=SPBM_MAIN_MENU$$LTBLUE$\n&quot;</span><span class=cF0>
<a name="l84"></a> </span><span class=cF6>&quot;$MU-UL,\&quot;Exit Sprite\&quot;,LE=SPBM_EXIT$\n&quot;</span><span class=cF0>
<a name="l85"></a> </span><span class=cF6>&quot;$MU-UL,\&quot;Abort Sprite\&quot;,LE=DOCM_CANCEL$\n&quot;</span><span class=cF0>
<a name="l86"></a> </span><span class=cF6>&quot;\nRight-Click to get back to this menu.&quot;</span><span class=cF0>,st1,st2,width);
<a name="l87"></a> res=</span><span class=cF5>PopUpMenu</span><span class=cF0>(doc);
<a name="l88"></a> </span><span class=cF5>DocDel</span><span class=cF0>(doc);
<a name="l89"></a> </span><span class=cF1>return</span><span class=cF0> res;
<a name="l90"></a>}
<a name="l91"></a>
<a name="l92"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>GrBitMapEdPrepPersistentDC</span><span class=cF0>(</span><span class=cF9>CDC</span><span class=cF0> *dc,</span><span class=cF9>I64</span><span class=cF0> xx1,</span><span class=cF9>I64</span><span class=cF0> yy1,</span><span class=cF9>CDC</span><span class=cF0> *img)
<a name="l93"></a>{
<a name="l94"></a> </span><span class=cF5>DCFill</span><span class=cF0>(dc);
<a name="l95"></a> </span><span class=cF5>GrBlot</span><span class=cF0>(dc,xx1,yy1,img);
<a name="l96"></a>}
<a name="l97"></a>
<a name="l98"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>GrBitMapEdTrimToExtents</span><span class=cF0>(</span><span class=cF9>CDC</span><span class=cF0> **_img,</span><span class=cF9>I64</span><span class=cF0> *_xx1,</span><span class=cF9>I64</span><span class=cF0> *_yy1,
<a name="l99"></a> </span><span class=cF9>I64</span><span class=cF0> *_xx2,</span><span class=cF9>I64</span><span class=cF0> *_yy2,</span><span class=cF9>CColorROPU32</span><span class=cF0> bkcolor)
<a name="l100"></a>{
<a name="l101"></a> </span><span class=cF9>CDC</span><span class=cF0> *img=*_img;
<a name="l102"></a> </span><span class=cF9>I64</span><span class=cF0> i,c,
<a name="l103"></a> x1=0,y1=0,x2=img-&gt;width-1,y2=img-&gt;height-1; </span><span class=cF2>//inclusive</span><span class=cF0>
<a name="l104"></a> </span><span class=cF1>while</span><span class=cF0> (y1&lt;y2) </span><span class=cF7>{</span><span class=cF0>
<a name="l105"></a> </span><span class=cF1>for</span><span class=cF0> (i=x1;i&lt;=x2;i++) {
<a name="l106"></a> c=</span><span class=cF5>GrPeek</span><span class=cF0>(img,i,y1);
<a name="l107"></a> </span><span class=cF1>if</span><span class=cF0> (c!=bkcolor&amp;&amp;c!=</span><span class=cF3>TRANSPARENT</span><span class=cF0>) </span><span class=cF1>goto</span><span class=cF0> tr_y2;
<a name="l108"></a> }
<a name="l109"></a> y1++;
<a name="l110"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l111"></a>
<a name="l112"></a> tr_y2:
<a name="l113"></a> </span><span class=cF1>while</span><span class=cF0> (y1&lt;y2) </span><span class=cF7>{</span><span class=cF0>
<a name="l114"></a> </span><span class=cF1>for</span><span class=cF0> (i=x1;i&lt;=x2;i++) {
<a name="l115"></a> c=</span><span class=cF5>GrPeek</span><span class=cF0>(img,i,y2);
<a name="l116"></a> </span><span class=cF1>if</span><span class=cF0> (c!=bkcolor&amp;&amp;c!=</span><span class=cF3>TRANSPARENT</span><span class=cF0>) </span><span class=cF1>goto</span><span class=cF0> tr_x1;
<a name="l117"></a> }
<a name="l118"></a> y2--;
<a name="l119"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l120"></a>
<a name="l121"></a> tr_x1:
<a name="l122"></a> </span><span class=cF1>while</span><span class=cF0> (x1&lt;x2) </span><span class=cF7>{</span><span class=cF0>
<a name="l123"></a> </span><span class=cF1>for</span><span class=cF0> (i=y1;i&lt;=y2;i++) {
<a name="l124"></a> c=</span><span class=cF5>GrPeek</span><span class=cF0>(img,x1,i);
<a name="l125"></a> </span><span class=cF1>if</span><span class=cF0> (c!=bkcolor&amp;&amp;c!=</span><span class=cF3>TRANSPARENT</span><span class=cF0>) </span><span class=cF1>goto</span><span class=cF0> tr_x2;
<a name="l126"></a> }
<a name="l127"></a> x1++;
<a name="l128"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l129"></a>
<a name="l130"></a> tr_x2:
<a name="l131"></a> </span><span class=cF1>while</span><span class=cF0> (x1&lt;x2) </span><span class=cF7>{</span><span class=cF0>
<a name="l132"></a> </span><span class=cF1>for</span><span class=cF0> (i=y1;i&lt;=y2;i++) {
<a name="l133"></a> c=</span><span class=cF5>GrPeek</span><span class=cF0>(img,x2,i);
<a name="l134"></a> </span><span class=cF1>if</span><span class=cF0> (c!=bkcolor&amp;&amp;c!=</span><span class=cF3>TRANSPARENT</span><span class=cF0>) </span><span class=cF1>goto</span><span class=cF0> tr_done;
<a name="l135"></a> }
<a name="l136"></a> x2--;
<a name="l137"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l138"></a>
<a name="l139"></a> tr_done:
<a name="l140"></a> *_img=</span><span class=cF5>DCExt</span><span class=cF0>(img,x1,y1,x2,y2);
<a name="l141"></a> *_xx1+=x1; *_yy1+=y1;
<a name="l142"></a> *_xx2+=x2-(img-&gt;width-1); *_yy2+=y2-(img-&gt;height-1); </span><span class=cF2>//not inclusive</span><span class=cF0>
<a name="l143"></a> </span><span class=cF5>DCDel</span><span class=cF0>(img);
<a name="l144"></a>}
<a name="l145"></a>
<a name="l146"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>GrBitMapEdAddOutline</span><span class=cF0>(</span><span class=cF9>CDC</span><span class=cF0> *img,</span><span class=cF9>I64</span><span class=cF0> width,
<a name="l147"></a> </span><span class=cF9>CColorROPU32</span><span class=cF0> color,</span><span class=cF9>CColorROPU32</span><span class=cF0> bkcolor)
<a name="l148"></a>{
<a name="l149"></a> </span><span class=cF9>I64</span><span class=cF0> i,j,k,c;
<a name="l150"></a> </span><span class=cF9>CColorROPU32</span><span class=cF0> old_color;
<a name="l151"></a> </span><span class=cF9>CDC</span><span class=cF0> *src;
<a name="l152"></a> </span><span class=cF1>if</span><span class=cF0> (img-&gt;width &amp;&amp; img-&gt;height) </span><span class=cF7>{</span><span class=cF0>
<a name="l153"></a> old_color=img-&gt;color;
<a name="l154"></a> img-&gt;color=color;
<a name="l155"></a> </span><span class=cF1>while</span><span class=cF0> (width--&gt;0) {
<a name="l156"></a> src=</span><span class=cF5>DCExt</span><span class=cF0>(img,0,0,img-&gt;width-1,img-&gt;height-1);
<a name="l157"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i&lt;img-&gt;height;i++)
<a name="l158"></a> </span><span class=cF1>for</span><span class=cF0> (j=0;j&lt;img-&gt;width;j++)
<a name="l159"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>GrPeek</span><span class=cF7>(</span><span class=cF0>src,j,i</span><span class=cF7>)</span><span class=cF0>==bkcolor)
<a name="l160"></a> </span><span class=cF1>for</span><span class=cF0> (k=0;k&lt;8;k++) </span><span class=cF7>{</span><span class=cF0>
<a name="l161"></a> c=</span><span class=cF5>GrPeek</span><span class=cF0>(src,j+</span><span class=cFB>gr_x_offsets</span><span class=cF0>[k],i+</span><span class=cFB>gr_y_offsets</span><span class=cF0>[k]);
<a name="l162"></a> </span><span class=cF1>if</span><span class=cF0> (c&gt;=0 &amp;&amp; c!=bkcolor) {
<a name="l163"></a> </span><span class=cF5>GrPlot</span><span class=cF0>(img,j,i);
<a name="l164"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l165"></a> }
<a name="l166"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l167"></a> </span><span class=cF5>DCDel</span><span class=cF0>(src);
<a name="l168"></a> }
<a name="l169"></a> img-&gt;color=old_color;
<a name="l170"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l171"></a>}
<a name="l172"></a>
<a name="l173"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>GrBitMapEdEtch</span><span class=cF0>(</span><span class=cF9>CDC</span><span class=cF0> *img,</span><span class=cF9>I64</span><span class=cF0> width,</span><span class=cF9>CColorROPU32</span><span class=cF0> bkcolor)
<a name="l174"></a>{
<a name="l175"></a> </span><span class=cF9>I64</span><span class=cF0> i,j,k,c;
<a name="l176"></a> </span><span class=cF9>CColorROPU32</span><span class=cF0> old_color;
<a name="l177"></a> </span><span class=cF9>CDC</span><span class=cF0> *src;
<a name="l178"></a> </span><span class=cF1>if</span><span class=cF0> (img-&gt;width &amp;&amp; img-&gt;height) </span><span class=cF7>{</span><span class=cF0>
<a name="l179"></a> old_color=img-&gt;color;
<a name="l180"></a> img-&gt;color=bkcolor;
<a name="l181"></a> </span><span class=cF1>while</span><span class=cF0> (width--&gt;0) {
<a name="l182"></a> src=</span><span class=cF5>DCExt</span><span class=cF0>(img,0,0,img-&gt;width-1,img-&gt;height-1);
<a name="l183"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i&lt;img-&gt;height;i++)
<a name="l184"></a> </span><span class=cF1>for</span><span class=cF0> (j=0;j&lt;img-&gt;width;j++)
<a name="l185"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>GrPeek</span><span class=cF7>(</span><span class=cF0>src,j,i</span><span class=cF7>)</span><span class=cF0>!=bkcolor)
<a name="l186"></a> </span><span class=cF1>for</span><span class=cF0> (k=0;k&lt;8;k++) </span><span class=cF7>{</span><span class=cF0>
<a name="l187"></a> c=</span><span class=cF5>GrPeek</span><span class=cF0>(src,j+</span><span class=cFB>gr_x_offsets</span><span class=cF0>[k],i+</span><span class=cFB>gr_y_offsets</span><span class=cF0>[k]);
<a name="l188"></a> </span><span class=cF1>if</span><span class=cF0> (c&lt;0 || c==bkcolor) {
<a name="l189"></a> </span><span class=cF5>GrPlot</span><span class=cF0>(img,j,i);
<a name="l190"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l191"></a> }
<a name="l192"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l193"></a> </span><span class=cF5>DCDel</span><span class=cF0>(src);
<a name="l194"></a> }
<a name="l195"></a> img-&gt;color=old_color;
<a name="l196"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l197"></a>}
<a name="l198"></a>
<a name="l199"></a></span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>SpriteBitMapEd</span><span class=cF0>(</span><span class=cF9>CDoc</span><span class=cF0> *,</span><span class=cF9>CDocEntry</span><span class=cF0> *doc_e,</span><span class=cF9>CDC</span><span class=cF0> *dc,</span><span class=cF9>I64</span><span class=cF0> *_xx1,</span><span class=cF9>I64</span><span class=cF0> *_yy1,
<a name="l200"></a> </span><span class=cF9>I64</span><span class=cF0> *_xx2,</span><span class=cF9>I64</span><span class=cF0> *_yy2,</span><span class=cF9>CDC</span><span class=cF0> **_img,</span><span class=cF9>CColorROPU32</span><span class=cF0> bkcolor)
<a name="l201"></a>{
<a name="l202"></a> </span><span class=cF9>I64</span><span class=cF0> i,j,mode=</span><span class=cF3>SPBM_LINE</span><span class=cF0>,color=</span><span class=cF3>BLACK</span><span class=cF0>,width=1,msg_code,arg1,arg2,x1,y1,x11,y11,
<a name="l203"></a> x22,y22,res,xx1=*_xx1,yy1=*_yy1,xx2=*_xx2,yy2=*_yy2,
<a name="l204"></a> old_de_flags=doc_e-&gt;de_flags;
<a name="l205"></a> </span><span class=cF1>Bool</span><span class=cF0> down=</span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l206"></a> </span><span class=cF1>U8</span><span class=cF0> *st=</span><span class=cF3>NULL</span><span class=cF0>;
<a name="l207"></a> </span><span class=cF9>CEdFileName</span><span class=cF0> filename;
<a name="l208"></a> </span><span class=cF9>CDC</span><span class=cF0> *img=*_img,
<a name="l209"></a> *clip=</span><span class=cF3>NULL</span><span class=cF0>,*undo=</span><span class=cF3>NULL</span><span class=cF0>,*dc2;
<a name="l210"></a> </span><span class=cF5>SettingsPush</span><span class=cF0>; </span><span class=cF2>//See </span><a href="/Wb/Adam/TaskSettings.HC.HTML#l3"><span class=cF4>SettingsPush</span></a><span class=cF0>
<a name="l211"></a>
<a name="l212"></a> doc_e-&gt;de_flags|=</span><span class=cF3>DOCEF_DONT_DRAW</span><span class=cF0>;
<a name="l213"></a> </span><span class=cF1>goto</span><span class=cF0> bm_menu;
<a name="l214"></a>
<a name="l215"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF3>TRUE</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l216"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>kbd</span><span class=cF0>.scan_code&amp;</span><span class=cF3>SCF_CTRL</span><span class=cF0>)</span><span class=cF2>//grab scroll update?</span><span class=cF0>
<a name="l217"></a> </span><span class=cF5>GrBitMapEdPrepPersistentDC</span><span class=cF0>(dc,xx1,yy1,img);
<a name="l218"></a>
<a name="l219"></a> dc-&gt;color=</span><span class=cF3>ROPF_DITHER</span><span class=cF0>+</span><span class=cF3>WHITE</span><span class=cF0>&lt;&lt;16+</span><span class=cF3>BLACK</span><span class=cF0>;
<a name="l220"></a> dc-&gt;thick=1;
<a name="l221"></a> </span><span class=cF5>GrBorder</span><span class=cF0>(dc,xx1-1,yy1-1,xx2,yy2);</span><span class=cF2>//This is done little bit too often.</span><span class=cF0>
<a name="l222"></a>
<a name="l223"></a> </span><span class=cF1>while</span><span class=cF0> (msg_code=</span><span class=cF5>ScanMsg</span><span class=cF7>(</span><span class=cF0>&amp;arg1,&amp;arg2,1&lt;&lt;</span><span class=cF3>MSG_MS_L_DOWN</span><span class=cF0>|1&lt;&lt;</span><span class=cF3>MSG_MS_L_UP</span><span class=cF0>|
<a name="l224"></a> 1&lt;&lt;</span><span class=cF3>MSG_MS_R_DOWN</span><span class=cF0>|1&lt;&lt;</span><span class=cF3>MSG_MS_MOVE</span><span class=cF0>|1&lt;&lt;</span><span class=cF3>MSG_KEY_DOWN</span><span class=cF7>)</span><span class=cF0>) {
<a name="l225"></a> </span><span class=cF1>switch</span><span class=cF0> (msg_code) </span><span class=cF7>{</span><span class=cF0>
<a name="l226"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>MSG_KEY_DOWN</span><span class=cF0>:
<a name="l227"></a> </span><span class=cF1>switch</span><span class=cF0> (arg1) {
<a name="l228"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>CH_SHIFT_ESC</span><span class=cF0>:
<a name="l229"></a> res=</span><span class=cF3>SPE_ABORT</span><span class=cF0>;
<a name="l230"></a> </span><span class=cF1>goto</span><span class=cF0> bm_key_up_done;
<a name="l231"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>CH_ESC</span><span class=cF0>:
<a name="l232"></a> res=</span><span class=cF3>SPE_CONT</span><span class=cF0>;
<a name="l233"></a> </span><span class=cF1>goto</span><span class=cF0> bm_key_up_done;
<a name="l234"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'c'</span><span class=cF0>: </span><span class=cF2>//eye-dropper</span><span class=cF0>
<a name="l235"></a> dc2=</span><span class=cF5>DCScrnCapture</span><span class=cF0>(</span><span class=cF3>FALSE</span><span class=cF0>);
<a name="l236"></a> color=</span><span class=cF5>GrPeek</span><span class=cF0>(dc2,</span><span class=cFB>ms</span><span class=cF0>.pos.x,</span><span class=cFB>ms</span><span class=cF0>.pos.y)^15;</span><span class=cF2>//Mouse cursor is XORed.</span><span class=cF0>
<a name="l237"></a> </span><span class=cF5>DCDel</span><span class=cF0>(dc2);
<a name="l238"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l239"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'t'</span><span class=cF0>: </span><span class=cF2>//Set to transparent color</span><span class=cF0>
<a name="l240"></a> color=</span><span class=cF3>TRANSPARENT</span><span class=cF0>;
<a name="l241"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l242"></a> }
<a name="l243"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l244"></a>
<a name="l245"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>MSG_MS_R_DOWN</span><span class=cF0>:
<a name="l246"></a>bm_menu:
<a name="l247"></a> </span><span class=cF5>DCFill</span><span class=cF0>(dc);
<a name="l248"></a> </span><span class=cF5>StrCpy</span><span class=cF0>(</span><span class=cF5>Fs</span><span class=cF0>-&gt;task_title,</span><span class=cF6>&quot;Sprite BitMap Menu&quot;</span><span class=cF0>);
<a name="l249"></a> i=</span><span class=cF5>PopUpSpriteBitMap</span><span class=cF0>(color,width);
<a name="l250"></a> </span><span class=cF1>if</span><span class=cF0> (i&gt;=0)
<a name="l251"></a> </span><span class=cF5>StrCpy</span><span class=cF0>(</span><span class=cF5>Fs</span><span class=cF0>-&gt;task_title,</span><span class=cF5>DefineSub</span><span class=cF7>(</span><span class=cF0>i,</span><span class=cF6>&quot;ST_SPRITE_BITMAP_MENU&quot;</span><span class=cF7>)</span><span class=cF0>);
<a name="l252"></a> </span><span class=cF1>switch</span><span class=cF0> (i) {
<a name="l253"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCM_CANCEL</span><span class=cF0>:
<a name="l254"></a> res=</span><span class=cF3>SPE_ABORT</span><span class=cF0>;
<a name="l255"></a> </span><span class=cF1>goto</span><span class=cF0> bm_done;
<a name="l256"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_EXIT</span><span class=cF0>:
<a name="l257"></a> res=</span><span class=cF3>SPE_EXIT</span><span class=cF0>;
<a name="l258"></a> </span><span class=cF1>goto</span><span class=cF0> bm_done;
<a name="l259"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_MAIN_MENU</span><span class=cF0>:
<a name="l260"></a> res=</span><span class=cF3>SPE_CONT</span><span class=cF0>;
<a name="l261"></a> </span><span class=cF1>goto</span><span class=cF0> bm_done;
<a name="l262"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_COLOR</span><span class=cF0>:
<a name="l263"></a> i=</span><span class=cF5>PopUpColor</span><span class=cF0>(,,</span><span class=cF3>FALSE</span><span class=cF0>);
<a name="l264"></a> </span><span class=cF1>if</span><span class=cF0> (i&gt;=0) color=i;
<a name="l265"></a> </span><span class=cF1>goto</span><span class=cF0> bm_menu;
<a name="l266"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_FIND_AND_REPLACE</span><span class=cF0>:
<a name="l267"></a> i=</span><span class=cF5>PopUpColor</span><span class=cF0>(</span><span class=cF6>&quot;Find Color\n&quot;</span><span class=cF0>,,</span><span class=cF3>FALSE</span><span class=cF0>);
<a name="l268"></a> </span><span class=cF1>if</span><span class=cF0> (i&gt;=0) </span><span class=cF7>{</span><span class=cF0>
<a name="l269"></a> j=</span><span class=cF5>PopUpColor</span><span class=cF0>(</span><span class=cF6>&quot;Replace Color\n&quot;</span><span class=cF0>,,</span><span class=cF3>FALSE</span><span class=cF0>);
<a name="l270"></a> </span><span class=cF1>if</span><span class=cF0> (j&gt;=0) {
<a name="l271"></a> </span><span class=cF5>DCColorChg</span><span class=cF0>(img,i,j);
<a name="l272"></a> </span><span class=cF5>GrBitMapEdPrepPersistentDC</span><span class=cF0>(dc,xx1,yy1,img);
<a name="l273"></a> }
<a name="l274"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l275"></a> </span><span class=cF1>goto</span><span class=cF0> bm_menu;
<a name="l276"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_TRIM_TO_EXTENTS</span><span class=cF0>:
<a name="l277"></a> </span><span class=cF5>GrBitMapEdTrimToExtents</span><span class=cF0>(&amp;img,&amp;xx1,&amp;yy1,&amp;xx2,&amp;yy2,bkcolor);
<a name="l278"></a> </span><span class=cF5>GrBitMapEdPrepPersistentDC</span><span class=cF0>(dc,xx1,yy1,img);
<a name="l279"></a> </span><span class=cF1>goto</span><span class=cF0> bm_menu;
<a name="l280"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_ADD_OUTLINE</span><span class=cF0>:
<a name="l281"></a> i=</span><span class=cF5>PopUpRangeI64</span><span class=cF0>(1,16,1,</span><span class=cF6>&quot;Outline Width\n&quot;</span><span class=cF0>);
<a name="l282"></a> </span><span class=cF1>if</span><span class=cF0> (i&gt;=0) </span><span class=cF7>{</span><span class=cF0>
<a name="l283"></a> </span><span class=cF5>GrBitMapEdAddOutline</span><span class=cF0>(img,i,color,bkcolor);
<a name="l284"></a> </span><span class=cF5>GrBitMapEdPrepPersistentDC</span><span class=cF0>(dc,xx1,yy1,img);
<a name="l285"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l286"></a> </span><span class=cF1>goto</span><span class=cF0> bm_menu;
<a name="l287"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_ETCH</span><span class=cF0>:
<a name="l288"></a> i=</span><span class=cF5>PopUpRangeI64</span><span class=cF0>(1,16,1,</span><span class=cF6>&quot;Etch Width\n&quot;</span><span class=cF0>);
<a name="l289"></a> </span><span class=cF1>if</span><span class=cF0> (i&gt;=0) </span><span class=cF7>{</span><span class=cF0>
<a name="l290"></a> </span><span class=cF5>GrBitMapEdEtch</span><span class=cF0>(img,i,bkcolor);
<a name="l291"></a> </span><span class=cF5>GrBitMapEdPrepPersistentDC</span><span class=cF0>(dc,xx1,yy1,img);
<a name="l292"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l293"></a> </span><span class=cF1>goto</span><span class=cF0> bm_menu;
<a name="l294"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_SAVE_GR</span><span class=cF0>:
<a name="l295"></a> *filename.name=0;
<a name="l296"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>DocForm</span><span class=cF7>(</span><span class=cF0>&amp;filename</span><span class=cF7>)</span><span class=cF0> &amp;&amp; *filename.name)
<a name="l297"></a> </span><span class=cF5>GRWrite</span><span class=cF0>(filename.name,img,</span><span class=cF3>DCSF_COMPRESSED</span><span class=cF0>|</span><span class=cF3>DCSF_PALETTE_GET</span><span class=cF0>);
<a name="l298"></a> </span><span class=cF1>goto</span><span class=cF0> bm_menu;
<a name="l299"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_DITHER_COLOR</span><span class=cF0>:
<a name="l300"></a> i=</span><span class=cF5>PopUpColorDither</span><span class=cF0>;
<a name="l301"></a> </span><span class=cF1>if</span><span class=cF0> (i&gt;=0) color=i;
<a name="l302"></a> </span><span class=cF1>goto</span><span class=cF0> bm_menu;
<a name="l303"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_WIDTH</span><span class=cF0>:
<a name="l304"></a> i=</span><span class=cF5>PopUpRangeI64</span><span class=cF0>(1,16,1,</span><span class=cF6>&quot;Thick\n&quot;</span><span class=cF0>);
<a name="l305"></a> </span><span class=cF1>if</span><span class=cF0> (i&gt;=0) width=i;
<a name="l306"></a> </span><span class=cF1>goto</span><span class=cF0> bm_menu;
<a name="l307"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_UNDO</span><span class=cF0>:
<a name="l308"></a> </span><span class=cF1>if</span><span class=cF0> (undo) </span><span class=cF7>{</span><span class=cF0>
<a name="l309"></a> </span><span class=cF5>DCFill</span><span class=cF0>(img,bkcolor);
<a name="l310"></a> img-&gt;color=</span><span class=cF3>ROP_EQU</span><span class=cF0>;
<a name="l311"></a> </span><span class=cF5>GrBlot</span><span class=cF0>(img,0,0,undo);
<a name="l312"></a> </span><span class=cF5>DCDel</span><span class=cF0>(undo);
<a name="l313"></a> undo=</span><span class=cF3>NULL</span><span class=cF0>;
<a name="l314"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l315"></a> </span><span class=cF1>goto</span><span class=cF0> bm_menu;
<a name="l316"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_PT</span><span class=cF0>:
<a name="l317"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_LINE</span><span class=cF0>:
<a name="l318"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_ARROW</span><span class=cF0>:
<a name="l319"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_RECT</span><span class=cF0>:
<a name="l320"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_CIRCLE</span><span class=cF0>:
<a name="l321"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_FLOOD_FILL</span><span class=cF0>:
<a name="l322"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_FLOOD_FILL_NOT</span><span class=cF0>:
<a name="l323"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_POLYPT</span><span class=cF0>:
<a name="l324"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_POLYLINE</span><span class=cF0>:
<a name="l325"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_COPY</span><span class=cF0>:
<a name="l326"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_DELETE</span><span class=cF0>:
<a name="l327"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_PASTE</span><span class=cF0>:
<a name="l328"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_PASTE_TRANSPARENT</span><span class=cF0>:
<a name="l329"></a> mode=i;
<a name="l330"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l331"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_TEXT</span><span class=cF0>:
<a name="l332"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_TEXT_BOX</span><span class=cF0>:
<a name="l333"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_TEXT_DIAMOND</span><span class=cF0>:
<a name="l334"></a> </span><span class=cF5>Free</span><span class=cF0>(st);
<a name="l335"></a> st=</span><span class=cF5>PopUpGetStr</span><span class=cF0>(</span><span class=cF6>&quot;Enter text and press &lt;ESC&gt;.\n&quot;</span><span class=cF0>);
<a name="l336"></a> </span><span class=cF1>if</span><span class=cF0> (st &amp;&amp; *st)
<a name="l337"></a> mode=i;
<a name="l338"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l339"></a> </span><span class=cF1>goto</span><span class=cF0> bm_menu;
<a name="l340"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l341"></a> }
<a name="l342"></a> </span><span class=cF5>DCDel</span><span class=cF0>(undo);
<a name="l343"></a> undo=</span><span class=cF5>DCExt</span><span class=cF0>(img,0,0,img-&gt;width-1,img-&gt;height-1);
<a name="l344"></a> undo-&gt;bkcolor=bkcolor;
<a name="l345"></a> </span><span class=cF5>Refresh</span><span class=cF0>(2,</span><span class=cF3>TRUE</span><span class=cF0>); </span><span class=cF2>//Let popup close</span><span class=cF0>
<a name="l346"></a> </span><span class=cF5>GrBitMapEdPrepPersistentDC</span><span class=cF0>(dc,xx1,yy1,img);
<a name="l347"></a> down=</span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l348"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l349"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>MSG_MS_L_DOWN</span><span class=cF0>:
<a name="l350"></a> </span><span class=cF1>switch</span><span class=cF0> (mode) {
<a name="l351"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_PT</span><span class=cF0>:
<a name="l352"></a> img-&gt;color=color;
<a name="l353"></a> img-&gt;thick=width;
<a name="l354"></a> </span><span class=cF5>GrPlot3</span><span class=cF0>(img,arg1-xx1,arg2-yy1,0);
<a name="l355"></a> </span><span class=cF5>GrBitMapEdPrepPersistentDC</span><span class=cF0>(dc,xx1,yy1,img);
<a name="l356"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l357"></a> </span><span class=cF1>start</span><span class=cF0>:
<a name="l358"></a> </span><span class=cF1>if</span><span class=cF0> (down)
<a name="l359"></a> </span><span class=cF5>GrBitMapEdPrepPersistentDC</span><span class=cF0>(dc,xx1,yy1,img);
<a name="l360"></a> x1=arg1; y1=arg2;
<a name="l361"></a> down=</span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l362"></a> dc-&gt;color=color;
<a name="l363"></a> dc-&gt;thick=width;
<a name="l364"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_LINE</span><span class=cF0>:
<a name="l365"></a> </span><span class=cF5>GrLine3</span><span class=cF0>(dc,x1,y1,0,arg1,arg2,0);
<a name="l366"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l367"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_ARROW</span><span class=cF0>:
<a name="l368"></a> </span><span class=cF5>GrArrow3</span><span class=cF0>(dc,x1,y1,0,arg1,arg2,0);
<a name="l369"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l370"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_RECT</span><span class=cF0>:
<a name="l371"></a> </span><span class=cF5>GrRect</span><span class=cF0>(dc,x1,y1,1,1);
<a name="l372"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l373"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_CIRCLE</span><span class=cF0>:
<a name="l374"></a> </span><span class=cF5>GrCircle3</span><span class=cF0>(dc,x1,y1,0,1);
<a name="l375"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l376"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_COPY</span><span class=cF0>:
<a name="l377"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_DELETE</span><span class=cF0>:
<a name="l378"></a> dc-&gt;color=</span><span class=cF3>ROPF_DITHER</span><span class=cF0>+</span><span class=cF3>WHITE</span><span class=cF0>&lt;&lt;16+</span><span class=cF3>BLACK</span><span class=cF0>;
<a name="l379"></a> dc-&gt;thick=1;
<a name="l380"></a> </span><span class=cF5>GrBorder</span><span class=cF0>(dc,x1,y1,x1,y1);
<a name="l381"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l382"></a> </span><span class=cF1>end</span><span class=cF0>:
<a name="l383"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l384"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_PASTE</span><span class=cF0>:
<a name="l385"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_PASTE_TRANSPARENT</span><span class=cF0>:
<a name="l386"></a> </span><span class=cF1>if</span><span class=cF0> (clip) </span><span class=cF7>{</span><span class=cF0>
<a name="l387"></a> </span><span class=cF5>GrBitMapEdPrepPersistentDC</span><span class=cF0>(dc,xx1,yy1,img);
<a name="l388"></a> </span><span class=cF1>if</span><span class=cF0> (mode==</span><span class=cF3>SPBM_PASTE</span><span class=cF0>) {
<a name="l389"></a> clip-&gt;flags|=</span><span class=cF3>DCF_NO_TRANSPARENTS</span><span class=cF0>;
<a name="l390"></a> </span><span class=cF5>GrBlot</span><span class=cF0>(dc,arg1,arg2,clip);
<a name="l391"></a> clip-&gt;flags&amp;=~</span><span class=cF3>DCF_NO_TRANSPARENTS</span><span class=cF0>;
<a name="l392"></a> } </span><span class=cF1>else</span><span class=cF0> {
<a name="l393"></a> dc2=</span><span class=cF5>DCCopy</span><span class=cF0>(clip);
<a name="l394"></a> </span><span class=cF5>DCColorChg</span><span class=cF0>(dc2,bkcolor);
<a name="l395"></a> </span><span class=cF5>GrBlot</span><span class=cF0>(dc,arg1,arg2,dc2);
<a name="l396"></a> </span><span class=cF5>DCDel</span><span class=cF0>(dc2);
<a name="l397"></a> }
<a name="l398"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l399"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l400"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_TEXT</span><span class=cF0>:
<a name="l401"></a> </span><span class=cF5>GrBitMapEdPrepPersistentDC</span><span class=cF0>(dc,xx1,yy1,img);
<a name="l402"></a> dc-&gt;color=color;
<a name="l403"></a> </span><span class=cF5>GrPrint</span><span class=cF0>(dc,arg1,arg2,</span><span class=cF6>&quot;%s&quot;</span><span class=cF0>,st);
<a name="l404"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l405"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_TEXT_BOX</span><span class=cF0>:
<a name="l406"></a> </span><span class=cF5>GrBitMapEdPrepPersistentDC</span><span class=cF0>(dc,xx1,yy1,img);
<a name="l407"></a> dc-&gt;color=color;
<a name="l408"></a> </span><span class=cF5>GrTextBox3</span><span class=cF0>(dc,arg1,arg2,0,st);
<a name="l409"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l410"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_TEXT_DIAMOND</span><span class=cF0>:
<a name="l411"></a> </span><span class=cF5>GrBitMapEdPrepPersistentDC</span><span class=cF0>(dc,xx1,yy1,img);
<a name="l412"></a> dc-&gt;color=color;
<a name="l413"></a> </span><span class=cF5>GrTextDiamond3</span><span class=cF0>(dc,arg1,arg2,0,st);
<a name="l414"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l415"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_FLOOD_FILL</span><span class=cF0>:
<a name="l416"></a> img-&gt;color=color;
<a name="l417"></a> </span><span class=cF5>GrFloodFill</span><span class=cF0>(img,arg1-xx1,arg2-yy1);
<a name="l418"></a> </span><span class=cF5>GrBitMapEdPrepPersistentDC</span><span class=cF0>(dc,xx1,yy1,img);
<a name="l419"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l420"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_FLOOD_FILL_NOT</span><span class=cF0>:
<a name="l421"></a> img-&gt;color=color;
<a name="l422"></a> </span><span class=cF5>GrFloodFill</span><span class=cF0>(img,arg1-xx1,arg2-yy1,</span><span class=cF3>TRUE</span><span class=cF0>);
<a name="l423"></a> </span><span class=cF5>GrBitMapEdPrepPersistentDC</span><span class=cF0>(dc,xx1,yy1,img);
<a name="l424"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l425"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_POLYLINE</span><span class=cF0>:
<a name="l426"></a> </span><span class=cF1>if</span><span class=cF0> (!down) </span><span class=cF7>{</span><span class=cF0>
<a name="l427"></a> x1=arg1; y1=arg2;
<a name="l428"></a> down=</span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l429"></a> dc-&gt;color=color;
<a name="l430"></a> dc-&gt;thick=width;
<a name="l431"></a> </span><span class=cF5>GrLine3</span><span class=cF0>(dc,x1,y1,0,arg1,arg2,0);
<a name="l432"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l433"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l434"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_POLYPT</span><span class=cF0>:
<a name="l435"></a> x1=arg1; y1=arg2;
<a name="l436"></a> down=</span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l437"></a> img-&gt;color=color;
<a name="l438"></a> img-&gt;thick=width;
<a name="l439"></a> </span><span class=cF5>GrLine3</span><span class=cF0>(img,x1-xx1,y1-yy1,0,arg1-xx1,arg2-yy1,0);
<a name="l440"></a> </span><span class=cF5>GrBitMapEdPrepPersistentDC</span><span class=cF0>(dc,xx1,yy1,img);
<a name="l441"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l442"></a> }
<a name="l443"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l444"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>MSG_MS_MOVE</span><span class=cF0>:
<a name="l445"></a> </span><span class=cF1>switch</span><span class=cF0> (mode) {
<a name="l446"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_LINE</span><span class=cF0>:
<a name="l447"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_ARROW</span><span class=cF0>:
<a name="l448"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_POLYLINE</span><span class=cF0>:
<a name="l449"></a> </span><span class=cF1>if</span><span class=cF0> (down) </span><span class=cF7>{</span><span class=cF0>
<a name="l450"></a> </span><span class=cF5>GrBitMapEdPrepPersistentDC</span><span class=cF0>(dc,xx1,yy1,img);
<a name="l451"></a> dc-&gt;color=color;
<a name="l452"></a> dc-&gt;thick=width;
<a name="l453"></a> </span><span class=cF1>if</span><span class=cF0> (mode==</span><span class=cF3>SPBM_ARROW</span><span class=cF0>)
<a name="l454"></a> </span><span class=cF5>GrArrow3</span><span class=cF0>(dc,x1,y1,0,arg1,arg2,0);
<a name="l455"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l456"></a> </span><span class=cF5>GrLine3</span><span class=cF0>(dc,x1,y1,0,arg1,arg2,0);
<a name="l457"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l458"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l459"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_RECT</span><span class=cF0>:
<a name="l460"></a> </span><span class=cF1>if</span><span class=cF0> (down) </span><span class=cF7>{</span><span class=cF0>
<a name="l461"></a> </span><span class=cF5>GrBitMapEdPrepPersistentDC</span><span class=cF0>(dc,xx1,yy1,img);
<a name="l462"></a> </span><span class=cF1>if</span><span class=cF0> (x1&lt;arg1) {
<a name="l463"></a> x11=x1;
<a name="l464"></a> x22=arg1;
<a name="l465"></a> } </span><span class=cF1>else</span><span class=cF0> {
<a name="l466"></a> x11=arg1;
<a name="l467"></a> x22=x1;
<a name="l468"></a> }
<a name="l469"></a> </span><span class=cF1>if</span><span class=cF0> (y1&lt;arg2) {
<a name="l470"></a> y11=y1;
<a name="l471"></a> y22=arg2;
<a name="l472"></a> } </span><span class=cF1>else</span><span class=cF0> {
<a name="l473"></a> y11=arg2;
<a name="l474"></a> y22=y1;
<a name="l475"></a> }
<a name="l476"></a> dc-&gt;color=color;
<a name="l477"></a> </span><span class=cF5>GrRect</span><span class=cF0>(dc,x11,y11,x22-x11+1,y22-y11+1);
<a name="l478"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l479"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l480"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_COPY</span><span class=cF0>:
<a name="l481"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_DELETE</span><span class=cF0>:
<a name="l482"></a> </span><span class=cF1>if</span><span class=cF0> (down) </span><span class=cF7>{</span><span class=cF0>
<a name="l483"></a> </span><span class=cF5>GrBitMapEdPrepPersistentDC</span><span class=cF0>(dc,xx1,yy1,img);
<a name="l484"></a> </span><span class=cF1>if</span><span class=cF0> (x1&lt;arg1) {
<a name="l485"></a> x11=x1;
<a name="l486"></a> x22=arg1;
<a name="l487"></a> } </span><span class=cF1>else</span><span class=cF0> {
<a name="l488"></a> x11=arg1;
<a name="l489"></a> x22=x1;
<a name="l490"></a> }
<a name="l491"></a> </span><span class=cF1>if</span><span class=cF0> (y1&lt;arg2) {
<a name="l492"></a> y11=y1;
<a name="l493"></a> y22=arg2;
<a name="l494"></a> } </span><span class=cF1>else</span><span class=cF0> {
<a name="l495"></a> y11=arg2;
<a name="l496"></a> y22=y1;
<a name="l497"></a> }
<a name="l498"></a> dc-&gt;color=</span><span class=cF3>ROPF_DITHER</span><span class=cF0>+</span><span class=cF3>WHITE</span><span class=cF0>&lt;&lt;16+</span><span class=cF3>BLACK</span><span class=cF0>;
<a name="l499"></a> dc-&gt;thick=1;
<a name="l500"></a> </span><span class=cF5>GrBorder</span><span class=cF0>(dc,x11,y11,x22,y22);
<a name="l501"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l502"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l503"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_CIRCLE</span><span class=cF0>:
<a name="l504"></a> </span><span class=cF1>if</span><span class=cF0> (down) </span><span class=cF7>{</span><span class=cF0>
<a name="l505"></a> </span><span class=cF5>GrBitMapEdPrepPersistentDC</span><span class=cF0>(dc,xx1,yy1,img);
<a name="l506"></a> dc-&gt;color=color;
<a name="l507"></a> dc-&gt;thick=width;
<a name="l508"></a> </span><span class=cF5>GrCircle3</span><span class=cF0>(dc,x1,y1,0,</span><span class=cF5>Sqrt</span><span class=cF7>(</span><span class=cF5>SqrI64</span><span class=cF0>(arg1-x1)+</span><span class=cF5>SqrI64</span><span class=cF0>(arg2-y1)</span><span class=cF7>)</span><span class=cF0>);
<a name="l509"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l510"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l511"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_PASTE</span><span class=cF0>:
<a name="l512"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_PASTE_TRANSPARENT</span><span class=cF0>:
<a name="l513"></a> </span><span class=cF1>if</span><span class=cF0> (clip) </span><span class=cF7>{</span><span class=cF0>
<a name="l514"></a> </span><span class=cF5>GrBitMapEdPrepPersistentDC</span><span class=cF0>(dc,xx1,yy1,img);
<a name="l515"></a> </span><span class=cF1>if</span><span class=cF0> (mode==</span><span class=cF3>SPBM_PASTE</span><span class=cF0>) {
<a name="l516"></a> clip-&gt;flags|=</span><span class=cF3>DCF_NO_TRANSPARENTS</span><span class=cF0>;
<a name="l517"></a> </span><span class=cF5>GrBlot</span><span class=cF0>(dc,arg1,arg2,clip);
<a name="l518"></a> clip-&gt;flags&amp;=~</span><span class=cF3>DCF_NO_TRANSPARENTS</span><span class=cF0>;
<a name="l519"></a> } </span><span class=cF1>else</span><span class=cF0> {
<a name="l520"></a> dc2=</span><span class=cF5>DCCopy</span><span class=cF0>(clip);
<a name="l521"></a> </span><span class=cF5>DCColorChg</span><span class=cF0>(dc2,bkcolor);
<a name="l522"></a> </span><span class=cF5>GrBlot</span><span class=cF0>(dc,arg1,arg2,dc2);
<a name="l523"></a> </span><span class=cF5>DCDel</span><span class=cF0>(dc2);
<a name="l524"></a> }
<a name="l525"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l526"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l527"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_TEXT</span><span class=cF0>:
<a name="l528"></a> </span><span class=cF5>GrBitMapEdPrepPersistentDC</span><span class=cF0>(dc,xx1,yy1,img);
<a name="l529"></a> dc-&gt;color=color;
<a name="l530"></a> </span><span class=cF5>GrPrint</span><span class=cF0>(dc,arg1,arg2,</span><span class=cF6>&quot;%s&quot;</span><span class=cF0>,st);
<a name="l531"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l532"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_TEXT_BOX</span><span class=cF0>:
<a name="l533"></a> </span><span class=cF5>GrBitMapEdPrepPersistentDC</span><span class=cF0>(dc,xx1,yy1,img);
<a name="l534"></a> dc-&gt;color=color;
<a name="l535"></a> </span><span class=cF5>GrTextBox3</span><span class=cF0>(dc,arg1,arg2,0,st);
<a name="l536"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l537"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_TEXT_DIAMOND</span><span class=cF0>:
<a name="l538"></a> </span><span class=cF5>GrBitMapEdPrepPersistentDC</span><span class=cF0>(dc,xx1,yy1,img);
<a name="l539"></a> dc-&gt;color=color;
<a name="l540"></a> </span><span class=cF5>GrTextDiamond3</span><span class=cF0>(dc,arg1,arg2,0,st);
<a name="l541"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l542"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_POLYPT</span><span class=cF0>:
<a name="l543"></a> </span><span class=cF1>if</span><span class=cF0> (down) </span><span class=cF7>{</span><span class=cF0>
<a name="l544"></a> img-&gt;color=color;
<a name="l545"></a> img-&gt;thick=width;
<a name="l546"></a> </span><span class=cF5>GrLine3</span><span class=cF0>(img,x1-xx1,y1-yy1,0,arg1-xx1,arg2-yy1,0);
<a name="l547"></a> </span><span class=cF5>GrBitMapEdPrepPersistentDC</span><span class=cF0>(dc,xx1,yy1,img);
<a name="l548"></a> x1=arg1; y1=arg2;
<a name="l549"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l550"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l551"></a> }
<a name="l552"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l553"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>MSG_MS_L_UP</span><span class=cF0>:
<a name="l554"></a> </span><span class=cF1>switch</span><span class=cF0> (mode) {
<a name="l555"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_LINE</span><span class=cF0>:
<a name="l556"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_ARROW</span><span class=cF0>:
<a name="l557"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_POLYPT</span><span class=cF0>:
<a name="l558"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_POLYLINE</span><span class=cF0>:
<a name="l559"></a> img-&gt;color=color;
<a name="l560"></a> img-&gt;thick=width;
<a name="l561"></a> </span><span class=cF1>if</span><span class=cF0> (mode==</span><span class=cF3>SPBM_ARROW</span><span class=cF0>)
<a name="l562"></a> </span><span class=cF5>GrArrow3</span><span class=cF0>(img,x1-xx1,y1-yy1,0,arg1-xx1,arg2-yy1,0);
<a name="l563"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l564"></a> </span><span class=cF5>GrLine3</span><span class=cF0>(img,x1-xx1,y1-yy1,0,arg1-xx1,arg2-yy1,0);
<a name="l565"></a> </span><span class=cF5>GrBitMapEdPrepPersistentDC</span><span class=cF0>(dc,xx1,yy1,img);
<a name="l566"></a> </span><span class=cF1>if</span><span class=cF0> (mode==</span><span class=cF3>SPBM_POLYLINE</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l567"></a> x1=arg1; y1=arg2;
<a name="l568"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
<a name="l569"></a> down=</span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l570"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l571"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_RECT</span><span class=cF0>:
<a name="l572"></a> img-&gt;color=color;
<a name="l573"></a> </span><span class=cF1>if</span><span class=cF0> (x1&lt;arg1) </span><span class=cF7>{</span><span class=cF0>
<a name="l574"></a> x11=x1;
<a name="l575"></a> x22=arg1;
<a name="l576"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
<a name="l577"></a> x11=arg1;
<a name="l578"></a> x22=x1;
<a name="l579"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l580"></a> </span><span class=cF1>if</span><span class=cF0> (y1&lt;arg2) </span><span class=cF7>{</span><span class=cF0>
<a name="l581"></a> y11=y1;
<a name="l582"></a> y22=arg2;
<a name="l583"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
<a name="l584"></a> y11=arg2;
<a name="l585"></a> y22=y1;
<a name="l586"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l587"></a> </span><span class=cF5>GrRect</span><span class=cF0>(img,x11-xx1,y11-yy1,x22-x11+1,y22-y11+1);
<a name="l588"></a> down=</span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l589"></a> </span><span class=cF5>GrBitMapEdPrepPersistentDC</span><span class=cF0>(dc,xx1,yy1,img);
<a name="l590"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l591"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_COPY</span><span class=cF0>:
<a name="l592"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_DELETE</span><span class=cF0>:
<a name="l593"></a> </span><span class=cF1>if</span><span class=cF0> (x1&lt;arg1) </span><span class=cF7>{</span><span class=cF0>
<a name="l594"></a> x11=x1;
<a name="l595"></a> x22=arg1;
<a name="l596"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
<a name="l597"></a> x11=arg1;
<a name="l598"></a> x22=x1;
<a name="l599"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l600"></a> </span><span class=cF1>if</span><span class=cF0> (y1&lt;arg2) </span><span class=cF7>{</span><span class=cF0>
<a name="l601"></a> y11=y1;
<a name="l602"></a> y22=arg2;
<a name="l603"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
<a name="l604"></a> y11=arg2;
<a name="l605"></a> y22=y1;
<a name="l606"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l607"></a> </span><span class=cF5>DCDel</span><span class=cF0>(clip);
<a name="l608"></a> clip=</span><span class=cF5>DCExt</span><span class=cF0>(img,x11-xx1,y11-yy1,x22-xx1,y22-yy1);
<a name="l609"></a> clip-&gt;bkcolor=bkcolor;
<a name="l610"></a> </span><span class=cF1>if</span><span class=cF0> (mode==</span><span class=cF3>SPBM_DELETE</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l611"></a> img-&gt;color=bkcolor;
<a name="l612"></a> </span><span class=cF5>GrRect</span><span class=cF0>(img,x11-xx1,y11-yy1,x22-x11+1,y22-y11+1);
<a name="l613"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l614"></a> </span><span class=cF1>goto</span><span class=cF0> bm_menu;
<a name="l615"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_CIRCLE</span><span class=cF0>:
<a name="l616"></a> img-&gt;color=color;
<a name="l617"></a> img-&gt;thick=width;
<a name="l618"></a> </span><span class=cF5>GrCircle3</span><span class=cF0>(img,x1-xx1,y1-yy1,0,
<a name="l619"></a> </span><span class=cF5>Sqrt</span><span class=cF7>(</span><span class=cF5>SqrI64</span><span class=cF0>(arg1-x1)+</span><span class=cF5>SqrI64</span><span class=cF0>(arg2-y1)</span><span class=cF7>)</span><span class=cF0>);
<a name="l620"></a> down=</span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l621"></a> </span><span class=cF5>GrBitMapEdPrepPersistentDC</span><span class=cF0>(dc,xx1,yy1,img);
<a name="l622"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l623"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_PASTE</span><span class=cF0>:
<a name="l624"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_PASTE_TRANSPARENT</span><span class=cF0>:
<a name="l625"></a> </span><span class=cF1>if</span><span class=cF0> (clip) </span><span class=cF7>{</span><span class=cF0>
<a name="l626"></a> </span><span class=cF5>GrBitMapEdPrepPersistentDC</span><span class=cF0>(dc,xx1,yy1,img);
<a name="l627"></a> </span><span class=cF1>if</span><span class=cF0> (mode==</span><span class=cF3>SPBM_PASTE</span><span class=cF0>) {
<a name="l628"></a> clip-&gt;flags|=</span><span class=cF3>DCF_NO_TRANSPARENTS</span><span class=cF0>;
<a name="l629"></a> </span><span class=cF5>GrBlot</span><span class=cF0>(img,arg1-xx1,arg2-yy1,clip);
<a name="l630"></a> clip-&gt;flags&amp;=~</span><span class=cF3>DCF_NO_TRANSPARENTS</span><span class=cF0>;
<a name="l631"></a> } </span><span class=cF1>else</span><span class=cF0> {
<a name="l632"></a> dc2=</span><span class=cF5>DCCopy</span><span class=cF0>(clip);
<a name="l633"></a> </span><span class=cF5>DCColorChg</span><span class=cF0>(dc2,bkcolor);
<a name="l634"></a> </span><span class=cF5>GrBlot</span><span class=cF0>(img,arg1-xx1,arg2-yy1,dc2);
<a name="l635"></a> </span><span class=cF5>DCDel</span><span class=cF0>(dc2);
<a name="l636"></a> }
<a name="l637"></a> </span><span class=cF5>GrBitMapEdPrepPersistentDC</span><span class=cF0>(dc,xx1,yy1,img);
<a name="l638"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l639"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l640"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_TEXT</span><span class=cF0>:
<a name="l641"></a> img-&gt;color=color;
<a name="l642"></a> </span><span class=cF5>GrPrint</span><span class=cF0>(img,arg1-xx1,arg2-yy1,</span><span class=cF6>&quot;%s&quot;</span><span class=cF0>,st);
<a name="l643"></a> </span><span class=cF1>goto</span><span class=cF0> bm_menu;
<a name="l644"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_TEXT_BOX</span><span class=cF0>:
<a name="l645"></a> img-&gt;color=color;
<a name="l646"></a> </span><span class=cF5>GrTextBox3</span><span class=cF0>(img,arg1-xx1,arg2-yy1,0,st);
<a name="l647"></a> </span><span class=cF1>goto</span><span class=cF0> bm_menu;
<a name="l648"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPBM_TEXT_DIAMOND</span><span class=cF0>:
<a name="l649"></a> img-&gt;color=color;
<a name="l650"></a> </span><span class=cF5>GrTextDiamond3</span><span class=cF0>(img,arg1-xx1,arg2-yy1,0,st);
<a name="l651"></a> </span><span class=cF1>goto</span><span class=cF0> bm_menu;
<a name="l652"></a> }
<a name="l653"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l654"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l655"></a> }
<a name="l656"></a> </span><span class=cF5>Refresh</span><span class=cF0>;
<a name="l657"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l658"></a>bm_key_up_done:
<a name="l659"></a> </span><span class=cF5>GetMsg</span><span class=cF0>(,,1&lt;&lt;</span><span class=cF3>MSG_KEY_UP</span><span class=cF0>);
<a name="l660"></a>bm_done:
<a name="l661"></a> </span><span class=cF5>DCDel</span><span class=cF0>(clip);
<a name="l662"></a> </span><span class=cF5>DCDel</span><span class=cF0>(undo);
<a name="l663"></a> </span><span class=cF5>Free</span><span class=cF0>(st);
<a name="l664"></a> </span><span class=cF5>DCFill</span><span class=cF0>(dc);
<a name="l665"></a> </span><span class=cF5>SettingsPop</span><span class=cF0>;
<a name="l666"></a> doc_e-&gt;de_flags=old_de_flags;
<a name="l667"></a> *_img=img;
<a name="l668"></a> *_xx1=xx1,*_yy1=yy1,*_xx2=xx2,*_yy2=yy2;
<a name="l669"></a> </span><span class=cF1>return</span><span class=cF0> res;
<a name="l670"></a>}
</span></pre></body>
</html>