FORUM DE DISCUSSION SUR LE LANGAGE PANORAMIC
Vous souhaitez réagir à ce message ? Créez un compte en quelques clics ou connectez-vous pour continuer.
FORUM DE DISCUSSION SUR LE LANGAGE PANORAMIC

Développement d'applications avec le langage Panoramic
 
AccueilAccueil  RechercherRechercher  Dernières imagesDernières images  S'enregistrerS'enregistrer  MembresMembres  Connexion  
Derniers sujets
» 2D_fill_color
Un texte clignotant Emptypar leclode Aujourd'hui à 10:34

» Consommation gaz électricité
Un texte clignotant Emptypar leclode Mer 17 Avr 2024 - 11:07

» trop de fichiers en cours
Un texte clignotant Emptypar lepetitmarocain Mer 17 Avr 2024 - 10:19

» on_key_down (résolu)
Un texte clignotant Emptypar leclode Mar 16 Avr 2024 - 11:01

» Sous-programme(résolu)
Un texte clignotant Emptypar jjn4 Jeu 4 Avr 2024 - 14:42

» Bataille-navale
Un texte clignotant Emptypar jjn4 Mer 3 Avr 2024 - 14:08

» Minimiser une fenêtre Panoramic.
Un texte clignotant Emptypar Pedro Mar 2 Avr 2024 - 13:50

» Récapitulatif ludothèque panoramic jjn4
Un texte clignotant Emptypar jjn4 Lun 1 Avr 2024 - 18:04

» demande explication KGF pour imprimer en mm
Un texte clignotant Emptypar JL35 Jeu 28 Mar 2024 - 17:28

» Petit passage furtif
Un texte clignotant Emptypar Froggy One Mer 27 Mar 2024 - 14:26

» SPIN et aide langage (résolu)
Un texte clignotant Emptypar leclode Sam 23 Mar 2024 - 15:20

» Aide-mémoire des mots-clés Panoramic
Un texte clignotant Emptypar papydall Mer 20 Mar 2024 - 21:23

» Je ne comprend pas pourquoi la largeur de la scene 3d change
Un texte clignotant Emptypar Marc Mar 12 Mar 2024 - 20:06

» Comment télécharger panoramic?
Un texte clignotant Emptypar lepetitmarocain Sam 9 Mar 2024 - 13:31

» @lepetitmarocain <==> KGFGrid
Un texte clignotant Emptypar Klaus Dim 3 Mar 2024 - 9:59

Navigation
 Portail
 Index
 Membres
 Profil
 FAQ
 Rechercher
Rechercher
 
 

Résultats par :
 
Rechercher Recherche avancée
Avril 2024
LunMarMerJeuVenSamDim
1234567
891011121314
15161718192021
22232425262728
2930     
CalendrierCalendrier
Le Deal du moment : -34%
-34% LG OLED55B3 – TV OLED 4K 55″ 2023 ...
Voir le deal
919 €

 

 Un texte clignotant

Aller en bas 
4 participants
AuteurMessage
JL35




Nombre de messages : 7093
Localisation : 77
Date d'inscription : 29/11/2007

Un texte clignotant Empty
MessageSujet: Un texte clignotant   Un texte clignotant EmptyLun 31 Déc 2018 - 14:33

Pour présenter ses voeux ou autre...
Le résultat est dans un gif animé, donc intégrable dans un email.
Et pour nous intégrable dans un html et donc affichable dans un Hviewer (et même ici !)
Code:
' Fabrication d'un gif animé: texte clignotant rouge/jaune
' Si plusieurs lignes (séparées par '<#'), elles seront centrées dans la fenêtre
LABEL CreImg,Couleur
DIM p%,h%,txt$,wt%,ht%,mgh%,mgv%,bd%,cv$,f$,f1$,f2$,fr$,fh$,r$,fnt$,sz%
DIM tx$(10),nl%,i%,k%,a$,x%,y%,wm%,htt%,cf$,cb$,ct1$,ct2$,r%,g%,b%,suf$

txt$ = "SALUT<#LES PANORAMICIENS !"

mgh% = 30: ' marges horizontales entre texte et bord
mgv% = 20: ' marges verticales entre texte et bord
bd% = 10: ' largeurt de la bordure d'encadrement
fnt$ = "Arial"
sz% = 16
cf$ = "64,64,64": ' couleur encadrement
cb$ = "180,180,180": ' couleur de fond
ct1$ = "255,64,64": ' couleur 1 du texte
ct2$ = "255,255,64": ' couleur 2 du texte (en alternance)

cv$ = "C:\PROGRA~1\IMAGEM~1.3-Q\convert.exe": ' chemin de convert de ImageMagick
r$ = "C:\TEMP\GIF\": ' répertoire de travail: sera créé si inexistant
f1$ = r$+"Img01.bmp": ' images composantes
f2$ = r$+"Img02.bmp": '    "
fr$ = r$+"Anime.gif": ' Gif animé résultat
fh$ = r$+"Anime.htm": ' pour affichage dans le Hviewer

IF DIR_EXISTS(r$)=0 THEN DIR_MAKE r$
IF FILE_EXISTS(fr$) = 1 THEN FILE_DELETE fr$
IF FILE_EXISTS(r$+"*.gif")<>0 THEN EXECUTE_WAIT "cmd.exe|/c DEL /Q "+r$+"*.gif"
BORDER_SMALL 0
p% = 10: PICTURE p%: FONT_NAME p%,fnt$: FONT_SIZE p%,sz%: FONT_BOLD p%
' Paramètres du texte (dimensions ...)
wt% = TEXT_WIDTH(txt$,p%): ht% = TEXT_HEIGHT(txt$,p%)
nl% = 1: k% = INSTR(txt$,"<#")
IF k%>0
    wt% = 0
    WHILE k% > 0
        tx$(nl%) = LEFT$(txt$,k%-1): txt$ = RIGHT_POS$(txt$,k%+2)
        i% = TEXT_WIDTH(tx$(nl%),p%): IF i%>wt% THEN wt% = i%
        nl% = nl%+1: k% = INSTR(txt$,"<#")
    END_WHILE
    tx$(nl%) = txt$
    i% = TEXT_WIDTH(tx$(nl%),p%): IF i%>wt% THEN wt% = i%
    htt% = nl%*ht%: ' hauteur totale
ELSE
    tx$(1) = txt$
    htt% = ht%
END_IF

WIDTH 0,wt%+2*mgh%+50: HEIGHT 0,htt%+2*mgv%+60
WIDTH p%,wt%+2*mgh%: HEIGHT p%,htt%+2*mgv%
2D_TARGET_IS p%
a$ = cb$: GOSUB Couleur: 2D_PEN_COLOR r%,g%,b%: 2D_PEN_WIDTH bd%
a$ = cf$: GOSUB Couleur: 2D_FILL_COLOR r%,g%,b%
2D_RECTANGLE bd%/2,bd%/2,WIDTH(p%)-bd%/2+1,HEIGHT(p%)-bd%/2+1
PRINT_TARGET_IS p%
' ----- Création des images élémentaires -----
a$ = ct1$: f$ = f1$: GOSUB CreImg: ' image rouge
a$ = ct2$: f$ = f2$: GOSUB CreImg: ' image jaune
' ----- Création du gif animé -----
' delay: délai entre images, en 100èmes de seconde: 50 = 500 ms
' loop : nombre de boucles à exécuter (0: infini, boucle sans fin)
suf$ = "*.bmp": ' type des images à assembler
EXECUTE_WAIT "cmd.exe|/c "+cv$+" -delay 50 -loop 0 "+r$+suf$+" "+fr$
FILE_DELETE f1$: FILE_DELETE f2$: ' suppression des composantes
' ----- Affichage du résultat (Html -> Hviewer) -----
CAPTION 0,"APERÇU  DU  RÉSULTAT :  "+fr$
h% = 12
HVIEWER h%: TOP h%,0: LEFT h%,0: WIDTH h%,WIDTH(p%)+30: HEIGHT h%,HEIGHT(p%)+20
FILE_OPEN_WRITE 1,fh$
    FILE_WRITELN 1,"<HTML>,<HEADER></HEADER><BODY>"
    FILE_WRITELN 1,"<IMG SRC="+fr$+">"
    FILE_WRITELN 1,"</BODY></HTML>"
FILE_CLOSE 1
FILE_LOAD h%,fh$
FILE_DELETE fh$
END
' ==============================================================================
CreImg:
  GOSUB Couleur: FONT_COLOR p%,r%,g%,b%
  y% = mgv%
  FOR i% = 1 TO nl%
      a$ = tx$(i%): wt% = TEXT_WIDTH(a$,p%): x% = (WIDTH(p%)-wt%)/2
      PRINT_LOCATE x%,y%: PRINT a$: y% = y%+ht%
  NEXT i%
  FILE_SAVE p%,f$: ' image rouge
RETURN
' ==============================================================================   
Couleur:
  k% = INSTR(a$,","): r%=VAL(LEFT$(a$,k%-1)): a$ = RIGHT_POS$(a$,k%+1)
  k% = INSTR(a$,","): g%=VAL(LEFT$(a$,k%-1)): b%=VAL(RIGHT_POS$(a$,k%+1))
RETURN
' ==============================================================================
Un texte clignotant Anime10

