help with image manipulation


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 6 of 6

Thread: help with image manipulation

  1. #1
    Join Date
    Apr 2009
    Posts
    4

    Exclamation help with image manipulation

    i need some help with image refresh..
    1.i load a picture from a url
    -the picture from url is changed every 5 second by the website admin
    i need that my program to refresh the loaded image every 5 sec.
    this is the code but i think the image is loaded in "temp" and the refresh not work...or i have made wrong something..?
    (add a picture box and two timers to bellow code'

    Code:
    Private Type TGUID
        Data1 As Long
        Data2 As Integer
        Data3 As Integer
        Data4(0 To 7) As Byte
    End Type
    Private Declare Function OleLoadPicturePath Lib "oleaut32.dll" (ByVal szURLorPath As Long, ByVal punkCaller As Long, ByVal dwReserved As Long, ByVal clrReserved As OLE_COLOR, ByRef riid As TGUID, ByRef ppvRet As IPicture) As Long
    '----------------------------------------------------------'
    Public Function LoadPicture(ByVal strFileName As String) As Picture
    Dim IID  As TGUID
        With IID
            .Data1 = &H7BF80980
            .Data2 = &HBF32
            .Data3 = &H101A
            .Data4(0) = &H8B
            .Data4(1) = &HBB
            .Data4(2) = &H0
            .Data4(3) = &HAA
            .Data4(4) = &H0
            .Data4(5) = &H30
            .Data4(6) = &HC
            .Data4(7) = &HAB
        End With
    
        OleLoadPicturePath StrPtr(strFileName), 0&, 0&, 0&, IID, LoadPicture
      
    End Function
    
    '----------------------------------------------------'
    
    Private Sub Form_Load()
    
     Timer1.Interval = 2000
      Timer2.Interval = 4000
    End Sub
    
    '------------------------------------------------------'
    
    Public Function LoadPicture2(ByVal strFileName As String) As Picture
    Dim IID  As TGUID
        With IID
            .Data1 = &H7BF80980
            .Data2 = &HBF32
            .Data3 = &H101A
            .Data4(0) = &H8B
            .Data4(1) = &HBB
            .Data4(2) = &H0
            .Data4(3) = &HAA
            .Data4(4) = &H0
            .Data4(5) = &H30
            .Data4(6) = &HC
            .Data4(7) = &HAB
        End With
    
        OleLoadPicturePath StrPtr(strFileName), 0&, 0&, 0&, IID, LoadPicture2
      
    End Function
    
    '----------------------------------------------------------'
    'I try to refresh with timers, no result :( '
    
    Private Sub Timer1_Timer()
     Picture1.Picture = LoadPicture("http://CHANGEDIMAGE-ON-5SEC/mini.jpg")
    
    End Sub
    '--------------------------------------------------------------'
    Private Sub Timer2_Timer()
    Picture1.Picture = Nothing
    End Sub

  2. #2
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    The first time should be sufficient to change images.
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

  3. #3
    Join Date
    Apr 2009
    Posts
    4
    Quote Originally Posted by Hack View Post
    The first time should be sufficient to change images.
    the interval doesn't matter if i put 2000,7000 or 10000 the results are the same.
    I need a method to refresh that picture in apropiate time with the website one.
    maybe isn't possible with oleaut32 .....
    Last edited by johndo; 04-09-2009 at 09:36 AM.

  4. #4
    Join Date
    Apr 2009
    Posts
    4

    re1

    if i use
    Code:
    Private Sub Timer1_Timer()
     Picture1.Picture = LoadPicture("k:\test1\mini.jpg")
    
    End Sub
    instead of url link the program is working any one have any idea?

  5. #5
    Join Date
    Mar 2009
    Location
    Italy - Breganze (VI)
    Posts
    120
    URL is wrong ?

  6. #6
    Join Date
    Apr 2009
    Posts
    4

    re

    Quote Originally Posted by gibra View Post
    URL is wrong ?
    LOL :))))

    make a free hosting ore use one existing
    upload a file some jpg picture
    change the url in code with your
    Ex.
    instead of:
    Picture1.Picture = LoadPicture("http://CHANGEDIMAGE-ON-5SEC/mini.jpg")
    change to your web url address of the image, replace only with your hosting:
    ("http://CHANGEDIMAGE-ON-5SEC/mini.jpg")
    run the program code
    in the main time wich program is runing upload on ftp the same name image but modified in paint or else..see if your program is update the image with modify strings.
    i hope i make my self understand ....

Similar Threads

  1. Graphics Antics, Mostly Image manipulation
    By Runesoul in forum Java
    Replies: 5
    Last Post: 05-11-2005, 06:33 AM
  2. Powerful ASP Image Manipulation Toolkit
    By WebSupergoo in forum vb.announcements
    Replies: 0
    Last Post: 05-19-2003, 11:11 AM
  3. Powerful ASP Image Manipulation Toolkit
    By WebSupergoo in forum dotnet.announcements
    Replies: 0
    Last Post: 05-19-2003, 11:09 AM
  4. Graphics and Image Manipulation in C#
    By Rui Oliveira in forum .NET
    Replies: 2
    Last Post: 02-02-2003, 12:05 PM
  5. Script for scrolling
    By Mark in forum Web
    Replies: 3
    Last Post: 08-30-2001, 12:45 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center