rem "base de travail pour faire un mémo enrichi et être repris" error_french dim x%,y% ,couleurfond%,couleurfonte%,lettre% ,suite% ,couleur% dim fond$,stylo$,a$ ,mot$,b$,depart% , a% ,imX%,imY%,fin_imX%,fin_imY% dim incruste_image% , image$ ,image% ,b%,c% ,a1%,a2%,a3%,a4% ,b
label controle,ecrit,fond,control1,control2,couleurfond,couleurstylo ,relire,lignesuivante label chope
width 0,screen_x:height 0,800 ' ------------------------------------------------------------------------------ edit 1:left 1,800:width 1,400 :color 1,255,255,200 picture 2:left 2,0:top 2,50:width 2,790:height 2,700 :font_size 2,12:on_click 2,controle :font_bold 2 font_name 2,"Bitstream Vera Sans Mono" ' ---------------------- memo 4:left 4,800:top 4,50:width 4,450:height 4,400:font_size 4,10 open_dialog 5 save_dialog 6
memo 7 :top 7,450:left 7,810:font_size 7,12:width 7,700 ' ---------------------- button 8 :left 8,600:caption 8,"ligne suivante":on_click 8,lignesuivante button 9 :left 9,700:caption 9 ,"suite" :on_click 9,control1 button 10:left 10,10:caption 10,"relire":width 10,90:on_click 10,relire button 20:left 20,110:caption 20,"inclure image":width 20,90 :on_click 20,chope
list 11:left 11,800:top 11,590:hint 11,"couleur de fond du texte" :on_click 11,couleurfond item_add 11,"blanc":item_add 11,"rouge":item_add 11,"vert":item_add 11,"bleu":item_add 11,"jaune":item_add 11,"noir" hint 11,"couleur du fond list 12:left 12,950:top 12,590:hint 12,"couleur du texte" :on_click 12,couleurstylo item_add 12,"blanc":item_add 12,"rouge":item_add 12,"vert":item_add 12,"bleu":item_add 12,"jaune":item_add 12,"noir" hint 12,"couleur du texte
list 15:left 15,1100:top 15,590:height 15,50:color 15,230,230,220 incruste_image%=30 fond$ ="01" stylo$="00" end ' ------------------------ relire: 2d_clear wait 100 goto ecrit ' ------------------------ controle: x%=mouse_x_left_down( 2 ) y%=mouse_y_left_down( 2 ) depart%=x% goto control2 control1: x%=suite% control2: if text$(1)<>"" fond$ =right$("00"+str$(couleurfond%) ,2) stylo$=right$("00"+str$(couleurfonte%),2)
item_add 4, right$("0000"+str$(x%),4) + "," + right$("0000"+str$(y%),4)+","+fond$+","+stylo$ item_add 4,text$(1) end_if gosub ecrit return ' -----------------------
' --------------- fond: rem "couleur du support du texte 2d_target_is 2 :print_target_is 2 if numeric(fond$)=1 couleur%=val(fond$) :if couleur%=0 then couleur%=1 select couleur% case 1:2d_fill_color 255,255,255 :' blanc case 2:2d_fill_color 255,0,0 :' rouge case 3:2d_fill_color 0,255,0 :' vert case 4:2d_fill_color 0,0,255 :' bleu case 5:2d_fill_color 255,255,0 :' jaune case 6:2d_fill_color 0,0,0 :' noir end_select end_if
if numeric(stylo$)=1 couleur%=val(stylo$) :if couleur%=0 then couleur%=6 select couleur% case 1:font_color 2,255,255,255 :' blanc case 2:font_color 2,255,0,0 :' rouge case 3:font_color 2,0,255,0 :' vert case 4:font_color 2,0,0,255 :' bleu case 5:font_color 2,255,255,0 :' jaune case 6:font_color 2,0,0,0 :' noir end_select print_locate x%,y% print b$ suite%=lettre%*10+x% :' pour ecrire le texte à la suite sur la même ligne end_if return ' -------------- couleurfond: couleurfond%=item_index(11) return ' -------------- couleurstylo: couleurfonte%=item_index(12) return ' -------------- lignesuivante: y%=y%+22 x%=depart% goto control2 return ' --------------------------------------------- ecrit: if count(4)>0 for a%=1 to count(4) step 2 a$=item_read$(4,a%) b$=item_read$(4,a%+1) if numeric(left$(a$,4))=1 then x%=val(left$(a$,4)) if numeric(mid$(a$,6,4))=1 then y%=val(mid$(a$,6,4)) fond$=mid$(a$,11,2) stylo$=mid$(a$,14,2) mot$=item_read$(4,a%) lettre%=len(b$) gosub fond next a% end_if ' 00,xxxx,yyyy,XXXX,YYYY ' 4 9 14 19 if count(15)>0 for a%=1 to count(15) step 2 image$=item_read$(15,a%) a$=item_read$(15,a%+1) image%=val( left$(a$,2)) imX%=val( mid$(a$,4,4)) imY%=val( mid$(a$,9,4)) fin_imX%=val(mid$(a$,14,4)) fin_imY%=val(mid$(a$,19,4)) 2d_pen_color 255,0,0:2d_fill_color 228,237,232:2d_pen_width 1 if image$<>"_" then stretch_on image%:file_load image%,image$ next a% end_if return
' ============================================================================== rem =============" image "====================================================== ' ============================================================================== chope: wait 600 filter 5,"choisir l'image|*.jpg;*.bmp" image$=file_name$(5) item_add 15,image$ if image$<>"_" print_target_is 7 filebin_open_read 1,image$ filebin_position 1,19 : filebin_read 1,b% filebin_position 1,23 : filebin_read 1,c% filebin_close 1 end_if b=b%/c% repeat if key_down_code=3 and key_down_special = 3 then exit_repeat until mouse_left_down(2)=1 imX%= mouse_x_left_down(2) : imY%= mouse_y_left_down(2) 2d_target_is 2 2d_pen_color 255,0,0:2d_fill_color 228,237,232:2d_pen_width 1 2d_line imX%-10,imY%,imX%+20,imY% 2d_line imX%,imY%-10,imX%,imY%+20 repeat if key_down_code=3 and key_down_special = 3 then exit_repeat a1%=mouse_x_position(2) a2%=(a1%-imX%): a3%=a2%/b :' b pas valable il faudra voir sur 2 octets
fin_imY%=imY%+a3% fin_imX%=a1% 2d_rectangle imX%,imY%,a1%,fin_imY% until mouse_left_up(2)=1
incruste_image%=incruste_image%+1 print "incruste_image%=",incruste_image%
item_add 15,right$("00"+str$(incruste_image%),2)+","+right$("0000"+str$(imX%),4)+","+ right$("0000"+str$(imY%),4)+","+right$("0000"+str$(fin_imX%),4)+","+right$("0000"+str$(fin_imY%),4) picture incruste_image%:left incruste_image%,imX%:top incruste_image%,imY%
width incruste_image%,fin_imX%-imX% : height incruste_image%,fin_imY%-imY% file_load incruste_image%,image$
return
|