[Gambas-user] jpeg performance

James Wilson JamesWilson at ...1288...
Tue Jan 3 19:00:49 CET 2006


HI all

I have the following code


DIM image1 AS image 
DIM imagee1 AS Image 
DIM image2 AS image 
DIM imagee2 AS Image 
DIM image3 AS image 
DIM imagee3 AS Image 
DIM image4 AS image 
DIM imagee4 AS Image 
SHELL "wget 'http://127.0.0.1/cgi-bin/nph-zms?mode=single&monitor=2&scale=100' -O /tmp/cam1.jpg " WAIT  
SHELL "wget 'http://127.0.0.1/cgi-bin/nph-zms?mode=single&monitor=3&scale=100' -O /tmp/cam2.jpg " WAIT  
SHELL "wget 'http://127.0.0.1/cgi-bin/nph-zms?mode=single&monitor=4&scale=100' -O /tmp/cam3.jpg " WAIT  
SHELL "wget 'http://127.0.0.1/cgi-bin/nph-zms?mode=single&monitor=5&scale=100' -O /tmp/cam4.jpg " WAIT  


'image1= NEW Picture 
'image1.Load ("/tmp/cam1.jpg")
imagee1 = NEW Image
imagee1.Load ("/tmp/cam1.jpg")
image1=imagee1.Stretch (desktop.Width /2,desktop.Height /2 ,[TRUE])
imagee2 = NEW Image
imagee2.Load ("/tmp/cam2.jpg")
image2=imagee2.Stretch (desktop.Width /2,desktop.Height /2 )
imagee3 = NEW Image
imagee3.Load ("/tmp/cam3.jpg")
image3=imagee3.Stretch (desktop.Width /2,desktop.Height /2 )
imagee4 = NEW Image
imagee4.Load ("/tmp/cam4.jpg")
image4=imagee4.Stretch (desktop.Width /2,desktop.Height /2 )

'DIM image1 AS   imagee1.Stretch (320,240,[TRUE]) AS image
'picturebox1.picture = image1

'picturebox2.picture= image1
'drawingarea1.Mask=picture["/tmp/cam1.jpg"]
draw.Begin(drawingarea1)
draw.Image(image1,0,0)
draw.End 
draw.Begin(drawingarea2)
draw.Image(image2,0,0)
draw.End 
draw.Begin(drawingarea3)
draw.Image(image3,0,0)
draw.End 
draw.Begin(drawingarea4)
draw.Image(image4,0,0)
draw.End 
fps = fps+1
label1.Text = "refresh rate at " & fps &" fps"
imagee1.Clear 
 image1.Clear 
 imagee2.Clear 
 image2.Clear 
 imagee3.Clear 
 image3.Clear 
 imagee4.Clear 
 image4.Clear 

This is set on a timer to be called repeatedly. I have used wget as its the only way i know to get images from a url. The string above will download a jpeg approx 60k is size. They are pictures from my cctv system. Now the system runs but very slowly. I first tried picture boxes but these flickered badly and then i found the drawingarea. Im very new to programming, but have had some success with vb.net. What am i doing wrong as the refreshes take 3-4 seconds. I am hoping to achive 5 refreshes per second.

Regards
James
-------------- next part --------------
A non-text attachment was scrubbed...
Name: winmail.dat
Type: application/ms-tnef
Size: 3485 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20060103/f29fb1b6/attachment.bin>


More information about the User mailing list