Quelques conditions à remplir, tout de même:
- disposer de ImageMagick (convert.exe est une de ses composantes), très pratique pour bricoler des images (gratuit évidemment, et très facile à trouver sur le net)
- ajuster quelques paramètres, notamment le répertoire de travail (ici C:\TEMP\)
Tous les autres paramètres sont évidemment ajustable à son goût; police, taille, couleurs, enrichissements, marges, etc.

On peut aussi imaginer assez facilement de mettre des images animées au lieu de texte, le principe est le même. Ici il n'y a que deux images (texte rouge et jaune), mais on peut en mettre bien plus et faire toute une séquence;
Revenir en haut Aller en bas
jjn4

jjn4


Nombre de messages : 2684
Date d'inscription : 13/09/2009

Un texte clignotant Empty
MessageSujet: +++   Un texte clignotant EmptyLun 31 Déc 2018 - 16:24

Très fort !
Et bonne fin d'année à toi aussi !
(et bien sûr à tous les autres panoramiciens aussi)
santa drunken Sleep
Revenir en haut Aller en bas
http://jjn4.e-monsite.com
JL35




Nombre de messages : 7093
Localisation : 77
Date d'inscription : 29/11/2007

Un texte clignotant Empty
MessageSujet: Re: Un texte clignotant   Un texte clignotant EmptyLun 31 Déc 2018 - 16:57

Merci jj, et bon réveillon ! (avec modération...) Very Happy
Revenir en haut Aller en bas
papydall

papydall


Nombre de messages : 6989
Age : 73
Localisation : Moknine (Tunisie) Entre la chaise et le clavier
Date d'inscription : 03/03/2012

Un texte clignotant Empty
MessageSujet: Re: Un texte clignotant   Un texte clignotant EmptyMar 1 Jan 2019 - 13:19

Moi aussi, je clignote mais à ma manière tongue

Code:

rem ============================================================================
dim t$
t$ = " **** Salut les Panoramiciens **** " + chr$(13)
t$ = t$ + " ****** Bonne année 2019 ***** "
Texte_clignotant(t$,100,50)
end
rem ============================================================================
SUB Texte_clignotant(t$,h,g)
    dim_local n : n = 9999
    if label("blink") = 0 then label blink
    if variable("bidon$") = 0 then dim bidon$
    if variable("t") = 0 then dim t
    while object_exists(n) = 1
       n = n - 1
    end_while
    t = n
    alpha t : font_name t,"tahoma" : font_bold t : font_size t,20
    left t,g : top t,h : color t,50,200,100 : font_color t, 0,0,255
    caption t,t$
    n = n-1
    while object_exists(n) = 1
       n = n - 1
    end_while
    timer n : on_timer n,blink    
END_SUB
rem ============================================================================
blink:
   bidon$ = blink$(t)
return
rem ============================================================================
FNC Blink$(n)
    if hide(n) = 0
       hide n
    else
       show n
    end_if
    result ""
END_FNC
rem ============================================================================
Revenir en haut Aller en bas
http://papydall-panoramic.forumarabia.com/
Minibug

Minibug


Nombre de messages : 4566
Age : 57
Localisation : Vienne (86)
Date d'inscription : 09/02/2012

Un texte clignotant Empty
MessageSujet: Re: Un texte clignotant   Un texte clignotant EmptyMar 1 Jan 2019 - 13:45

Papydall est d'humeur taquine en ce début d'année... Laughing Laughing Laughing
Revenir en haut Aller en bas
http://gpp.panoramic.free.fr
JL35




Nombre de messages : 7093
Localisation : 77
Date d'inscription : 29/11/2007

Un texte clignotant Empty
MessageSujet: Re: Un texte clignotant   Un texte clignotant EmptyMar 1 Jan 2019 - 13:50

En effet oui !

J'ai amélioré mon programme de là-haut en ajoutant une interface qui permet de tout paramétrer avant de lancer l'exécution (texte, police, taille, couleurs, etc.), si ça intéresse quelqu'un ,je le mettrai ici...
Revenir en haut Aller en bas
Contenu sponsorisé





Un texte clignotant Empty
MessageSujet: Re: Un texte clignotant   Un texte clignotant Empty

Revenir en haut Aller en bas
 
Un texte clignotant
Revenir en haut 
Page 1 sur 1
 Sujets similaires
-
» Rotation de texte
» Texte sur image
» Texte sur cercle
» Conversion texte en rtf
» saisie de texte

Permission de ce forum:Vous ne pouvez pas répondre aux sujets dans ce forum
FORUM DE DISCUSSION SUR LE LANGAGE PANORAMIC :: PANORAMIC :: Vos sources, vos utilitaires à partager-
Sauter vers: