-
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
-
The first time should be sufficient to change images.
-
 Originally Posted by Hack
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 08:36 AM.
-
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?
-
-
re
 Originally Posted by gibra
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
-
By Runesoul in forum Java
Replies: 5
Last Post: 05-11-2005, 05:33 AM
-
By WebSupergoo in forum vb.announcements
Replies: 0
Last Post: 05-19-2003, 10:11 AM
-
By WebSupergoo in forum dotnet.announcements
Replies: 0
Last Post: 05-19-2003, 10:09 AM
-
By Rui Oliveira in forum .NET
Replies: 2
Last Post: 02-02-2003, 12:05 PM
-
Replies: 3
Last Post: 08-30-2001, 11:45 AM
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
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|