Français
Source/ Codesnippets

Anzeigegröße Bildgröße Proportional vérifier Umrechnen

 

Michael
Dell
sommes CX > MaxX et/ou bien CY > MaxY ensuite wird Proportional
sur Monitorgröße umgerechnet! (XProfan10)

Proc gCkSize

    Paramètres gCS_CX&,gCS_CY&,gCS_MaxX&,gCS_MaxY&
    Déclarer gCS_EX&,gCS_EY&
    Claire gCS_EX&,gCS_EY&
    gCS_EX& = gCS_CX&
    gCS_EY& = gCS_CY&

    Si (gCS_CY& > gCS_MaxY&)

        gCS_EY& = gCS_MaxY&
        gCS_EX& = (gCS_CX& * (gCS_EY& / gCS_CY&))

    EndIf

    Si (gCS_EX& > gCS_MaxX&)

        gCS_EX& = gCS_MaxX&
        gCS_EY& = (gCS_EY& * (gCS_EX& / gCS_CX&))

    EndIf

    Gl_CX& = gCS_EX&
    Gl_CY& = gCS_EY&
    Retour 0

ENDPROC

Demo:
Déclarer Gl_CX&,Gl_CY&

Proc ChkDat

    Paramètres CD_dName$
    CD_dName$ = Upper$(CD_dName$)
    Casenote FileExists(CD_dName$): Retour 0
    Cas InStr(".BMP",CD_dName$) : Retour 1
    Cas InStr(".GIF",CD_dName$) : Retour 1
    Cas InStr(".JPG",CD_dName$) : Retour 1
    Cas InStr(".JPEG",CD_dName$): Retour 1
    Cas InStr(".PNG",CD_dName$) : Retour 1   ab XProfan11
    Retour 0

ENDPROC

Proc DelPHndl

    Paramètres DO_PHndl&
    Cas DO_PHndl&: DeleteObject DO_PHndl&
    Retour 0

ENDPROC

Proc cPic

    Paramètres cP_PHndl&,cP_dNr&
    Déclarer cP_Name$
    cP_Name$ = ListBoxItem$(cP_dNr&)

    Si ChkDat(cP_Name$)

        cP_PHndl&  = DelPHndl(cP_PHndl&)
        cP_PHndl&  = Créer("HPic",-1,cP_Name$)
        gCkSize(%BmpX,%BmpY,%MaxX,%MaxY)      sommes %BmpX > %MaxX et/ou bien %BmpY > %MaxY ensuite Proportional
        sur Monitorgröße umrechnen!
        DrawSizedPic cP_PHndl&,0,0-Gl_CX&,Gl_CY&;0

    D'autre

        Retour 0

    EndIf

    Retour cP_PHndl&

ENDPROC

Proc gCkSize

    Paramètres gCS_CX&,gCS_CY&,gCS_MaxX&,gCS_MaxY&
    Déclarer gCS_EX&,gCS_EY&
    Claire gCS_EX&,gCS_EY&
    gCS_EX& = gCS_CX&
    gCS_EY& = gCS_CY&

    Si (gCS_CY& > gCS_MaxY&)

        gCS_EY& = gCS_MaxY&
        gCS_EX& = (gCS_CX& * (gCS_EY& / gCS_CY&))

    EndIf

    Si (gCS_EX& > gCS_MaxX&)

        gCS_EX& = gCS_MaxX&
        gCS_EY& = (gCS_EY& * (gCS_EX& / gCS_CX&))

    EndIf

    Gl_CX& = gCS_EX&
    Gl_CY& = gCS_EY&
    Retour 0

ENDPROC

Déclarer Gl_PHndl&,Gl_dName$,Gl_PMaxNr&,Gl_Zaehler&
Couleur du texte RGB(255,255,255),0
Fenêtre Style $F0
Fenêtre 0,0-%MaxX,%MaxY
ShowCursor 0
Cls 0
Couleur du texte RGB(255,255,255),0
ClearList
AddFiles *"*.BMP"
AddFiles *"*.GIF"
AddFiles *"*.JPG"
AddFiles *"*.PNG"   ab XProfan11
Gl_PMaxNr& = %GetCount
Cas (Gl_PMaxNr& = -1): Fin
Def CckVGK(1) Si((&(1) > Gl_PMaxNr&),0,Si((&(1) < 0),Gl_PMaxNr&,&(1)))
Gl_PHndl&   = cPic(Gl_PHndl&,0)
Gl_Zaehler& = 0
Gl_PHndl& = cPic(Gl_PHndl&,Gl_Zaehler&)

Tandis que 1: WaitInput : Cls 0

    Cas (IsKey(27) | IsKey(69) | IsKey(101) | IsKey(4)): Pause

    Si (IsKey(34) | IsKey(37) | IsKey(40) | IsKey(2))

        Décembre Gl_Zaehler&

    D'autre

        Inc Gl_Zaehler&

    EndIf

    Gl_Zaehler& = CckVGK(Gl_Zaehler&)
    Gl_PHndl& = cPic(Gl_PHndl&,Gl_Zaehler&)

Endwhile

ShowCursor 1
ClearList
DelPHndl(Gl_PHndl&)
Fin
allez avec Créer("hSizedPic",...) einfacher mais on voit ici wies allez.
 
Salu Michael...

Hab zwar krumme Fieß awer dofir e' ecklich Gsicht! 
04.08.2008  
 



Zum Quelltext


Topictitle, max. 100 marque.
 

Systemprofile:

ne...aucune Systemprofil angelegt. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

s'il te plaît s'inscrire um une Beitrag trop verfassen.
 

Options du sujet

7.130 Views

Untitledvor 0 min.
Michael Hettner02.05.2022
Jörg Sellmeyer28.05.2020
GDL12.09.2015
Dieter Zornow18.11.2011
plus...

Themeninformationen

cet Thema hat 1 participant:

Michael Dell (1x)


Admins  |  AGB  |  Applications  |  Auteurs  |  Chat  |  protection des données  |  Télécharger  |  Entrance  |  Aider  |  Merchantportal  |  Empreinte  |  Mart  |  Interfaces  |  SDK  |  Services  |  Jeux  |  cherche  |  Support

un projet aller XProfaner, qui il y a!


Mon XProfan
Privé Nouvelles
Eigenes Ablageforum
Sujets-La liste de voeux
Eigene Posts
Eigene Sujets
Zwischenablage
Annuler
 Deutsch English Français Español Italia
Traductions

protection des données


Wir verwenden Cookies seulement comme Session-Cookies à cause de qui technischen Notwendigkeit et chez uns gibt es aucun Cookies de Drittanbietern.

si du ici sur unsere Webseite klickst ou bien navigierst, stimmst du unserer Erfassung de Informationen dans unseren Cookies sur XProfan.Net trop.

Weitere Informationen trop unseren Cookies et en supplément, comment du qui Kontrolle par-dessus behältst, findest du dans unserer nachfolgenden Datenschutzerklärung.


d'accordDatenschutzerklärung
je voudrais keinen Cookie