Klaus
Nombre de messages : 12331 Age : 75 Localisation : Ile de France Date d'inscription : 29/12/2009
| Sujet: Re: 2.32 du 6 mai 2013: changement dans ResizePicture Mar 7 Mai 2013 - 1:11 | |
| Et voici une nouvelle version de mon programme effets.bas avec un cadre destiné au redimensionnement d'une image à l'aide de ResizePicture. On peut adapter séparément largeur et hauteur en pourcentage (défaut: 100 %). Attention à l'agrandissement, si vous agrandissez une photo qui est déjà "grande", la mémoire vive peut ne pas suffire. La taille actuelle de l'image est affichée en permanence dans ce cadre. - Code:
-
' effets.bas
label labels : gosub labels gosub constantes gosub variables gosub form0 gosub menu gosub GUI gosub initialisations end
labels: label constantes, variables, menu, form0 label GUI, initialisations label ouvrir, sauver, sortir, purger, couper label gradient, change_debut, change_fin label gammas, brillance, gris, filtrer, change_filtre label outil1, outil2, click_picture label remp_debut, remp_fin, remplacer, pipette_debut, pipette_fin label miroir, coin_HG, coin_HD, coin_BG, coin_BD, torturer : ' , goutte label redimensionner, change_dimension return
constantes: dim KGF$ : KGF$ = "C:\DOCUME~1\Klaus\MESDOC~1\MESPRO~3\KGF\KGF.dll" dim M1% : M1% = 0 - 1 dim M20% : M20% = 0-20 dim grad_type$ : grad_type$ = "LCPRB" dim tit_outil1$ : tit_outil1$ = "Générateur de bulles d'information" dim tit_outil2$ : tit_outil2$ = "Incruster des vignettes dans une image" dim nom_outil1$ : nom_outil1$ = "C:\DOCUME~1\Klaus\MESDOC~1\MESPRO~2\INFOBU~1\INFOBU~1.EXE" dim nom_outil2$ : nom_outil2$ = "C:\DOCUME~1\Klaus\MESDOC~1\MESPRO~2\INFOBU~1\INCRUS~1.EXE"
return
variables: dim i%, w%,h%, R%, G%, B%, n%, f1$, f2$, s$ dim sta$, adresse$, c0$, c1$, present% dim no%, no1%, no2% dim no_open%, no_save%, no_image%, no_menu_effets% dim no_grad_x%, no_grad_y%, no_grad_type%, no_cont_grad% dim no_grad_debut%, no_grad_debut_R%, no_grad_debut_G%, no_grad_debut_B% dim no_grad_fin%, no_grad_fin_R%, no_grad_fin_G%, no_grad_fin_B% dim no_cont_gamma%, no_gamma%, no_gamma_wait%, no_cont_clip% dim no_clip_x0%, no_clip_y0%, no_clip_x1%, no_clip_y1%, x0%, x1%, y0%, y1% dim no_cont_bright%, no_bright%, no_bright_wait% dim no_cont_gris%, no_gris_wait% dim no_cont_filter%, no_filter_wait%, no_filter_r%, no_filter_g%, no_filter_b% dim no_filter%, no_filtre_r%, no_filtre_g%, no_filtre_b% dim no_remp_debut%, no_remp_fin%, no_miroir_wait%, no_torture_wait% dim no_remp_debut_R%, no_remp_debut_G%, no_remp_debut_B%, no_cont_miroir% dim no_remp_fin_R%, no_remp_fin_G%, no_remp_fin_B%, no_remp_wait%, no_miroir% dim no_cont_rempl%, pipette%, no_cont_torture%, no_HG%, no_HD%, no_BG%, no_BD% dim no_rempl_click%, no_torture_click%, no_cont_resize%, no_resize_wait% dim no_resize_w%, no_resize_h%, no_resize_largeur%, no_resize_hauteur% dim image_w%, image_h%, fact_w, fact_h, coin%, sa$, sb$, sc$, sd$ return
form0: full_space 0 on_close 0,purger return
GUI: no% = no% + 1 : open_dialog no% : no_open% = no% filter no%,"Images|*.bmp;*.jpg" no% = no% + 1 : save_dialog no% : no_save% = no% filter no%,"Images|*.bmp"
no% = no% + 1 : picture no% : no_image% = no% top no%,10 : left no%,10 : stretch_on no% width no%,800 : height no%,460 on_click no%,click_picture
no% = no% + 1 : container no% : no1% = no% : no_cont_grad% = no% width no%,400 : height no%,290 : inactive no% caption no%,"Dégradé de couleurs" top no%,10 : left no%,width(no_image%)+20 width no%,300 no% = no% + 1 : alpha no% : parent no%,no1% top no%,20 : left no%,20 : caption no%,"Point de référence X:" no% = no% + 1 : edit no% : parent no%,no1% : no_grad_x% = no% top no%,20 : left no%,130 : width no%,40 no% = no% + 1 : alpha no% : parent no%,no1% top no%,20 : left no%,190 : caption no%,"Y:" no% = no% + 1 : edit no% : parent no%,no1% : no_grad_y% = no% top no%,20 : left no%,210 : width no%,40 no% = no% + 1 : alpha no% : parent no%,no1% top no%,50 : left no%,20 : caption no%,"Type de dégradé" no% = no% + 1 : combo no% : parent no%,no1% : no_grad_type% = no% top no%,50 : left no%,130 : width no%,120 item_add no%,"par lignes" item_add no%,"par colonnes" item_add no%,"en rectangle" item_add no%,"en cercle" item_add no%,"en bulles" no% = no% + 1 : alpha no% : parent no%,no1% top no%,80 : left no%,20 : caption no%,"Couleur de début" no% = no% + 1 : picture no% : parent no%,no1% top no%,100 : left no%,10 : width no%,130 : height no%,150 no_grad_debut% = no% color no%,255,0,0 no% = no% + 1 : scroll_bar no% : parent no%,no1% : vertical no% top no%,110 : left no%,30 : min no%,0 : max no%,255 no_grad_debut_r% = no% position no%,255 : on_change no%,change_debut no% = no% + 1 : scroll_bar no% : parent no%,no1% : vertical no% top no%,110 : left no%,60 : min no%,0 : max no%,255 no_grad_debut_g% = no% position no%,0 : on_change no%,change_debut no% = no% + 1 : scroll_bar no% : parent no%,no1% : vertical no% top no%,110 : left no%,90 : min no%,0 : max no%,255 no_grad_debut_b% = no% position no%,0 : on_change no%,change_debut no% = no% + 1 : alpha no% : parent no%,no1% top no%,80 : left no%,170 : caption no%,"Couleur de fin" no% = no% + 1 : picture no% : parent no%,no1% top no%,100 : left no%,160 : width no%,130 : height no%,150 no_grad_fin% = no% color no%,255,0,0 no% = no% + 1 : scroll_bar no% : parent no%,no1% : vertical no% top no%,110 : left no%,180 : min no%,0 : max no%,255 no_grad_fin_r% = no% position no%,255 : on_change no%,change_fin no% = no% + 1 : scroll_bar no% : parent no%,no1% : vertical no% top no%,110 : left no%,210 : min no%,0 : max no%,255 no_grad_fin_g% = no% position no%,0 : on_change no%,change_fin no% = no% + 1 : scroll_bar no% : parent no%,no1% : vertical no% top no%,110 : left no%,240 : min no%,0 : max no%,255 no_grad_fin_b% = no% position no%,0 : on_change no%,change_fin no% = no% + 1 : button no% : parent no%,no1% top no%,260 : left no%,10 : caption no%,"Appliquer" on_click no%,gradient
no% = no% + 1 : container no% : no1% = no% : no_cont_gamma% = no% width no%,400 : height no%,70 : inactive no% caption no%,"Gamma" top no%,300 : left no%,width(no_image%)+20 width no%,300 no% = no% + 1 : check no% : parent no%,no1% : no_gamma% = no% width no%,200 : top no%,20 : left no%,10 caption no%,"Augmenter le Gamma (plus clair)" no% = no% + 1 : button no% : parent no%,no1% top no%,40 : left no%,10 : caption no%,"Appliquer" on_click no%,gammas no% = no% + 1 : alpha no% : parent no%,no1% : no_gamma_wait% = no% : hide no% top no%,40 : left no%,200 : caption no%,"Attendre svp..."
no% = no% + 1 : container no% : no1% = no% : no_cont_bright% = no% width no%,400 : height no%,70 : inactive no% caption no%,"Brillance" top no%,370 : left no%,width(no_image%)+20 width no%,300 no% = no% + 1 : check no% : parent no%,no1% : no_bright% = no% width no%,200 : top no%,20 : left no%,10 caption no%,"Augmenter la brillance" no% = no% + 1 : button no% : parent no%,no1% top no%,40 : left no%,10 : caption no%,"Appliquer" on_click no%,brillance no% = no% + 1 : alpha no% : parent no%,no1% : no_bright_wait% = no% : hide no% top no%,40 : left no%,200 : caption no%,"Attendre svp..."
no% = no% + 1 : container no% : no1% = no% : no_cont_gris% = no% width no%,400 : height no%,60 : inactive no% caption no%,"Niveaux de gris" top no%,440 : left no%,width(no_image%)+20 width no%,300 no% = no% + 1 : button no% : parent no%,no1% top no%,20 : left no%,10 : caption no%,"Appliquer" on_click no%,gris no% = no% + 1 : alpha no% : parent no%,no1% : no_gris_wait% = no% : hide no% top no%,20 : left no%,200 : caption no%,"Attendre svp..."
no% = no% + 1 : container no% : no1% = no% : no_cont_filter% = no% width no%,400 : height no%,220 : inactive no% caption no%,"Filtre par couleur" top no%,500 : left no%,width(no_image%)+20 width no%,300 no% = no% + 1 : picture no% : parent no%,no1% top no%,20 : left no%,10 : width no%,130 : height no%,160 no_filter% = no% color no%,255,0,0 no% = no% + 1 : check no% : parent no%,no1% : no_filter_r% = no% top no%,30 : left no%,25 : caption no%,"R" : width no%,25 no% = no% + 1 : check no% : parent no%,no1% : no_filter_g% = no% top no%,30 : left no%,55 : caption no%,"G" : width no%,25 no% = no% + 1 : check no% : parent no%,no1% : no_filter_b% = no% top no%,30 : left no%,85 : caption no%,"B" : width no%,25 no% = no% + 1 : scroll_bar no% : parent no%,no1% : vertical no% top no%,50 : left no%,30 : min no%,0 : max no%,255 no_filtre_r% = no% position no%,255 : on_change no%,change_filtre no% = no% + 1 : scroll_bar no% : parent no%,no1% : vertical no% top no%,50 : left no%,60 : min no%,0 : max no%,255 no_filtre_g% = no% position no%,0 : on_change no%,change_filtre no% = no% + 1 : scroll_bar no% : parent no%,no1% : vertical no% top no%,50 : left no%,90 : min no%,0 : max no%,255 no_filtre_b% = no% position no%,0 : on_change no%,change_filtre no% = no% + 1 : button no% : parent no%,no1% top no%,190 : left no%,10 : caption no%,"Appliquer" on_click no%,filtrer no% = no% + 1 : alpha no% : parent no%,no1% : no_filter_wait% = no% : hide no% top no%,190 : left no%,200 : caption no%,"Attendre svp..."
no% = no% + 1 : container no% : no1% = no% : no_cont_clip% = no% width no%,120 : height no%,200 : inactive no% caption no%,"Extraire rectangle" top no%,10 : left no%,left(no_cont_grad%)+width(no_cont_grad%)+10 no% = no% + 1 : alpha no% : parent no%,no_cont_clip% top no%,20 : left no%,10 : caption no%,"X0:" no% = no% + 1 : edit no% : parent no%,no_cont_clip% : no_clip_x0% = no% top no%,20 : left no%,40 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_cont_clip% top no%,50 : left no%,10 : caption no%,"Y0:" no% = no% + 1 : edit no% : parent no%,no_cont_clip% : no_clip_y0% = no% top no%,50 : left no%,40 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_cont_clip% top no%,90 : left no%,10 : caption no%,"X1:" no% = no% + 1 : edit no% : parent no%,no_cont_clip% : no_clip_x1% = no% top no%,90 : left no%,40 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_cont_clip% top no%,120 : left no%,10 : caption no%,"Y1:" no% = no% + 1 : edit no% : parent no%,no_cont_clip% : no_clip_y1% = no% top no%,120 : left no%,40 : width no%,50 no% = no% + 1 : button no% : parent no%,no_cont_clip% top no%,160 : left no%,10 : caption no%,"Couper" on_click no%,couper
no% = no% + 1 : container no% : no1% = no% : no_cont_rempl% = no% width no%,310 : height no%,260 : inactive no% caption no%,"Remplacer une couleur" top no%,top(no_image%)+height(no_image%)+10 : left no%,10 no% = no% + 1 : alpha no% : parent no%,no1% top no%,20 : left no%,20 : caption no%,"Couleur à remplacer" no% = no% + 1 : picture no% : parent no%,no1% top no%,40 : left no%,10 : width no%,130 : height no%,150 no_remp_debut% = no% color no%,255,0,0 no% = no% + 1 : scroll_bar no% : parent no%,no1% : vertical no% top no%,50 : left no%,30 : min no%,0 : max no%,255 no_remp_debut_r% = no% position no%,255 : on_change no%,remp_debut no% = no% + 1 : scroll_bar no% : parent no%,no1% : vertical no% top no%,50 : left no%,60 : min no%,0 : max no%,255 no_remp_debut_g% = no% position no%,0 : on_change no%,remp_debut no% = no% + 1 : scroll_bar no% : parent no%,no1% : vertical no% top no%,50 : left no%,90 : min no%,0 : max no%,255 no_remp_debut_b% = no% position no%,0 : on_change no%,remp_debut no% = no% + 1 : alpha no% : parent no%,no1% top no%,20 : left no%,170 : caption no%,"Nouvelle couleur" no% = no% + 1 : picture no% : parent no%,no1% top no%,40 : left no%,160 : width no%,130 : height no%,150 no_remp_fin% = no% color no%,255,0,0 no% = no% + 1 : scroll_bar no% : parent no%,no1% : vertical no% top no%,50 : left no%,180 : min no%,0 : max no%,255 no_remp_fin_r% = no% position no%,255 : on_change no%,remp_fin no% = no% + 1 : scroll_bar no% : parent no%,no1% : vertical no% top no%,50 : left no%,210 : min no%,0 : max no%,255 no_remp_fin_g% = no% position no%,0 : on_change no%,remp_fin no% = no% + 1 : scroll_bar no% : parent no%,no1% : vertical no% top no%,50 : left no%,240 : min no%,0 : max no%,255 no_remp_fin_b% = no% position no%,0 : on_change no%,remp_fin no% = no% + 1 : alpha no% : parent no%,no1% : no_remp_wait% = no% : hide no% top no%,40 : left no%,110 : caption no%,"Attendre svp..." no% = no% + 1 : alpha no% : parent no%,no1% : no_rempl_click% = no% : hide no% top no%,200 : left no%,100 : caption no%,"Cliquez dans l'image..." no% = no% + 1 : button no% : parent no%,no1% top no%,200 : left no%,10 : caption no%,"Pipette" on_click no%,pipette_debut no% = no% + 1 : button no% : parent no%,no1% top no%,200 : left no%,215 : caption no%,"Pipette" on_click no%,pipette_fin no% = no% + 1 : button no% : parent no%,no1% top no%,230 : left no%,110 : caption no%,"Appliquer" on_click no%,remplacer
no% = no% + 1 : container no% : no1% = no% : no_cont_miroir% = no% width no%,230 : height no%,100 : inactive no% caption no%,"Appliquer un effet miroir" top no%,top(no_image%)+height(no_image%)+10 : left no%,left(no_cont_rempl%)+width(no_cont_rempl%)+10 no% = no% + 1 : check no% : parent no%,no1% : no_miroir% = no% top no%,20 : left no%,10 : caption no%,"Miroir vertical" no% = no% + 1 : alpha no% : parent no%,no1% : no_miroir_wait% = no% : hide no% top no%,40 : left no%,10 : caption no%,"Attendre svp..." no% = no% + 1 : button no% : parent no%,no1% top no%,50 : left no%,10 : caption no%,"Appliquer" on_click no%,miroir
no% = no% + 1 : container no% : no1% = no% : no_cont_torture% = no% width no%,230 : height no%,150 : inactive no% caption no%,"Torturer l'image" ' top no%,top(no_image%)+height(no_image%)+10 : left no%,left(no_cont_miroir%)+width(no_cont_miroir%)+10 top no%,top(no_cont_miroir%)+height(no_cont_miroir%)+10 : left no%,left(no_cont_rempl%)+width(no_cont_rempl%)+10 no% = no% + 1 : button no% : parent no%,no1% : width no%,20 top no%,20 : left no%,10 : caption no%,"HG" on_click no%,coin_HG no% = no% + 1 : edit no% : parent no%,no1% : no_HG% = no% top no%,35 : left no%,35 : width no%,70 text no%,"0,0" no% = no% + 1 : button no% : parent no%,no1% : width no%,20 top no%,20 : left no%,200 : caption no%,"HD" on_click no%,coin_HD no% = no% + 1 : edit no% : parent no%,no1% : no_HD% = no% top no%,35 : left no%,125 : width no%,70 text no%,"0,0" no% = no% + 1 : button no% : parent no%,no1% : width no%,20 top no%,75 : left no%,10 : caption no%,"BG" on_click no%,coin_BG no% = no% + 1 : edit no% : parent no%,no1% : no_BG% = no% top no%,65 : left no%,35 : width no%,70 text no%,"0,0" no% = no% + 1 : button no% : parent no%,no1% : width no%,20 top no%,75 : left no%,200 : caption no%,"BD" on_click no%,coin_BD no% = no% + 1 : edit no% : parent no%,no1% : no_BD% = no% top no%,65 : left no%,125 : width no%,70 text no%,"0,0" no% = no% + 1 : alpha no% : parent no%,no1% : no_torture_click% = no% : hide no% top no%,90 : left no%,60 : caption no%,"Cliquez dans l'image..." no% = no% + 1 : alpha no% : parent no%,no1% : no_torture_wait% = no% : hide no% top no%,90 : left no%,60 : caption no%,"Attendre svp..." no% = no% + 1 : button no% : parent no%,no1% top no%,110 : left no%,80 : caption no%,"Appliquer" on_click no%,torturer
no% = no% + 1 : container no% : no1% = no% : no_cont_resize% = no% width no%,240 : height no%,260 : inactive no% caption no%,"Redimensionner l'image" top no%,top(no_cont_miroir%) : left no%,left(no_cont_miroir%)+width(no_cont_miroir%)+10 no% = no% + 1 : alpha no% : parent no%,no1% top no%,20 : left no%, 10 : caption no%,"Largeur en%:" no% = no% + 1 : edit no% : parent no%,no1% : text no%,"100" top no%,20 : left no%,100 : width no%,40 : inactive no% no% = no% + 1 : scroll_bar no% : parent no%,no1% : no_resize_w% = no% top no%,50 : left no%,10 : width no%,200 min no%,1 : max no%,400 : position no%,100 on_change no%,change_dimension no% = no% + 1 : alpha no% : parent no%,no1% top no%,80 : left no%, 10 : caption no%,"Hauteur en%:" no% = no% + 1 : edit no% : parent no%,no1% : text no%,"100" top no%,80 : left no%,100 : width no%,40 : inactive no% no% = no% + 1 : scroll_bar no% : parent no%,no1% : no_resize_h% = no% top no%,110 : left no%,10 : width no%,200 min no%,1 : max no%,400 : position no%,100 on_change no%,change_dimension no% = no% + 1 : alpha no% : parent no%,no1% : no_resize_wait% = no% : hide no% top no%,170 : left no%,110 : caption no%,"Attendre svp..." no% = no% + 1 : button no% : parent no%,no1% top no%,140 : left no%,80 : caption no%,"Appliquer" on_click no%,redimensionner no% = no% + 1 : alpha no% : parent no%,no1% : no_resize_largeur% = no% top no%,170 : left no%,10 : caption no%,"Largeur actuelle:" no% = no% + 1 : alpha no% : parent no%,no1% : no_resize_hauteur% = no% top no%,190 : left no%,10 : caption no%,"Hauteur actuelle:"
' no% = no% + 1 : button no% : caption no%,"Goutte d'eau" ' top no%,top(no_cont_torture%) ' left no%,left(no_cont_torture%)+width(no_cont_torture%)+10 ' on_click no%,goutte
return
initialisations: dll_on KGF$ i% = dll_call1("SetImmediateMode",1) text no_clip_x0%,"0" text no_clip_y0%,"0" text no_clip_x1%,"100" text no_clip_y1%,"100" return
menu: no% = no% + 1 : main_menu no% : no1% = no%
no% = no% + 1 : sub_menu no% : parent no%,no1% : no2% = no% caption no%,"Fichier" no% = no% + 1 : sub_menu no% : parent no%,no2% caption no%,"Ouvrir" : on_click no%,ouvrir no% = no% + 1 : sub_menu no% : parent no%,no2% caption no%,"Enregistrer" : on_click no%,sauver no% = no% + 1 : sub_menu no% : parent no%,no2% caption no%,"-------------" no% = no% + 1 : sub_menu no% : parent no%,no2% caption no%,"Sortir" : on_click no%,sortir
no% = no% + 1 : sub_menu no% : parent no%,no1% : no2% = no% caption no%,"Effets" : inactive no% : no_menu_effets% = no% no% = no% + 1 : sub_menu no% : parent no%,no2% caption no%,"Gradient" : on_click no%,gradient no% = no% + 1 : sub_menu no% : parent no%,no2% caption no%,"Gamma" : on_click no%,gammas no% = no% + 1 : sub_menu no% : parent no%,no2% caption no%,"Brillance" : on_click no%,brillance no% = no% + 1 : sub_menu no% : parent no%,no2% caption no%,"Niveaux de gris" : on_click no%,gris no% = no% + 1 : sub_menu no% : parent no%,no2% caption no%,"Filtre de couleurs" : on_click no%,filtrer no% = no% + 1 : sub_menu no% : parent no%,no2% caption no%,"Remplacer une couleur" : on_click no%,remplacer no% = no% + 1 : sub_menu no% : parent no%,no2% caption no%,"Effet miroir" : on_click no%,miroir no% = no% + 1 : sub_menu no% : parent no%,no2% caption no%,"Torturer" : on_click no%,torturer no% = no% + 1 : sub_menu no% : parent no%,no2% caption no%,"Redimensionner" : on_click no%,redimensionner no% = no% + 1 : sub_menu no% : parent no%,no2% caption no%,"Extraire un rectangle" : on_click no%,couper
no% = no% + 1 : sub_menu no% : parent no%,no1% : no2% = no% caption no%,"Outils" no% = no% + 1 : sub_menu no% : parent no%,no2% caption no%,"Info_bulle" : on_click no%,outil1 no% = no% + 1 : sub_menu no% : parent no%,no2% caption no%,"Incruster" : on_click no%,outil2
return
ouvrir: f1$ = file_name$(no_open%) if f1$="_" then return file_load no_image%,f1$ clipboard_copy no_image% pause 500 i% = dll_call0("LoadPicture") image_w% = dll_call0("GetPictureWidth") image_h% = dll_call0("GetPictureHeight") fact_w = image_w%/width(no_image%) fact_h = image_h%/height(no_image%) caption no_resize_largeur%,"Largeur actuelle: "+str$(image_w%) caption no_resize_hauteur%,"Hauteur actuelle: "+str$(image_h%) present% = 1 text no_HG%,"0,0" text no_HD%,str$(image_w%-1)+",0" text no_BG%,"0,"+str$(image_h%-1) text no_BD%,str$(image_w%-1)+","+str$(image_h%-1) active no_menu_effets% active no_cont_grad% active no_cont_gamma% active no_cont_bright% active no_cont_gris% active no_cont_filter% active no_cont_clip% active no_cont_rempl% active no_cont_miroir% active no_cont_torture% active no_cont_resize% return
sauver: if present%=0 message "Il n'y a pas d'image à enregistrer" return end_if f2$ = file_name$(no_save%) if f2$="_" then return if f2$="" then return if lower$(right$(f2$,4))<>".bmp" then f2$ = f2$ + ".bmp" if file_exists(f2$) s$ = "Le fichier "+f2$+"existe. Voulez_vous le remplacer ?" if message_confirmation_yes_no(s$)<>1 then return end_if file_save no_image%,f2$ return
sortir: if present%=1 s$ = "Voulez-vous vraiment quitter le programme ?" if message_confirmation_yes_no(s$)<>1 then return end_if purger: if present%=1 i%=dll_call0("SavePicture") pause 3 end_if dll_off terminate
change_debut: color no_grad_debut%,position(no_grad_debut_R%),position(no_grad_debut_G%),position(no_grad_debut_B%) return
change_fin: color no_grad_fin%,position(no_grad_fin_R%),position(no_grad_fin_G%),position(no_grad_fin_B%) return
remp_debut: color no_remp_debut%,position(no_remp_debut_R%),position(no_remp_debut_G%),position(no_remp_debut_B%) return
remp_fin: color no_remp_fin%,position(no_remp_fin_R%),position(no_remp_fin_G%),position(no_remp_fin_B%) return
gradient: if item_index(no_grad_type%)=0 message "Il faut choisir le type de dégradé." return end_if sta$ = mid$(grad_type$,item_index(no_grad_type%),1) adresse$ = text$(no_grad_x%)+","+text$(no_grad_y%) c0$ = str$(position(no_grad_debut_R%)) c0$ = c0$ + "," + str$(position(no_grad_debut_G%)) c0$ = c0$ + "," + str$(position(no_grad_debut_B%)) ' c0$ = "240,237,23" c1$ = "16,46,216" i% = dll_call4("CreatePictureGradientColor",adr(sta$),adr(adresse$),adr(c0$),adr(c1$)) pause 300 clipboard_paste no_image% return
gammas: show no_gamma_wait% display inactive no_cont_gamma% n% = checked(no_gamma%) i% = dll_call1("SetPictureGamma",n%) pause 300 clipboard_paste no_image% active no_cont_gamma% hide no_gamma_wait% return
brillance: show no_bright_wait% display inactive no_cont_bright% i% = M20% if checked(no_bright%)=1 then i% = 0 - M20% i% = dll_call1("SetPictureBrightness",i%) pause 300 clipboard_paste no_image% active no_cont_bright% hide no_bright_wait% return
gris: show no_gris_wait% display inactive no_cont_gris% i% = dll_call0("SetPictureGrayScale") pause 300 clipboard_paste no_image% active no_cont_gris% hide no_gris_wait% return
filtrer: show no_filter_wait% display inactive no_cont_filter% r% = m1% : g% = m1% : b% = m1% if checked(no_filter_r%)=1 then r% = position(no_filtre_R%) if checked(no_filter_g%)=1 then g% = position(no_filtre_G%) if checked(no_filter_b%)=1 then b% = position(no_filtre_B%) i% = dll_call3("SetPictureFilter",r%,g%,b%) pause 300 clipboard_paste no_image% active no_cont_filter% hide no_filter_wait% return
change_filtre: r% = position(no_filtre_R%) g% = position(no_filtre_G%) b% = position(no_filtre_B%) color no_filter%,r%,g%,b% return
couper: x0% = int(val(text$(no_clip_x0%))) y0% = int(val(text$(no_clip_y0%))) x1% = int(val(text$(no_clip_x1%))) y1% = int(val(text$(no_clip_y1%))) i% = dll_call4("ExtractRectangleFromPicture",x0%,y0%,x1%,y1%) pause 300 clipboard_paste no_image% return
outil1: if handle_form(tit_outil1$)= 0 then execute nom_outil1$ return
outil2: if handle_form(tit_outil2$)= 0 then execute nom_outil2$ return
click_picture: if pipette%>0 extraire_couleur() pipette% = 0 hide no_rempl_click% end_if if coin%>0 placer_position() coin% = 0 hide no_torture_click% end_if return
pipette_debut: pipette% = 1 show no_rempl_click% return
pipette_fin: pipette% = 2 show no_rempl_click% return
remplacer: if position(no_remp_debut_R%)=position(no_remp_fin_R%) if position(no_remp_debut_G%)=position(no_remp_fin_G%) if position(no_remp_debut_B%)=position(no_remp_fin_B%) message "C'est la même couleur !" return end_if end_if end_if show no_remp_wait% display inactive no_cont_rempl% i% = dll_call6("ReplacePictureColor",position(no_remp_debut_R%),position(no_remp_debut_G%),position(no_remp_debut_B%),position(no_remp_fin_R%),position(no_remp_fin_G%),position(no_remp_fin_B%)) pause 300 clipboard_paste no_image% active no_cont_rempl% hide no_remp_wait% return
miroir: show no_miroir_wait% display inactive no_cont_miroir% i% = dll_call1("MirrorPicture",checked(no_miroir%)+1) pause 300 clipboard_paste no_image% active no_cont_miroir% hide no_miroir_wait% return
coin_HG: coin% = 1 show no_torture_click% return
coin_HD: coin% = 2 show no_torture_click% return
coin_BG: coin% = 3 show no_torture_click% return
coin_BD: coin% = 4 show no_torture_click% return
torturer: show no_torture_wait% display inactive no_cont_torture% sa$ = trim$(text$(no_HD%)) sb$ = trim$(text$(no_HG%)) sc$ = trim$(text$(no_BG%)) sd$ = trim$(text$(no_BD%)) i% = dll_call4("TorturePicture",adr(sa$),adr(sb$),adr(sc$),adr(sd$)) pause 300 clipboard_paste no_image% active no_cont_torture% hide no_torture_wait% return
change_dimension: text number_change-1,position(number_change) w% = image_w%*position(no_resize_w%)/100 h% = image_h%*position(no_resize_h%)/100 caption no_resize_largeur%,"Largeur actuelle: "+str$(w%) caption no_resize_hauteur%,"Hauteur actuelle: "+str$(h%) return
redimensionner: show no_resize_wait% display inactive no_cont_resize% w% = image_w%*position(no_resize_w%)/100 h% = image_h%*position(no_resize_h%)/100 image_w% = w% image_h% = h% fact_w = image_w%/width(no_image%) fact_h = image_h%/height(no_image%) caption no_resize_largeur%,"Largeur actuelle: "+str$(image_w%) caption no_resize_hauteur%,"Hauteur actuelle: "+str$(image_h%) i% = dll_call2("ResizePicture",w%,h%) pause 300 clipboard_paste no_image% i% = dll_call0("LoadPicture") active no_cont_resize% hide no_resize_wait% position no_resize_w%,100 position no_resize_h%,100 return
' goutte: ' w% = dll_call0("GetClipboardPictureWidth") ' h% = dll_call0("GetClipboardPictureWidth") ' i% = dll_call3("TestDropOnPicture",w%/2,h%/2,w%/10) ' pause 300 ' clipboard_paste no_image% ' return
sub extraire_couleur() dim_local x%, y%, r%, g%, b% x% = mouse_x_left_down(no_image%)*fact_w y% = mouse_y_left_down(no_image%)*fact_h r% = color_pixel_red(no_image%,x%,y%) g% = color_pixel_green(no_image%,x%,y%) b% = color_pixel_blue(no_image%,x%,y%) if pipette%=1 position no_remp_debut_R%,r% position no_remp_debut_G%,g% position no_remp_debut_B%,b% else position no_remp_fin_R%,r% position no_remp_fin_G%,g% position no_remp_fin_B%,b% end_if end_sub
sub placer_position() dim_local x%, y% x% = mouse_x_left_down(no_image%)*fact_w y% = mouse_y_left_down(no_image%)*fact_h select coin% case 1: text no_HG%,str$(x%)+","+str$(y%) case 2: text no_HD%,str$(x%)+","+str$(y%) case 3: text no_BG%,str$(x%)+","+str$(y%) case 4: text no_BD%,str$(x%)+","+str$(y%) end_select end_sub
| |
|