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
» Gestion d'un système client-serveur.
Mon "ImageList Creator" Emptypar Klaus Ven 17 Mai 2024 - 14:02

» item_index(résolu)
Mon "ImageList Creator" Emptypar jjn4 Mar 14 Mai 2024 - 19:38

» Bataille terrestre
Mon "ImageList Creator" Emptypar jjn4 Lun 13 Mai 2024 - 15:01

» SineCube
Mon "ImageList Creator" Emptypar Marc Sam 11 Mai 2024 - 12:38

» Editeur EliP 6 : Le Tiny éditeur avec 25 onglets de travail
Mon "ImageList Creator" Emptypar Marc Sam 11 Mai 2024 - 12:22

» Philharmusique
Mon "ImageList Creator" Emptypar jjn4 Ven 10 Mai 2024 - 13:58

» PANORAMIC V 1
Mon "ImageList Creator" Emptypar papydall Jeu 9 Mai 2024 - 3:22

» select intégrés [résolu]
Mon "ImageList Creator" Emptypar jjn4 Mer 8 Mai 2024 - 17:00

» number_mouse_up
Mon "ImageList Creator" Emptypar jjn4 Mer 8 Mai 2024 - 11:59

» Aide de PANORAMIC
Mon "ImageList Creator" Emptypar jjn4 Mer 8 Mai 2024 - 11:16

» trop de fichiers en cours
Mon "ImageList Creator" Emptypar lepetitmarocain Mer 8 Mai 2024 - 10:43

» Je teste PANORAMIC V 1 beta 1
Mon "ImageList Creator" Emptypar papydall Mer 8 Mai 2024 - 4:17

» bouton dans autre form que 0(résolu)
Mon "ImageList Creator" Emptypar leclode Lun 6 Mai 2024 - 13:59

» KGF_dll - nouvelles versions
Mon "ImageList Creator" Emptypar Klaus Lun 6 Mai 2024 - 11:41

» @Jack
Mon "ImageList Creator" Emptypar Jack Mar 30 Avr 2024 - 20:40

Navigation
 Portail
 Index
 Membres
 Profil
 FAQ
 Rechercher
Rechercher
 
 

Résultats par :
 
Rechercher Recherche avancée
Mai 2024
LunMarMerJeuVenSamDim
  12345
6789101112
13141516171819
20212223242526
2728293031  
CalendrierCalendrier
Le Deal du moment :
Display Star Wars Unlimited Ombres de la Galaxie : ...
Voir le deal

 

 Mon "ImageList Creator"

Aller en bas 
4 participants
AuteurMessage
Yannick




Nombre de messages : 8611
Age : 53
Localisation : Bretagne
Date d'inscription : 15/02/2010

Mon "ImageList Creator" Empty
MessageSujet: Mon "ImageList Creator"   Mon "ImageList Creator" EmptyMer 24 Fév 2016 - 19:52

Voilà ma bête.
Les imagelist c' est bien mais comment se rappeler les images que l' on a mise dedans ?
Celui ci crée un fichier *.inf du même nom avec les dimensions et les noms des fichiers.

Spoiler:
Revenir en haut Aller en bas
Jicehel

Jicehel


Nombre de messages : 5947
Age : 51
Localisation : 77500
Date d'inscription : 18/04/2011

Mon "ImageList Creator" Empty
MessageSujet: Re: Mon "ImageList Creator"   Mon "ImageList Creator" EmptyMer 24 Fév 2016 - 20:46

Jolie réalisation et en effet, ça facilite l'usage
Revenir en haut Aller en bas
Minibug

Minibug


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

Mon "ImageList Creator" Empty
MessageSujet: Re: Mon "ImageList Creator"   Mon "ImageList Creator" EmptyMer 24 Fév 2016 - 21:40

Salut ygeronimi !

j'ai voulu ouvrir le shell32.dll de Windows je sais qu'il y a des icônes dans ce fichier.
mais j'ai eu un message d'erreur ACCES AU FICHIER REFUSE !

J'ai peut être pas fait ce qu'il fallait...
Revenir en haut Aller en bas
http://gpp.panoramic.free.fr
Klaus

Klaus


Nombre de messages : 12301
Age : 75
Localisation : Ile de France
Date d'inscription : 29/12/2009

Mon "ImageList Creator" Empty
MessageSujet: Re: Mon "ImageList Creator"   Mon "ImageList Creator" EmptyMer 24 Fév 2016 - 23:28

Attention, Minibug: shell32.dll n'est pas une ImageList. On ne peut pas l'ouvrir comme ça. Les images contenues dans shell32.dll sont des "ressources" qui peuvent être extraites par ResHacker (excellent gratuiciel).
Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
Minibug

Minibug


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

Mon "ImageList Creator" Empty
MessageSujet: Re: Mon "ImageList Creator"   Mon "ImageList Creator" EmptyJeu 25 Fév 2016 - 7:31

c'est bien ce que je pensé, je n'ai pas fais ce qu'il fallait.
Désolé ! Embarassed
Revenir en haut Aller en bas
http://gpp.panoramic.free.fr
Yannick




Nombre de messages : 8611
Age : 53
Localisation : Bretagne
Date d'inscription : 15/02/2010

Mon "ImageList Creator" Empty
MessageSujet: re   Mon "ImageList Creator" EmptyJeu 25 Fév 2016 - 10:17

Attention Minibug, cet outil ne fonctionne que pour des ImageList utilisables par kgf.dll
Et si tu veux ouvrir un ImageList avec tous les noms de fichier, il te faut l' avoir créé avec cet outils.

Le fichier *.inf créé en parallèle te donne

dimension Height
dimension Width
nom du fichier 0
nom du fichier 1
....

Ce qui te permet de savoir les images que contient ta librairie et la dimension des images ( Même dans six mois Laughing ).
Tu peux aussi te servir de ce fichier dans le cas d' une section "Paramètres" avec un combo.
Par defaut, l' appli va chercher les images dans son dossier "src" que j' ai mis pour regrouper les images sources
et Enregistre les ImageList + les *.inf dans son dossier "lib" là aussi pour ne pas les éparpiller sur DD de l' ordi.
Pour que la fonction Ouvrir ne bug pas, il faut que les deux fichiers soit dans le même dossier.

Ce n' est qu' un début, je compte bien l' améliorer mais j' en avais besoin tout de suite 
pour un autre programme en cours ( que je recommence régulièrement  Rolling Eyes ).
Revenir en haut Aller en bas
Minibug

Minibug


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

Mon "ImageList Creator" Empty
MessageSujet: Re: Mon "ImageList Creator"   Mon "ImageList Creator" EmptyJeu 25 Fév 2016 - 10:55

Sur ce coup la j'ai buggué ! Laughing Laughing
Revenir en haut Aller en bas
http://gpp.panoramic.free.fr
Yannick




Nombre de messages : 8611
Age : 53
Localisation : Bretagne
Date d'inscription : 15/02/2010

Mon "ImageList Creator" Empty
MessageSujet: re   Mon "ImageList Creator" EmptyDim 6 Mar 2016 - 0:08

Une version différente car elle permet de faire un fichier imagelist depuis un dossier.
On travaille les images dans un dossier où on les enregistre dans les dimensions voulu.
On lance le programme, on suit les instructions et le programme crée un fichier de toutes les images de la dimension sélectionnée
au format bmp.
Un fichier *.inf avec la liste des noms de fichier des images est créé en parallèle.

Code:
hide 0
variables()
constantes()
labels()
init()
AskLibName()
AskDirSource()
gui()
show 0
end

sub variables()
' -> incrementation des objets panoramic
   dim no%
' -> variables système
   dim LibName$
   dim LibFilesList$
   dim LibSource$
   dim ico%(4)
   dim adrIlb%
   dim IL_h%
   dim IL_w%
end_sub

' ------------------------------------------------------------------------------

sub constantes()
' -> dossier courant
   dim Path$
' -> dossiers et fichiers externes
   dim LibDirectory$
   dim Param$
   dim Kgf$
   dim Ilb$
' -> objets panoramic
' --> form principal
   dim File_OW%       : no%=no%+1 : File_OW%       =no%
   dim File_OR%       : no%=no%+1 : File_OR%       =no%
   dim OpenDial%      : no%=no%+1 : OpenDial%      =no%
   dim Pan%           : no%=no%+1 : Pan%           =no%
   dim AlphLibName%   : no%=no%+1 : AlphLibName%   =no%
   dim EditLibName%   : no%=no%+1 : EditLibName%   =no%
   dim AlphLibSource% : no%=no%+1 : AlphLibSource% =no%
   dim EditLibSource% : no%=no%+1 : EditLibSource% =no%
   dim AlphLibFormat% : no%=no%+1 : AlphLibFormat% =no%
   dim CombLibFormat% : no%=no%+1 : CombLibFormat% =no%
   dim ButCreate%     : no%=no%+1 : ButCreate%     =no%
   dim MemoFilesList% : no%=no%+1 : MemoFilesList% =no%
' --> form attente
   dim F_Attente%     : no%=no%+1 : F_Attente%     =no%
   dim AlphFA%        : no%=no%+1 : AlphFA%        =no%
   dim PB%            : no%=no%+1 : PB%            =no%
   dim AlphFic%       : no%=no%+1 : AlphFic%       =no%
' --> form preview
   dim F_Preview%     : no%=no%+1 : F_Preview%     =no%
   dim EditTV%        : no%=no%+1 : EditTV%        =no%
   dim Pict%          : no%=no%+1 : Pict%          =no%
   dim AlphPict%      : no%=no%+1 : AlphPict%      =no%
' -> objets kgf
   dim IL%
   dim TV%
end_sub

' ------------------------------------------------------------------------------

sub labels()
   label clic,change,close0,fin
end_sub

' ------------------------------------------------------------------------------

sub init()
   dim_local m%,mes$,f$,i%,mes2$
   mes$ = "KGF.dll n' a pas été trouvée dans le dossier courant !!!"+chr$(13)+chr$(13)
   mes$ = mes$+"Voulez vous la chercher sur votre ordinateur ?..."
' -> dossier courant
   Path$ = dir_current$
   if right$(Path$,1) = "" : Path$ = left$(Path$,len(Path$)-1) : end_if
   Path$ = Path$+""
' -> dossier et fichiers externes
   LibDirectory$ = Path$+"Library"
   if dir_exists(LibDirectory$) = 0 : dir_make LibDirectory$ : end_if
   Param$        = Path$+"Param.inf"
   Kgf$          = Path$+"KGF.dll"
   if file_exists(kgf$) = 0
      if file_exists(Param$) = 1
         file_open_read File_OR%,Param$
         file_readln File_OR%,kgf$
         file_close File_OR%
      else
         m%=message_warning_yes_no(mes$)
         if m% = 1
            open_dialog OpenDial%
            dir_dialog OpenDial%,"C:"
            filter OpenDial%,"*.dll|*.dll"
            f$ = file_name$(OpenDial%)
            delete OpenDial%
            if f$<>"_"
               Kgf$ = f$
               file_open_write File_OW%,Param$
               file_writeln File_OW%,Kgf$
               file_close File_OW%
            end_if
         else
            message "Le programme va se fermer."+chr$(13)+"Pensez à télécharger KGF.dll avant de relancer l' application..."
            gosub fin
         end_if
      end_if
   end_if
   Ilb$ = Path$+"Img.ilb"
   if file_exists(Ilb$)=1
      adrIlb% = adr(Ilb$)
      for i%=1 to 3 : ico%(i%)=i% : next i%
   else
      mes2$ = "Une librairie d' images pour l' objet Treeview est disponible."+chr$(13)
      mes2$ = mes2$+"Elle est sur le Webdav de ygeronimi, dans le zip :"+chr$(13)
      mes2$ = mes2$+"ImageListFromDirectory.zip"
      message mes2$
      adrIlb% = 0
      for i%=1 to 3 : ico%(i%)=0 : next i%
   end_if
' -> chargement de la dll
   dll_on kgf$
end_sub

' ------------------------------------------------------------------------------

sub gui()
   dim_local h%,w%
  
   height 0,200
   width 0,400
  
   font_name 0,"arial"
   font_size 0,8
   caption 0,"ImageList From Directory"
  
   panel Pan%
   full_space Pan%
   h% = height(Pan%)
   w% = width(Pan%)
   delete Pan%
  
   alpha AlphLibName%
   top AlphLibName%,10
   left AlphLibName%,10
   caption AlphLibName%,"Nom de la librairie :"
  
   edit EditLibName%
   width EditLibName%,250
   top EditLibName%,25
   left EditLibName%,10
   font_color EditLibName%,0,0,200
   text EditLibName%,file_extract_name$(LibName$)
   inactive EditLibName%

   alpha AlphLibSource%
   top AlphLibSource%,50
   left AlphLibSource%,10
   caption AlphLibSource%,"Source :"
  
   edit EditLibSource%
   width EditLibSource%,w%-20
   top EditLibSource%,65
   left EditLibSource%,10
   font_color EditLibSource%,0,0,200
   text EditLibSource%,LibSource$
   inactive EditLibSource%
  
   alpha AlphLibFormat%
   top AlphLibFormat%,90
   left AlphLibFormat%,10
   caption AlphLibFormat%,"Dimensions :"


   combo CombLibFormat%
   width CombLibFormat%,80
   top CombLibFormat%,105
   left CombLibFormat%,10
   font_color CombLibFormat%,0,0,200
   on_click CombLibFormat%,clic
  
   item_add CombLibFormat%,"16x16"
   item_add CombLibFormat%,"24x24"
   item_add CombLibFormat%,"32x32"
   item_add CombLibFormat%,"48x48"
   item_add CombLibFormat%,"64x64"
   item_add CombLibFormat%,"128x128"
  
   button ButCreate%
   top ButCreate%,h%-30
   left ButCreate%,w%-(width(ButCreate%)+5)
   caption ButCreate%,"Créer"
   cursor_point ButCreate%
   on_click ButCreate%,clic
  
   dlist MemoFilesList%
end_sub

' ------------------------------------------------------------------------------

sub FormAttente()
   dim_local res%,h%,w%
   if object_exists(F_Attente%)=1
      show F_Attente%
   else
      form F_Attente%
      height F_Attente%,100
      width F_Attente%,300
      top F_Attente%,top(0)+((height(0)-height(F_Attente%))/2)
      left F_Attente%,left(0)+((width(0)-width(F_Attente%))/2)
      font_name F_Attente%,"arial"
      font_size F_Attente%,8
      caption F_Attente%,"Patienter SVP..."
      
      panel Pan%
      parent Pan%,F_Attente%
      full_space Pan%
      h% = height(Pan%)
      w% = width(Pan%)
      delete Pan%
      
      alpha alphFA%
      parent alphFA%,F_Attente%
      top alphFA%,10
      left alphFA%,10
      caption alphFA%,"Etape : 0 / 2"
      
      progress_bar PB%
      parent PB%,F_Attente%
      top PB%,25
      left PB%,10
      width PB%,w%-20
      min PB%,0
      max PB%,2
      position PB%,0
      
      alpha AlphFic%
      parent AlphFic%,F_Attente%
      top AlphFic%,50
      left AlphFic%,10
      
   end_if
   res% = DLL_call2("WindowTopMost",handle(F_Attente%),1)
end_sub

' ------------------------------------------------------------------------------

sub FormPreview()
   dim_local res%,h%,w%,txt$,i%
   if object_exists(F_Preview%)=1
      show F_Preview%
   else
      form F_Preview%
      height F_Preview%,350
      width F_Preview%,500
      top F_Preview%,top(0)+100
      left F_Preview%,left(0)+(width(0)+10)
      font_name F_Preview%,"arial"
      font_size F_Preview%,8
      caption F_Preview%,"Preview"
      
      panel Pan%
      parent Pan%,F_Preview%
      full_space Pan%
      h% = height(Pan%)
      w% = width(Pan%)
      delete Pan%
      
      edit EditTV%
      parent EditTV%,F_Preview%
      hide EditTV%
      on_change EditTV%,change
      
      TV%  = dll_call3("CreateTreeViewEx",handle(F_Preview%),1,adrIlb%)
      res% = dll_call3("SetTreeViewEventReceiver",TV%,1,handle(EditTV%))
      res% = dll_call5("ResizeTreeView",TV%,0,0,w%,h%-IL_h%)
      
      txt$ = file_extract_name$(LibName$)
      res% = dll_call4("AddTreeViewRootNode",TV%,adr(txt$),ico%(2),ico%(2))
      
      for i%=1 to count(MemoFilesList%)
         res% = dll_call3("SelectTreeViewNode",TV%,0,0)
         txt$ = item_read$(MemoFilesList%,i%)
         res% = dll_call4("AddTreeViewChildNode",TV%,adr(txt$),ico%(3),ico%(3))
      next i%
      
      Picture Pict%
      parent Pict%,F_Preview%
      height Pict%,IL_h%
      width Pict%,IL_w%
      top Pict%,h%-IL_h%
      left Pict%,w%-(IL_w%+5)
      
      alpha AlphPict%
      parent AlphPict%,F_Preview%
      top AlphPict%,(h%-IL_h%)+2
      left AlphPict%,10
   end_if
   res% = DLL_call2("WindowTopMost",handle(F_Preview%),1)
end_sub

' ------------------------------------------------------------------------------

clic:
' -> clic sur le combo de choix des dimensions de la librairie
   if number_click = CombLibFormat%
      SelectImageListDim(item_index(CombLibFormat%))
      return
   end_if
' -> clic sur le bouton de création de la librairie
   if number_click = ButCreate%
      inactive ButCreate%
      if item_index(CombLibFormat%)<>0
         FormAttente()
         CreateFilesList()
         if count(MemoFilesList%)>0
            CreateImageList()
            hide F_Attente%
            pause 2000
            FormPreview()
         end_if
      else
         if message_warning_ok("Veuillez sélectionner le format de la librairie !!!")=1
         end_if
      end_if
      return
   end_if
return

change:
   if left$(text$(EditTV%),12)="double_click"
      PreviewPicture()
   end_if
return

close0:
   Quitter()
return

fin:
   terminate
return

' ------------------------------------------------------------------------------

sub AskLibName()
   dim_local r$
   if message_input("Nom de la librairie","Nom : ","")=1
      r$ = message_text$
      if r$<>""
         LibName$      = LibDirectory$+r$+".ilc"
         LibFilesList$ = LibDirectory$+r$+".inf"
      else
         message "Le programme va se fermer."+chr$(13)+"Au revoir..."
         gosub Close0
      end_if
   else
      message "Le programme va se fermer."+chr$(13)+"Au revoir..."
      gosub Close0
   end_if
end_sub

' ------------------------------------------------------------------------------

sub AskDirSource()
   dim_local res%,racine$,dossier$
   racine$  = "C:"
   dossier$ = string$(255," ")
   res% = DLL_call4("FolderSelect",adr(racine$),adr(dossier$),len(dossier$),0)
   dossier$ = trim$(dossier$)
   if dossier$<>""
      LibSource$ = dossier$+""
   else
      message "Le programme va se fermer."+chr$(13)+"Au revoir..."
      gosub close0
   end_if
end_sub

' ------------------------------------------------------------------------------

sub SelectImageListDim(d%)
   dim_local p%
   p% = d%
   select p%
   case 1
      IL_h%=16
      IL_w%=16
   case 2
      IL_h%=24
      IL_w%=24
   case 3
      IL_h%=32
      IL_w%=32
   case 4
      IL_h%=48
      IL_w%=48
   case 5
      IL_h%=64
      IL_w%=64
   case 6
      IL_h%=128
      IL_w%=128
   end_select
end_sub

' ------------------------------------------------------------------------------

sub CreateFilesList()
   dim_local res%,f$,haut%,larg%
   clear MemoFilesList%
   Caption alphFA%,"Etape : 1 / 2 Création de la liste des fichiers"
   dir_change LibSource$
   f$ = file_find_first$
   if instr(f$,".")>2
      if file_extract_extension$(f$)=".bmp"
         res% = dll_call3("AnalyzeImageFile",adr(f$),adr(larg%),adr(haut%))
         if haut%=IL_h% and larg%=IL_w%
            item_add MemoFilesList%,file_extract_name$(f$)
         end_if
      end_if
   end_if
   f$ = file_find_next$
   while f$<>"_"
      if instr(f$,".")>2
         if file_extract_extension$(f$)=".bmp"
            res% = dll_call3("AnalyzeImageFile",adr(f$),adr(larg%),adr(haut%))
            if haut%=IL_h% and larg%=IL_w%
               item_add MemoFilesList%,file_extract_name$(f$)
            end_if
         end_if
      end_if
      f$ = file_find_next$
   end_while
   file_find_close
   dir_change Path$
   position PB%,Position(PB%)+1
end_sub

' ------------------------------------------------------------------------------

sub CreateImageList()
   dim_local res%,cpt%,i%,f$,b$,mes$,ni%,num_ni$,nidel%,sep%
   Caption alphFA%,"Etape : 2 / 2 Création de la l' imagelist"
   if count(MemoFilesList%)>0
      cpt% = count(MemoFilesList%)
      IL% = dll_call2("CreateImageList",IL_w%,IL_h%)
      for i%=1 to cpt%
         f$= LibSource$+item_read$(MemoFilesList%,i%)
         res% = dll_call4("AddImageToImageList",IL%,adr(f$),0,0)
         pause 500
         if res% = -1
            font_color AlphFic%,200,0,0
            b$=b$+f$+chr$(13)
            ni%=ni%+1
            num_ni$ = num_ni$+str$(i%)+";"
         else
            font_color AlphFic%,0,0,200
         end_if
         caption AlphFic%,item_read$(MemoFilesList%,i%)+" ["+str$(res%)+"]"
         display
      next i%
      if ni%>0
         for i%=1 to ni%
            sep%    = instr(num_ni$,";")
            nidel%  = val(left$(num_ni$,sep%-1))
            num_ni$ = right$(num_ni$,len(num_ni$)-sep%)
         next i%
      end_if
   end_if
   position PB%,Position(PB%)+1
   file_save MemoFilesList%,LibFilesList$
   res% = dll_call2("SaveImageList",IL%,adr(LibName$))
   if b$<>""
      mes$ = str$(ni%)+" fichiers n' ont pas pu être intégré à l' ImageList !"
      m%=message_information_ok(mes$)
   end_if
end_sub

' ------------------------------------------------------------------------------

sub PreviewPicture()
   dim_local res%,par$,bmp$,ind%
   par$ = string$(255," ")
   ind% = dll_call3("GetTreeViewInformation",TV%,2,adr(par$))
   par$ = trim$(par$)
   ind% = ind%-1
   res% = dll_call5("ExtractImageFromImageList",IL%,ind%,0,1,0)
   clipboard_paste Pict%
   caption AlphPict%,"("+str$(ind%)+") "+par$
end_sub

' ------------------------------------------------------------------------------

sub Quitter()
   dim_local res%
   res% = dll_call1("KillProcessByHandle",handle(0))
end_sub

* Nécessite KGF.dll
Revenir en haut Aller en bas
Contenu sponsorisé





Mon "ImageList Creator" Empty
MessageSujet: Re: Mon "ImageList Creator"   Mon "ImageList Creator" Empty

Revenir en haut Aller en bas
 
Mon "ImageList Creator"
Revenir en haut 
Page 1 sur 1
 Sujets similaires
-
» My ImageList
» Data Image Creator D.I.C
» Pano Sub Icon Creator

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: