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
» Editeur EliP 6 : Le Tiny éditeur avec 25 onglets de travail
coordonné d'un pixel Emptypar jjn4 Aujourd'hui à 13:06

» PANORAMIC V 1
coordonné d'un pixel Emptypar papydall Aujourd'hui à 01:22

» select intégrés [résolu]
coordonné d'un pixel Emptypar jjn4 Hier à 15:00

» number_mouse_up
coordonné d'un pixel Emptypar jjn4 Hier à 09:59

» Aide de PANORAMIC
coordonné d'un pixel Emptypar jjn4 Hier à 09:16

» trop de fichiers en cours
coordonné d'un pixel Emptypar lepetitmarocain Hier à 08:43

» Je teste PANORAMIC V 1 beta 1
coordonné d'un pixel Emptypar papydall Hier à 02:17

» bouton dans autre form que 0
coordonné d'un pixel Emptypar leclode Lun 06 Mai 2024, 11:59

» KGF_dll - nouvelles versions
coordonné d'un pixel Emptypar Klaus Lun 06 Mai 2024, 09:41

» Gestion d'un système client-serveur.
coordonné d'un pixel Emptypar Klaus Lun 06 Mai 2024, 08:23

» @Jack
coordonné d'un pixel Emptypar Jack Mar 30 Avr 2024, 18:40

» Une calculatrice en une ligne de programme
coordonné d'un pixel Emptypar jean_debord Dim 28 Avr 2024, 06:47

» Form(résolu)
coordonné d'un pixel Emptypar leclode Sam 27 Avr 2024, 15:59

» Bataille navale SM
coordonné d'un pixel Emptypar jjn4 Ven 26 Avr 2024, 15:39

» Les maths du crocodile
coordonné d'un pixel Emptypar jean_debord Jeu 25 Avr 2024, 08:37

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 : -39%
Ordinateur portable ASUS Chromebook Vibe CX34 Flip
Voir le deal
399 €

 

 coordonné d'un pixel

Aller en bas 
3 participants
AuteurMessage
pascal10000

pascal10000


Nombre de messages : 812
Localisation : Troyes
Date d'inscription : 05/02/2011

coordonné d'un pixel Empty
MessageSujet: coordonné d'un pixel   coordonné d'un pixel EmptySam 13 Avr 2013, 12:44

voila mon probleme
je voudrais obtenir la position d'un pixel à une
image de différente dimension
je m'explique!
l'image dont je parle n'as pas tjr le même format
soit elle est rétrécie ou bien agrandie de -30%
à 90% et je voudrait avoir la même coordonnée du
curseur
le système je l'ai! mais le problème c'est que des que j'ouvre
mon bitmap il ne marche pas si je modifie l'échelle tout de suite
par contre si je click a zéro pourcent le système fonctionne

voici le code
Code:
scroll_bar 25
left 25,500:top 25,665
width 25,100:height 25,17
min 25,1:max 25,10
position 25,5
on_change 25,scroll
alpha 26
left 26,450:top 26,665
caption 26,""
end

' =====================================================
'          gamme du retrecissement ou d'agrandissement
'              de l'image
' =====================================================
scroll:
if dessin$=""
 application_title "Information!"
 message "La figure du projet n'est pas apparament ouvert!"
 return
end_if
size3=position(25)
select size3

 case 10:picwidth%=(idwidth%+(idwidth%*(90/100)))
        picheight%=(idheight%+(idheight%*(90/100)))
        pourcen$="+90%":pourcent%=-90

 case 9:picwidth%=(idwidth%+(idwidth%*(70/100)))
        picheight%=(idheight%+(idheight%*(70/100)))
        pourcen$="+70%":pourcent%=-70


 case 8:picwidth%=(idwidth%+(idwidth%*(50/100)))
        picheight%=(idheight%+(idheight%*(50/100)))
        pourcen$="+50%":pourcent%=-50

 case 7:picwidth%=(idwidth%+(idwidth%*(30/100)))
        picheight%=(idheight%+(idheight%*(30/100)))
        pourcen$="+30%":pourcent%=-30


 case 6:picwidth%=idwidth%
        picheight%=idheight%
        pourcen$="00%":pourcent%=0

 case 5:picwidth%=(idwidth%-(idwidth%*(30/100)))
        picheight%=(idheight%-(idheight%*(30/100)))
        pourcen$="-30%":pourcent%=30

 case 4:picwidth%=(idwidth%-(idwidth%*(40/100)))
        picheight%=(idheight%-(idheight%*(40/100)))
        pourcen$="-40%":pourcent%=40

 case 3:picwidth%=(idwidth%-(idwidth%*(50/100)))
        picheight%=(idheight%-(idheight%*(50/100)))
        pourcen$="-50%":pourcent%=50

 case 2:picwidth%=(idwidth%-(idwidth%*(60/100)))
        picheight%=(idheight%-(idheight%*(60/100)))
        pourcen$="-60%":pourcent%=60

 case 1:picwidth%=(idwidth%-(idwidth%*(70/100)))
        picheight%=(idheight%-(idheight%*(70/100)))
        pourcen$="-70%":pourcent%=70


end_select
caption 26,pourcen$
width 3,picwidth%:height 3,picheight%
file_load 3,dessin$
stretch_on 3
return
' =====================================================
' =====================================================
' =====================================================
'                Reperage des coordonnées en X et Y
' =====================================================
pictselect:
 xpos%=xmou%
 ypos%=ymou%
 xmou%=mouse_x_position(3)
 ymou%=mouse_y_position(3)
if pourcent%<>0
 xmou%=xmou%+(xpos%*(pourcent%/100))
 ymou%=ymou%+(ypos%*(pourcent%/100))
end_if
message str$(xmou%)+"==="+str$(ymou%)
return

merci
Revenir en haut Aller en bas
Jicehel

Jicehel


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

coordonné d'un pixel Empty
MessageSujet: Re: coordonné d'un pixel   coordonné d'un pixel EmptySam 13 Avr 2013, 13:28

Désolé, je n'ai pas compris
Revenir en haut Aller en bas
pascal10000

pascal10000


Nombre de messages : 812
Localisation : Troyes
Date d'inscription : 05/02/2011

coordonné d'un pixel Empty
MessageSujet: Re: coordonné d'un pixel   coordonné d'un pixel EmptySam 13 Avr 2013, 13:52

bon plus simlpe

a n'importe quelle échelle du bitmap
dès que je click je doit obtenir les mêmes
résulta de coordonnées c'est a dire
pour une image de 800 pxl de large
a moin 30% l'image fait 238 pxl
à +90% elle fait 1305
donc d'une echelle a l'autre dès que je click
je doit obtenir le même resulta que sa soit
-30 ou jusqu’à +90%

"OK" y a pas + simple
Revenir en haut Aller en bas
JL35




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

coordonné d'un pixel Empty
MessageSujet: Re: coordonné d'un pixel   coordonné d'un pixel EmptySam 13 Avr 2013, 14:47

C'est à toi de recalculer les coordonnées de la souris en fonction du rapport d'agrandissement ou de réduction, la fonction souris elle-même ne peut te donner que les coordonnées physiques, pas logiques.
Revenir en haut Aller en bas
pascal10000

pascal10000


Nombre de messages : 812
Localisation : Troyes
Date d'inscription : 05/02/2011

coordonné d'un pixel Empty
MessageSujet: Re: coordonné d'un pixel   coordonné d'un pixel EmptySam 13 Avr 2013, 15:22

jl35 si tu lis mon source ci-dessus tu remarquera que le calcul
est inclus au label pictselect: mon problème n'est pas là!
mon problème c'est que le code ne marche pas si je change le curseur
de track_bar au démarage du logiciel et j’obtiens n'importe quoi
si je click au niveau 0 au démarrage a partir de là sa marche
pour être précis la formule est à la mauvaise place
je vous donne le source complet en ébauche

Code:
'
if dir_exists("C:\Program Files\VirtualSkinor")=0 then terminate
dir_change "C:\Program Files\VirtualSkinor"

if file_exists("KGF.dll")=1
dll_on "KGF.dll"
else
hide 0
message "Intaller KGF.DLL! elle est Introuvable"
terminate
end_if

error_french

' =====================================================
' =====================================================
open_dialog 4
save_dialog 5
' =====================================================
' =====================================================

dim form1,form2,hdl,KGF_res%,bou%,des_res%,hnd_enfant%,hnd_parent%,flag%

dim  xpos%,xmou%,ypos%,ymou%,width_mou%,height_mou%

dim picwidth%,idwidth%,picheight%,idheight%,pourcent%,size%

dim dessin$,dossier$,pourcen$,projet$,objet,action$

dim lgrid,strin$,type$,line,y

label annul,pictselect,scroll
label ouvrir,sauve,Nouveau,quitté

label type,Logo,Boutton,Slider,Multibutton,Navigation,Textzone,Video
label Grabzone,Panel,Rhythm,Scratch,Dropzone,Songpos,Visual,chan

label Act_slider,Act_bouton,act_Navigation,act_Grabzone,Act_chan
label act_Dropzone

label DimElement,PosElement,selection,optimise,cache


' =====================================================
'        GROUPE DES FENETRES
' =====================================================
left 0,0:top 0,(screen_y-750)/2
width 0,1300:height 0,750
color 0,180,180,180
caption 0,"VirtualSkinor"
font_name 0,arial
font_size 0,8
font_bold 0
wait 20
on_click 0,annul

' =====================================================
' fenêtre inutilisable
' =====================================================
form 1 : width 1,600 : height 1,663
top 1,0 : left 1,0:border_hide 1
color 1,0,0,0
form1(handle(1),handle(0),0)

' =====================================================
' fenêtre d'edition du projet
' =====================================================
form 2
caption 2,"form2":color 2,0,0,255
form2(handle(2),handle(1),0)
caption 2,"VirtualSkinor"
width 2,550:height 2,550
top 2,50
picture 3 :hide 3
width 3,picwidth%:height 3,picheight%
parent 3,2:color 3,0,0,0
cursor_cross 3
on_click 3,pictselect

 bou%= dll_call2("SetCloseBox",handle(2),0)

' =====================================================
'                    Création du menu
' =====================================================
main_menu 10
sub_menu 11:caption 11,"Fichier":parent 11,10
 sub_menu 100:caption 100,"Ouvrir XML/Projet":parent 100,11:on_click 100,ouvrir
 sub_menu 101:caption 101,"Ouvrir BMP/Projet":parent 101,11:on_click 101,ouvrir
 sub_menu 102:caption 102,"Nouveau":parent 102,11:on_click 102,Nouveau
 sub_menu 104:caption 104,"Sauvegarder":parent 104,11:on_click 104,Sauve
 sub_menu 103:caption 103,"-":parent 103,11
 sub_menu 105:caption 105,"Quitter":parent 105,11:on_click 105,quitté
' =====================================================
' =====================================================

command_target_is 0
' =====================================================
'                    LES OUTILS
' =====================================================
container 6
left 6,604:top 6,-8
width 6,405:height 6,670

grid 8:left 8,1010:top 8,8
width 8,265
grid_column 8,2
grid_row_height 8,17:grid_column_width 8,130
grid_fixed_color 8,255,255,255
font_size 8,8
font_bold 8
on_click 8,selection
on_key_down 8,selection
hide 8

combo 27:hide 27
left 27,1143
height 27,10
width 27,132
item_add 27,"Oui"
item_add 27,"Non"
font_size 27,8

combo 7
top 7,5
left 7,1010:width 7,200
item_add 7,"Logo"
item_add 7,"Boutton"
item_add 7,"Slider"
item_add 7,"Multibutton"
item_add 7,"Navigation"
item_add 7,"Grabzone"
item_add 7,"Panel"
item_add 7,"Rhythm"
item_add 7,"Scratch"
item_add 7,"Dropzone"
item_add 7,"Songpos"
item_add 7,"Textzone"
item_add 7,"tooltip"
item_add 7,"Video"
item_add 7,"Visual"
on_click 7,type

button 9
left 9,1210:top 9,4
width 9,66:height 9,23
caption 9,"Optimise"
on_click 9,optimise

' objet 10 et suite pour les menus

memo 20
left 20,803
top 20,3:left 20,607
width 20,400:height 20,656
font_size 20,10
bar_both 20

edit 21:hide 21
left 21,1143
height 21,18
width 21,132

scroll_bar 25
left 25,500:top 25,665
width 25,100:height 25,17
min 25,1:max 25,10
position 25,6
on_change 25,scroll
alpha 26
left 26,450:top 26,665
caption 26,""

' =====================================================
'                    Liste des bouttons
' =====================================================
list 40
left 40,1143:width 40,132
height 40,200
color 40,180,180,180
file_load 40,"resource\boutton.vdj"
on_click 40,Act_bouton
hide 40

' =====================================================
'                    Liste des Slider
' =====================================================
list 41
left 41,1143:width 41,133
height 41,200
color 41,180,180,180
file_load 41,"resource\slider.vdj"
on_click 41,Act_slider
hide 41

list 42
left 42,1143:width 42,133
height 42,110
color 42,180,180,180
item_add 42,"1"
item_add 42,"2"
item_add 42,"Left"
item_add 42,"Rigth"
item_add 42,"Active"
item_add 42,"Default"
item_add 42,"Playlist"
hide 42
on_click 42,chan

 gosub nouveau
end
' =====================================================
'            Creation des fenêtres
' =====================================================
sub form1(hnd_enfant%,hnd_parent%,flag%)
  if variable("SetFormParent%")=0 then dim SetFormParent%
  SetFormParent% = DLL_call3("SetFormParent",hnd_enfant%,hnd_parent%,flag%)
end_sub
sub form2(hnd_enfant%,hnd_parent%,flag%)
  if variable("form2")=0 then dim SetFormParent%
  form2 = DLL_call3("SetFormParent",hnd_enfant%,hnd_parent%,flag%)
end_sub
' =====================================================
' =====================================================

 annul:
strin$=""
' hide 21:hide 52:hide 53
return

Nouveau:
inactive 7
position 25,6
 xmou%=0:ymou%=0:pourcent%=0
clear 20
2d_target_is 3
cls
grid_row 8,8
height 8,150
gosub cache
lgrid=1
grid_clear 8,20,2
show 8
lgrid=lgrid+1
grid_write 8,lgrid,1,"Skin Projet:"
lgrid=lgrid+1
grid_write 8,lgrid,1,"Nom:"
lgrid=lgrid+1
grid_write 8,lgrid,1,"Auteur:"
lgrid=lgrid+1
grid_write 8,lgrid,1,"Version:"
lgrid=lgrid+1
grid_write 8,lgrid,1,"Largeur:"
lgrid=lgrid+1
grid_write 8,lgrid,1,"Hauteur:"
lgrid=lgrid+1
grid_write 8,lgrid,1,"Date:"
return

' =====================================================
'          gamme du retrecissement ou d'agrandissement
'              de l'image
' =====================================================
scroll:
if dessin$=""
 application_title "Information!"
 message "La figure du projet n'est pas apparament ouvert!"
 return
end_if
size%=position(25)
 if size%=10
 pourcen$="+90%":pourcent%=-90
 picwidth%=(idwidth%+(idwidth%*(90/100)))
 picheight%=(idheight%+(idheight%*(90/100)))
 end_if
 
 if size%=9
 pourcen$="+70%":pourcent%=-70
 picwidth%=(idwidth%+(idwidth%*(70/100)))
 picheight%=(idheight%+(idheight%*(70/100)))
end_if

 if size%=8
 pourcen$="+50%":pourcent%=-50
 picwidth%=(idwidth%+(idwidth%*(50/100)))
 picheight%=(idheight%+(idheight%*(50/100)))
end_if

 if size%=7
 pourcen$="+30%":pourcent%=-30
 picwidth%=(idwidth%+(idwidth%*(30/100)))
 picheight%=(idheight%+(idheight%*(30/100)))
end_if

  if size%=6
  pourcen$="00%":pourcent%=0
  picwidth%=idwidth%
  picheight%=idheight%
end_if

  if size%=5
  pourcen$="-30%":pourcent%=30
  picwidth%=(idwidth%-(idwidth%*(30/100)))
  picheight%=(idheight%-(idheight%*(30/100)))
end_if

 if size%=4
 pourcen$="-40%":pourcent%=40
 picwidth%=(idwidth%-(idwidth%*(40/100)))
 picheight%=(idheight%-(idheight%*(40/100)))
end_if

 if size%=3
 pourcen$="-50%":pourcent%=50
 picwidth%=(idwidth%-(idwidth%*(50/100)))
 picheight%=(idheight%-(idheight%*(50/100)))
end_if

 if size%=2
 pourcen$="-60%":pourcent%=60
 picwidth%=(idwidth%-(idwidth%*(60/100)))
 picheight%=(idheight%-(idheight%*(60/100)))
end_if

 if size%=1
 pourcen$="-70%":pourcent%=70
 picwidth%=(idwidth%-(idwidth%*(70/100)))
 picheight%=(idheight%-(idheight%*(70/100)))
end_if
 gosub pictselect

caption 26,str$(size%)+" / "+pourcen$
width 3,picwidth%:height 3,picheight%
file_load 3,dessin$
stretch_on 3
return

' =====================================================
' =====================================================

' =====================================================
'                Reperage des coordonnées en X et Y
' =====================================================
pictselect:
if mouse_left_down(3)=1
 xmou%=mouse_x_position(3)
 ymou%=mouse_y_position(3)
 xmou%=xmou%+(xpos%*(pourcent%/100))
 ymou%=ymou%+(ypos%*(pourcent%/100))
message str$(xmou%)+"==="+str$(ymou%)
end_if
return
' =====================================================
' =====================================================

' =====================================================
'            Type t'outil a choisir
' =====================================================
type:
objet=item_index(7)
select objet
  case 1:goto Logo
  case 2:goto Boutton
  case 3:goto Slider
  case 4:goto Multibutton
  case 5:goto Navigation
  case 6:goto Grabzone
  case 7:goto Panel
  case 8:goto Rhythm
  case 9:goto Scratch
  case 10:goto Dropzone
  case 11:goto Songpos
  case 12:goto Textzone
  case 13:goto Video
  case 14:goto Visual
end_select
return

selection:
strin$=text$(21)
if len(strin$)>0 then grid_write 8,line,2,strin$
line=grid_y_to_row(8,mouse_y_position(8))
y=(18*(line))-9
hide 21

type$=grid_read$(8,line,1)
if type$="Valeur:" then show 21
if type$="X:" then show 21
if type$="Y:" then show 21
if type$="Largeur:" then show 21
if type$="Hauteur:" then show 21
if type$="Id:" then show 21
if type$="Groupe:" then show 21

if type$="Action:" or type$="ClickDroit:" or type$="ClickGauche:" or type$="DoubleClick:"
  off_click 8
 if text$(7)="Boutton"
  strin$=""
  grid_write 8,line,2,""
  show 40
  else
  hide 40
 end_if

if text$(7)="Slider"
  strin$=""
  grid_write 8,line,2,""
  show 41
  else
  hide 41
end_if
end_if
if type$="chan:"
  strin$=""
  grid_write 8,line,2,""
  show 42
  else
  hide 42
end_if

if hide(21)=0 then set_focus 21:top 21,y
if hide(40)=0 then set_focus 40:top 40,y
if hide(41)=0 then set_focus 41:top 41,y
if hide(42)=0 then set_focus 42:top 42,y


text 21,grid_read$(8,line,2)
return

Logo:
grid_row 8,7
height 8,130
gosub cache
lgrid=1
grid_clear 8,20,2
show 8
gosub PosElement
gosub DimElement
return

' =====================================================
' ======================== BOUTTON ====================
Boutton:
grid_row 8,16
height 8,293
gosub cache
lgrid=1
grid_clear 8,20,2
show 8
lgrid=lgrid+1
grid_write 8,lgrid,1,"- - - -Parametre:- - - -"
lgrid=lgrid+1
grid_write 8,lgrid,1,"Action:"
lgrid=lgrid+1
grid_write 8,lgrid,1,"chan:"
lgrid=lgrid+1
grid_write 8,lgrid,1,"Valeur:"
lgrid=lgrid+1
grid_write 8,lgrid,1,"ClickDroit:"
lgrid=lgrid+1
grid_write 8,lgrid,1,"ClickGauche:"
lgrid=lgrid+1
grid_write 8,lgrid,1,"DoubleClick:"
lgrid=lgrid+1
grid_write 8,lgrid,1,"- - - -Position:- - - -"
gosub PosElement
gosub DimElement
return
Act_bouton:
strin$=item_read$(40,item_index(40))
if len(strin$)>0 then grid_write 8,line,2,strin$
hide 40
on_click 8,selection
return
' =====================================================
' ================chan ou cannal=======================

chan:
strin$=item_read$(42,item_index(42))
if len(strin$)>0 then grid_write 8,line,2,strin$
hide 42
return
Act_chan:
strin$=item_read$(42,item_index(42))
if len(strin$)>0 then grid_write 8,line,2,strin$
hide 42
on_click 8,selection
return
' =====================================================
' ======================= SLIDERS =====================

Slider:
grid_row 8,12
height 8,419
gosub cache
lgrid=1
grid_clear 8,20,2
show 8
lgrid=lgrid+1
grid_write 8,lgrid,1,"- - - -Parametre:- - - -"
lgrid=lgrid+1
grid_write 8,lgrid,1,"Action:"
lgrid=lgrid+1
grid_write 8,lgrid,1,"chan:"
lgrid=lgrid+1
grid_write 8,lgrid,1,"Valeur:"
lgrid=lgrid+1
grid_write 8,lgrid,1,"- - - -Position:- - - -"
gosub PosElement
gosub DimElement
return
Act_slider:
strin$=item_read$(41,item_index(41))
if len(strin$)>0 then grid_write 8,line,2,strin$
hide 41
on_click 8,selection
return
' =====================================================
' =====================================================

Multibutton:
return

' =====================================================
' ===================Navigation========================
Navigation:
' Browser
grid_row 8,8
height 8,150
gosub cache
lgrid=1
grid_clear 8,20,2
show 8
lgrid=lgrid+1
grid_write 8,lgrid,1,"- - - -Position:- - - -"
gosub PosElement
gosub DimElement
return
act_Navigation:
strin$=item_read$(41,item_index(41))
if len(strin$)>0 then grid_write 8,line,2,strin$
hide 41
on_click 8,selection
return
' =====================================================
' ==================Grabzone===========================

Grabzone:
grid_row 8,9
height 8,165
gosub cache
lgrid=1
grid_clear 8,20,2
show 8
lgrid=lgrid+1
grid_write 8,lgrid,1,"chan:"
lgrid=lgrid+1
grid_write 8,lgrid,1,"- - - -Position:- - - -"
gosub PosElement
gosub DimElement
return
act_Grabzone:
strin$=item_read$(42,item_index(42))
if len(strin$)>0 then grid_write 8,line,2,strin$
hide 42
on_click 8,selection
return
' =====================================================
' ===================Dropzone==========================

Dropzone:
grid_row 8,9
height 8,165
gosub cache
lgrid=1
grid_clear 8,20,2
show 8
lgrid=lgrid+1
grid_write 8,lgrid,1,"chan:"
lgrid=lgrid+1
grid_write 8,lgrid,1,"- - - -Position:- - - -"
gosub PosElement
gosub DimElement
return
act_Dropzone:
strin$=item_read$(42,item_index(42))
if len(strin$)>0 then grid_write 8,line,2,strin$
hide 42
on_click 8,selection
return
' =====================================================
' =======================Panel=========================

Panel:
grid_row 8,13
height 8,205
gosub cache
lgrid=1
grid_clear 8,20,2
show 8
lgrid=lgrid+1
grid_write 8,lgrid,1,"- - - -Parametre:- - - -"
lgrid=lgrid+1
grid_write 8,lgrid,1,"Visible:":show 27:top 27,25
lgrid=lgrid+1
grid_write 8,lgrid,1,"Id:"
lgrid=lgrid+1
grid_write 8,lgrid,1,"Groupe:"
lgrid=lgrid+1
grid_write 8,lgrid,1,"- - - -Position:- - - -"
gosub PosElement
gosub DimElement
return
return
' =====================================================
' =====================Rhythm==========================


Rhythm:

return
' =====================================================
' =====================================================


Scratch:

return


Songpos:

return

Textzone:

return

Video:

return

Visual:

return


cache:

return

optimise:
strin$=text$(21)
if len(strin$)>0 then grid_write 8,line,2,strin$
hide 21
return

' =====================================================
' =====================================================
DimElement:
lgrid=lgrid+1
grid_write 8,lgrid,1,string$(10," ")+"Gandeur:"
lgrid=lgrid+1
grid_write 8,lgrid,1,"Largeur:"
lgrid=lgrid+1
grid_write 8,lgrid,1,"Hauteur:"
return

PosElement:
lgrid=lgrid+1
grid_write 8,lgrid,1,string$(10," ")+"Position:"
lgrid=lgrid+1
grid_write 8,lgrid,1,"X:"
lgrid=lgrid+1
grid_write 8,lgrid,1,"Y:"
return

' =====================================================
'          ouvrir le projet XML et BMP & nouveau
' =====================================================

ouvrir:
if clicked(100)=1
filter 4,"Projet Virtual DJ|*.xml*"
' dossier par defaut

projet$=file_name$(4)
clear 20
' si aucun choix n'est fait alors retourne
if projet$="_" then return
' retien le non du dossier
dossier$=dir_current$
' retien le non du du projet xml
projet$=file_extract_name$(projet$)
' si c'est le bon fichier qu il faut alors on continu
if file_extract_extension$(projet$)=".xml" then file_load 20,projet$
' enregistre le nom projet dans dessin
dessin$=left$(projet$,instr(projet$,"."))+"bmp"
' enregistre ses dimention
des_res% = dll_call3("AnalyzeImageFile",adr(dessin$),adr(picwidth%),adr(picheight%))
idwidth%=picwidth%
idheight%=picheight%
' information des position des pictures
file_load 3,dessin$
show 3
width 3,picwidth%:height 3,picheight%

xmou%=0:ymou%=0
xpos%=0:ypos%=0
position 25,6
 caption 2,""
 caption 2,"Figurine: "+dessin$+"  "+str$(picwidth%)+"X"+str$(picheight%)
 caption 26,"00%"
end_if
' =====================================================
' =====================================================


' =====================================================
'                ouvrir le Bitmap
' =====================================================
if clicked(101)=1
clear 20:' gosub Nouveau
filter 4,"Figure Virtual DJ|*.bmp*"
' dossier par defaut

dessin$=file_name$(4)
' si aucun choix n'est fait alors retourne
if dessin$="_" then return
' retien le non du dossier
dossier$=dir_current$
' retien le non du du projet bmp
dessin$=file_extract_name$(dessin$)
' enregistre ses dimention
des_res% = dll_call3("AnalyzeImageFile",adr(dessin$),adr(picwidth%),adr(picheight%))
idwidth%=picwidth%
idheight%=picheight%
width 3,picwidth%:height 3,picheight%
show 3
2d_target_is 3
2d_clear
file_load 3,dessin$
end_if
 caption 2,"Figurine: "+dessin$+"  "+str$(picwidth%)+"X"+str$(picheight%)

position 25,6
xmou%=0:ymou%=0
xpos%=0:ypos%=0
 caption 2,""
 caption 2,"Figurine: "+dessin$+"  "+str$(picwidth%)+"X"+str$(picheight%)
return
' =====================================================
' =====================================================


sauve:

return
' =====================================================
' =====================================================

quitté:
dll_off
terminate

a partir de la vous allez peut etre comprendre
si vous testez le code
attention ce n'est qu'une ebauche
Revenir en haut Aller en bas
Jicehel

Jicehel


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

coordonné d'un pixel Empty
MessageSujet: Re: coordonné d'un pixel   coordonné d'un pixel EmptySam 13 Avr 2013, 15:36

En effet, là j'ai compris.
Comme dis JL35, tu as les coordonnées de la souris qui sont par rapport à ton objet.
Si ce que tu veux c'est la position dans l'image, tu récupères la position de ta souris dans ton objet et tu lui appliques le taux de réduction
C'est je pense ce que tu as essayé de faire mais ta formule n'est pas bonne essayes plutôt celle là:
Code:
pictselect:
xmou%=mouse_x_position(3)*((100+pourcent%)/100)
ymou%=mouse_y_position(3)*((100+pourcent%)/100)
message str$(xmou%)+"==="+str$(ymou%)
return
Revenir en haut Aller en bas
Jicehel

Jicehel


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

coordonné d'un pixel Empty
MessageSujet: Re: coordonné d'un pixel   coordonné d'un pixel EmptySam 13 Avr 2013, 15:38

En effet ton pourcent% correspond à la différence de % par rapport à la taille normale (100%)
Revenir en haut Aller en bas
pascal10000

pascal10000


Nombre de messages : 812
Localisation : Troyes
Date d'inscription : 05/02/2011

coordonné d'un pixel Empty
MessageSujet: Re: coordonné d'un pixel   coordonné d'un pixel EmptySam 13 Avr 2013, 15:45

gicehel ta formule a une erreur de cent d’unités (env) par rapport
aux dimensions originales et de plus cela ne résout pas mon problème
Revenir en haut Aller en bas
Jicehel

Jicehel


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

coordonné d'un pixel Empty
MessageSujet: Re: coordonné d'un pixel   coordonné d'un pixel EmptySam 13 Avr 2013, 17:46

Tu devrais utiliser un vrai pourcentage dans tes calculs, tu te faciliterais la vie.
En fait, tu as un décalage de 100 environ par rapport à quoi exactement ? Par rapport au bord de l'écran ? Par rapport à ton image ?

Perso, au début je n'avais qu'un bout de ton programme et je me suis fais un programme de test que je te mets.
Pour moi, ça marche (si je clic au même endroit sur l'image, j'ai le même résultat)

Code:
label scroll,pictselect
dim dessin$,size3,picwidth%,idwidth%,picheight%,idheight%,pourcen$,pourcent
dim xmou%,ymou%
height 0,740 : WIDTH 0,650
dessin$="test.jpg"
idwidth%=200 : idheight%=400 : pourcent=1
picture 3 : width 3,idwidth% : height 3,idheight%
stretch_on 3 : file_load 3,dessin$ : on_click 3, pictselect

scroll_bar 25 : left 25,500 : top 25,665 : width 25,100:height 25,17
min 25,1:max 25,10 : position 25,6 : on_change 25,scroll

alpha 26 : left 26,450:top 26,665: caption 26,""
end

' =====================================================
'          gamme du retrecissement ou d'agrandissement
'              de l'image
' =====================================================
scroll:
if dessin$=""
 application_title "Information!"
 message "La figure du projet n'est pas apparament ouvert!"
 return
end_if
size3=position(25)
select size3
 case 10: pourcen$="+90%":pourcent=1.9
 case 9 : pourcen$="+70%":pourcent=1.7
 case 8 : pourcen$="+50%":pourcent=1.5
 case 7 : pourcen$="+30%":pourcent=1.3
 case 6 : pourcen$="" : pourcent=1
 case 5 : pourcen$="-30%":pourcent=0.7
 case 4 : pourcen$="-40%":pourcent=0.6
 case 3 : pourcen$="-50%":pourcent=0.5
 case 2:  pourcen$="-60%":pourcent=0.4
 case 1:  pourcen$="-70%":pourcent=0.3
end_select
picwidth%=idwidth%*pourcent : picheight%=idheight%*pourcent
caption 26,pourcen$

width 3,picwidth% : height 3,picheight%
file_load 3,dessin$ : stretch_on 3
return

' =====================================================
'                Reperage des coordonnées en X et Y
' =====================================================
pictselect:
xmou%=mouse_x_position(3)/ pourcent
ymou%=mouse_y_position(3)/ pourcent
message str$(xmou%)+"==="+str$(ymou%)
return
Revenir en haut Aller en bas
pascal10000

pascal10000


Nombre de messages : 812
Localisation : Troyes
Date d'inscription : 05/02/2011

coordonné d'un pixel Empty
MessageSujet: Re: coordonné d'un pixel   coordonné d'un pixel EmptySam 13 Avr 2013, 18:51

jicehel
pour ta question oui sur l'ensemble
ton code fonctionne comme je voulais
mais là les coordonnés ne corresponde pas
pour une image avec 1024 pxl en width il me donne 199
a n'importe quelle échelle
au bord droit!c'est le meilleur endroit pour faire un controle!
Revenir en haut Aller en bas
Jicehel

Jicehel


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

coordonné d'un pixel Empty
MessageSujet: Re: coordonné d'un pixel   coordonné d'un pixel EmptySam 13 Avr 2013, 19:19

ok, je comprends ton problème, je pense:
Tu veux la position par rapport à la taille réelle. Pour cela, c'est simple. Il faut que idwidth% corresponde à la vrai largeur de ton image quand tu est à 100%. Donc idwidth%=1024 initialement pour un pourcent=100 => tu aura 1024 en cliquant à droite.
Si tu doit absolument réduire ton image, il faut adapter le pourcentage de réduction en hauteur ou en largeur (là dans ton programme, on part du principe qu'ils sont réduit de manière proportionnelle pour le moment, mais ils pourraient également être indépendants

Donc solution la plus simple:
1/ définir la taille de ton image
2/ adapter idwidth et idheight à ces dimension pour un pourcentage de 100%

et là tu devrais avoir ce que tu veux
Revenir en haut Aller en bas
Invité
Invité




coordonné d'un pixel Empty
MessageSujet: Re: coordonné d'un pixel   coordonné d'un pixel EmptySam 13 Avr 2013, 21:31

Bonsoir. Il m'est impossible de rentrer dans les codes. Trop pris. Mais est-ce une image qui déborde de l'écran? C'est à dire: est que l'écran est relatif?. Dans ce cas, la position de mouse_x_position() n'est pas correct.
Regarde le sujet suivant:
https://panoramic.1fr1.net/t2634-probleme-position-curseur-sur-l-ascenseur.
Revenir en haut Aller en bas
pascal10000

pascal10000


Nombre de messages : 812
Localisation : Troyes
Date d'inscription : 05/02/2011

coordonné d'un pixel Empty
MessageSujet: Re: coordonné d'un pixel   coordonné d'un pixel EmptySam 13 Avr 2013, 22:11

cosmos70 & jicehel
c 'est bon j'ai trouver la formule au cas ou sa peut servir
ex:
pour agrandir 90%
picwidth%=largeur réel du format de l'image
picwidth%=idwidth
picwidth%=(idwidth%+(idwidth%*(90/100)))

les coordonnés a la souris
Xpourcent%=0-(idwidth%*(90/100))
xmou%=mouse_x_position(3)+Xpourcent%

pour la hauteur
sont les même formule mais changer
les nom des variables

en espérant que je n'ai pas fait de faute
Revenir en haut Aller en bas
Contenu sponsorisé





coordonné d'un pixel Empty
MessageSujet: Re: coordonné d'un pixel   coordonné d'un pixel Empty

Revenir en haut Aller en bas
 
coordonné d'un pixel
Revenir en haut 
Page 1 sur 1
 Sujets similaires
-
» Pixel en 2D
» Récupérer la couleur d'un pixel
» screen_x > 2000 Pixel
» Detecter la couleur d'un pixel sur l'écran
» Pick.dll : Coordonnée souris + Couleur d'un pixel

Permission de ce forum:Vous ne pouvez pas répondre aux sujets dans ce forum
FORUM DE DISCUSSION SUR LE LANGAGE PANORAMIC :: PANORAMIC :: A l'aide!-
Sauter vers: