Results 1 to 2 of 2

Thread: batch process...???

  1. #1

    Thread Starter
    Addicted Member thekurbster's Avatar
    Join Date
    Mar 2006
    Posts
    173

    batch process...???

    here's what it looks like so far ...



    now I would like to have the button "add text to all" tell the program to open the folder on the left and apply the text to all the jpgs in there. But how?

    here's the code i got so far...
    VB Code:
    1. Private Sub Command1_Click()
    2.  
    3.     On Error GoTo CloseMe
    4.     CommonDialog1.CancelError = True
    5.     CommonDialog1.Filter = "jpg Files|*.jpg|All Files|*.*"
    6.     CommonDialog1.ShowOpen
    7.  
    8.    Image1.Picture = LoadPicture(CommonDialog1.FileName)
    9.  
    10. CloseMe:
    11.     Exit Sub
    12. End Sub
    13.  
    14. Private Sub Command2_Click()
    15.  
    16. With Picture1
    17.      Picture1.ScaleMode = 3
    18.     .FontName = "MS Sans Serif"
    19.     .ForeColor = vbWhite
    20.     .FontSize = 25
    21.     .AutoRedraw = True
    22.    
    23.     .Cls
    24.    
    25.     .PaintPicture Image1.Picture, 0, 0
    26.    
    27.    
    28.      
    29.   Picture1.CurrentX = Slider1.Value * 5
    30.   Picture1.CurrentY = Slider2.Value * 5
    31.   Picture1.Print text1.Text
    32.  
    33.  
    34.   End With
    35.  
    36. End Sub
    37.  
    38. Private Sub Slider1_Click()
    39. Command2_Click
    40. End Sub
    41. Private Sub Slider2_Click()
    42. Command2_Click
    43. End Sub

    Please add a sample script since i'm a newbie

  2. #2

    Thread Starter
    Addicted Member thekurbster's Avatar
    Join Date
    Mar 2006
    Posts
    173

    Exclamation Re: batch process...???

    ok i got this much and it works good, except one problem, when it reaches like 2,000 pictures complete it freezes, maybe something to do with memory? here's my code...

    VB Code:
    1. On Error Resume Next
    2. Dim a
    3. Dim b
    4. Dim CurStr$, CurPath$, NewStr$
    5.  
    6.  Set FindIt = New Class1
    7.     ret = FindIt.Search(File1.Path, "*.jpg")
    8.     'CurPath$ = ret(a)
    9.     If ret(0) = 0 Then
    10.         MsgBox "No Jpg's files found in specified folder or sub folders."
    11.         Exit Sub
    12.       End If
    13.         'a = File1.FileName
    14.        
    15.           For a = 1 To ret(0)
    16.           b = ret(a)
    17.           Label7.Caption = "Processing file " & a & " of " & ret(0)
    18.          DoEvents
    19.           Image2.Picture = LoadPicture(b)
    20.           Command1_Click
    21.           Picture1.Picture = Picture1.Image
    22.          SavePicture Picture1.Picture, "c:\temp\" & Text2.text & a & ".jpg"
    23.        
    24.  
    25.       Next a
    26.    
    27. End Sub

    please if there's a way to write it better let me know. thank you

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width