[EXAMPLES]

* NEW: PhotoTouch got a "save all" feature and some bug fixes.


git-svn-id: svn://localhost/gambas/trunk@4676 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
Benoît Minisini 2012-04-25 15:46:48 +00:00
parent c588ee58a2
commit 425137546d
4 changed files with 137 additions and 56 deletions

View file

@ -11,111 +11,167 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: FMain.class:150
#: FMain.class:221
msgid "*"
msgstr "*"
#: FMain.class:221
msgid "/"
msgstr "/"
#: FMain.class:201
msgid "Automatic correction"
msgstr "Correction automatique"
#: FBrightness.form:56 FMain.class:150
#: FMain.class:221
msgid "B"
msgstr "F"
#: FBrightness.form:39 FMain.class:201
msgid "Balance"
msgstr "Balance"
#: FMain.class:150
#: FMain.class:201
msgid "Blur"
msgstr "Flou"
#: FMain.class:150
#: FMain.class:201
msgid "Browse photos"
msgstr "Parcourir les photos"
#: FMain.class:150
#: FMain.class:201
msgid "Crop image"
msgstr "Découper l'image"
#: FScissors.form:19
#: FScissors.form:23
msgid "Cut"
msgstr "Découper"
#: FMain.class:150
#: FMain.class:221
msgid "D"
msgstr "T"
#: FMain.class:201
msgid "Fit to window"
msgstr "Zoom à la taille de l'écran"
#: FMain.class:150
#: FMain.class:201
msgid "Flip horizontally"
msgstr "Retourner horizontalement"
#: FMain.class:150
#: FMain.class:201
msgid "Flip vertically"
msgstr "Retourner verticalement"
#: FMain.class:150
#: FMain.class:221
msgid "H"
msgstr "H"
#: FMain.class:221
msgid "I"
msgstr "I"
#: FMain.class:201
msgid "Invert"
msgstr "Inverser"
#: FMain.class:95
#: FMain.class:221
msgid "M"
msgstr "M"
#: FMain.class:221
msgid "N"
msgstr "E"
#: FMain.class:107
msgid "No image in directory"
msgstr "Aucune image dans ce répertoire"
#: FMain.class:150
#: FMain.class:201
msgid "Normalize"
msgstr "Normaliser"
#: FMain.class:150
#: FMain.class:221
msgid "O"
msgstr "P"
#: FMain.class:201
msgid "Oil painting effect"
msgstr "Effet de peinture à l'huile"
#: FMain.class:150
#: FMain.class:201
msgid "Quit"
msgstr "Quitter"
#: FMain.class:150
#: FMain.class:221
msgid "R"
msgstr "R"
#: FMain.class:201
msgid "Remove speckles"
msgstr "Enlever les tâches"
#: FMain.class:150 FResize.form:40
#: FMain.class:201 FResize.form:40
msgid "Resize"
msgstr "Redimensionner"
#: FMain.class:150
#: FMain.class:201
msgid "Rotate left"
msgstr "Rotation vers la gauche"
#: FMain.class:150
#: FMain.class:201
msgid "Rotate right"
msgstr "Rotation vers la droite"
#: FMain.class:150
#: FMain.class:221
msgid "S"
msgstr "N"
#: FMain.class:201
msgid "Save"
msgstr "Enregistrer"
#: FMain.class:150
#: FMain.class:201
msgid "Save all"
msgstr "Tout enregistrer"
#: FMain.class:201
msgid "Select photo directory"
msgstr "Choisir le répertoire des photographies"
#: FMain.class:150
#: FMain.class:201
msgid "Sharpen"
msgstr "Netteté"
#: FMain.class:201
msgid "Show photo"
msgstr "Afficher la photographie"
#: .project:1
msgid "Simple Photo Editor"
msgstr "Editeur de photographie simplifié"
#: FMain.class:98
#: FMain.class:110
msgid "Unable to load image"
msgstr "Impossible de charger l'image"
#: FMain.class:150
#: FMain.class:201
msgid "Undo all changes"
msgstr "Annuler tous les changements"
#: FMain.class:150
#: FMain.class:221
msgid "V"
msgstr "V"
#: FMain.class:201
msgid "Zoom 100%"
msgstr "Zoom 100%"
#: FMain.class:150
#: FMain.class:201
msgid "Zoom in"
msgstr "Zoom avant"
#: FMain.class:150
#: FMain.class:201
msgid "Zoom out"
msgstr "Zoom arrière"

View file

@ -196,6 +196,7 @@ Public Sub _new()
"balance": ("Balance"),
"resize": ("Resize"),
"save": ("Save"),
"save-all": ("Save all"),
"undo": ("Undo all changes"),
"quit": ("Quit")]
@ -224,7 +225,7 @@ Public Sub _new()
CreateButtons(aButton, cTooltip, panToolbar)
aButton = ["photo", "usb", "-", "hflip#2", "vflip#2", "rotate-left#2", "rotate-right#2", "<->", "save#2", "undo#2", "quit#2"]
aButton = ["photo", "usb", "-", "hflip#2", "vflip#2", "rotate-left#2", "rotate-right#2", "<->", "save#2", "save-all", "undo#2", "quit#2"]
CreateButtons(aButton, cTooltip, panToolbarBrowser)
@ -436,6 +437,17 @@ Private Sub Action(sAction As String)
Dim iPos As Integer
Select Case sAction
Case "usb"
SetMode("")
Dialog.Title = ("Select photo directory")
If Dialog.SelectDirectory() Then Return
End Select
Inc Application.Busy
iPos = RInStr(sAction, "#")
If iPos Then sAction = Left(sAction, iPos - 1)
@ -481,21 +493,16 @@ Private Sub Action(sAction As String)
Me.Close
Case "balance", "scissors", "resize"
If Not $hImage Then Return
'If Not $hImage Then Return
SetMode(sAction)
Case "usb"
SetMode("")
Dialog.Title = ("Select photo directory")
If Dialog.SelectDirectory() Then Return
SetDir(Dialog.Path)
Case "undo"
If Not $hImage Then
Inc Application.Busy
ivwImage.MoveFirst
While ivwImage.Available
If ivwImage.Item.Selected Then
@ -508,19 +515,16 @@ Private Sub Action(sAction As String)
FillImageBrowser(True)
$hImage = Null
Dec Application.Busy
Else
SetMode("")
If $hUndoStack.Count Then
Inc Application.Busy
$hImage = $hUndoStack[$hUndoStack.Max]
$hUndoStack.Remove($hUndoStack.Max)
$bModify = $hUndoStack.Count > 0
If Not $bModify Then RemoveImage
UpdateZoom
Dec Application.Busy
Else
LoadImage(True)
RemoveImage
@ -530,23 +534,15 @@ Private Sub Action(sAction As String)
Case "save"
If Not $hImage Then
If Not $hImage Then
Inc Application.Busy
ivwImage.MoveFirst
While ivwImage.Available
'If ivwImage.Item.Selected Then
$iIndex = CInt(ivwImage.Item.Key)
GetImage
$iIndex = CInt(ivwImage.Key)
$sPath = CACHE_DIR &/ File.Name($aPath[$iIndex])
If Exist($sPath) Then
SaveImageDefinitely
'Endif
ivwImage.MoveNext
Wend
FillImageBrowser(True)
FillImageBrowser(True)
Endif
$hImage = Null
Dec Application.Busy
Else
@ -555,12 +551,25 @@ Private Sub Action(sAction As String)
Endif
Case "save-all"
ivwImage.MoveFirst
While ivwImage.Available
'If ivwImage.Item.Selected Then
$iIndex = CInt(ivwImage.Item.Key)
GetImage
SaveImageDefinitely
'Endif
ivwImage.MoveNext
Wend
FillImageBrowser(True)
$hImage = Null
Case Else
If Not $hImage Then
Inc Application.Busy
ivwImage.MoveFirst
While ivwImage.Available
If ivwImage.Item.Selected Then
@ -584,7 +593,6 @@ Private Sub Action(sAction As String)
FillImageBrowser(True)
$hImage = Null
Dec Application.Busy
Else
@ -605,7 +613,7 @@ Private Sub Action(sAction As String)
$hImage = $hImage.Rotate(Pi(-0.5))
Case "oil"
PushUndo()
$hImage = ImageMagick("-paint 4") '$hImage.OilPaint()
$hImage = ImageMagick("-paint " & CStr(Max(3, Min($hImage.W, $hImage.H) \ 256)))
Case "magic"
PushUndo()
$hImage = ImageMagick("-auto-gamma -auto-level")
@ -637,6 +645,8 @@ Private Sub Action(sAction As String)
End Select
Dec Application.Busy
End
Public Sub svwImage_MouseDown()
@ -787,11 +797,13 @@ End
Public Sub Stretch(W As Integer, H As Integer)
Inc Application.Busy
$hImage = $hImage.Stretch(W, H)
$bModify = True
$hTemp = $hImage
Me.End
SetZoom(0)
Dec Application.Busy
End
@ -947,14 +959,22 @@ Private Sub FillImageBrowser(Optional bNoWait As Boolean)
Dim I As Integer
Dim hImage As Image
Dim sText As String
Dim fLastTime As Float
Dim sKey As String
If $bReloadFilm Then
Inc Application.Busy
fLastTime = Timer
Try Mkdir CACHE_DIR
sKey = ivwImage.Key
ivwImage.Clear
ivwImage.GridSize = 280 \ Desktop.Scale
For I = 0 To $aPath.Max
Try hImage = GetThumb($sDir &/ $aPath[i])
@ -964,12 +984,17 @@ Private Sub FillImageBrowser(Optional bNoWait As Boolean)
Endif
sText = File.Name($aPath[I])
ivwImage.Add(I, sText, hImage.Picture)
If Not bNoWait Then Wait
If (Timer - fLastTime) > 1 Then
fLastTime = Timer
Wait
Endif
Next
Try ivwImage.Key = sKey
Dec Application.Busy
$bReloadFilm = False
Endif
If ivwImage.Count Then

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB