Forum Liberty Basic France

Le 22/02/2018 à 00h00

Administrateur

Groupe: Administrateur

Inscrit le: 04/03/2012
Messages: 1992
Code VB :
 
         NOMAINWIN
    WindowWidth=600: WindowHeight=400
    UpperLeftX=100: UpperLeftY=20
    BUTTON #w.ra, "R+10", [r10], UL, 10, 20, 50, 20
    BUTTON #w.ga, "G+10", [g10], UL, 70, 20, 50, 20
    BUTTON #w.ba, "B+10", [b10], UL, 130, 20, 50, 20
    BUTTON #w.rb, "R+5", [r5], UL, 10, 45, 50, 20
    BUTTON #w.gb, "G+5", [g5], UL, 70, 45, 50, 20
    BUTTON #w.bb, "B+5", [b5], UL, 130, 45, 50, 20
    BUTTON #w.rc, "R+1", [r1], UL, 10, 70, 50, 20
    BUTTON #w.gc, "G+1", [g1], UL, 70, 70, 50, 20
    BUTTON #w.bc, "B+1", [b1], UL, 130, 70, 50, 20
    TEXTBOX #w.r, 10, 105, 50, 25
    TEXTBOX #w.g, 70, 105, 50, 25
    TEXTBOX #w.b, 130, 105, 50, 25
    BUTTON #w.rra, "R-10", [rr10], UL, 10, 140, 50, 20
    BUTTON #w.gga, "G-10", [gg10], UL, 70, 140, 50, 20
    BUTTON #w.bba, "B-10", [bb10], UL, 130, 140, 50, 20
    BUTTON #w.rrb, "R-5", [rr5], UL, 10, 165, 50, 20
    BUTTON #w.ggb, "G-5", [gg5], UL, 70, 165, 50, 20
    BUTTON #w.bbb, "B-5", [bb5], UL, 130, 165, 50, 20
    BUTTON #w.rrc, "R-1", [rr1], UL, 10, 190, 50, 20
    BUTTON #w.ggc, "G-1", [gg1], UL, 70, 190, 50, 20
    BUTTON #w.bbc, "B-1", [bb1], UL, 130, 190, 50, 20
    TEXTEDITOR #w.txt, 250, 230, 150, 40
    Graphicbox #w.gr, 5, 5, 585, 360
    open "Colors R G B" FOR WINDOW AS #w
    print #w, "trapclose [quit]"
    #w.txt, "!font courrier 12 bold"
    r$="000":g$="000":b$="000": #w.r,r$: #w.g,g$: #w.b,b$
    col$=r$+" "+g$+" "+b$
    #w.gr, "down":#w.gr, "fill ";col$ 
  wait
  [ouv]
    r$=str$(r): g$=str$(g): b$=str$(b)
    col$=r$+" "+g$+" "+b$
    #w.gr, "down":#w.gr, "fill ";col$
    #w.r, r$: #w.g, g$: #w.b, b$ 
        #w.gr, "place 10 240": #w.gr, "\ Edit / Copy --> Paste to code --> "
    #w.txt, "!cls": #w.txt, chr$(34);r$;" ";g$;" ";b$;chr$(34)
    #w.gr, "flush;discard"
  wait
  [r1]
    r=r+1: gosub [verp]: goto [ouv]
  [g1]
    g=g+1: gosub [verp]: goto [ouv]
  [b1]
    b=b+1: gosub [verp]: goto [ouv]
  [r5]
    r=r+5: gosub [verp]: goto [ouv]
  [g5]
    g=g+5: gosub [verp]: goto [ouv]
  [b5]
    b=b+5: gosub [verp]: goto [ouv]
  [r10]
    r=r+10: gosub [verp]: goto [ouv]
  [g10]
    g=g+10: gosub [verp]: goto [ouv]
  [b10]
    b=b+10: gosub [verp]: goto [ouv]
    '---------------
  [rr1]
    r=r-1: gosub [verm]: goto [ouv]
  [gg1]
    g=g-1: gosub [verm]: goto [ouv]
  [bb1]
    b=b-1: gosub [verm]: goto [ouv]
  [rr5]
    r=r-5: gosub [verm]: goto [ouv]
  [gg5]
    g=g-5: gosub [verm]: goto [ouv]
  [bb5]
    b=b-5: gosub [verm]: goto [ouv]
  [rr10]
    r=r-10: gosub [verm]: goto [ouv]
  [gg10]
    g=g-10
    gosub [verm]: goto [ouv]
  [bb10]
    b=b-10: gosub [verm]: goto [ouv]
  [verp]
    if r > 255 then r=(255)
    if g > 255 then g=(255)
    if b > 255 then b=(255)
  return
  [verm]
    If r<0 then r=0
    If g<0 then g=0
    If b<0 then b=0
  return
  [quit]
    CLOSE #w
    END
 
 
____________________
Roro

   
Subs et Snippets » Choisir une couleur En: "R G B"  

 |  |

1 Utilisateur en ligne : 0 Administrateur, 0 Modérateur, 0 Membre et 1 Visiteur
Utilisateur en ligne : Aucun membre connecté
Répondre
Vous n'êtes pas autorisé à écrire dans cette catégorie