web cam image from url using objective-c -


i writing os x app, cocoa, , trying figure out how web-cam still image axiscam @ url:

http://bigwatersedge.axiscam.net/view/snapshot.shtml?picturepath=/jpg/image.jpg&timestamp=

using dispatch/queue/block suggested here:

getting image url objective c

it return html code of page.

what suggested way image data web-cam , not page? since there isn't direct link jpg image, bit confusing.

i able make work in c# - save webcam image website answer/question @ bottom - looks forgot old accnt , started new one.

looks figured out.

headers need set follows:

self.bweheader = @"http://bigwatersedge.axiscam.net/view/snapshot.shtml?picturepath=/jpg/image.jpg?timestamp="; self.bweimage = @"http://bigwatersedge.axiscam.net/jpg/image.jpg?timestamp="; self.bwehost = @"bigwatersedge.axiscam.net";  nsmutableurlrequest *therequest = [nsmutableurlrequest requestwithurl:[nsurl       urlwithstring:[self.bweimage stringbyaddingpercentescapesusingencoding:nsutf8stringencoding]] cachepolicy:nsurlrequestreloadignoringcachedata timeoutinterval:60.0];  [therequest sethttpmethod:@"get"]; [therequest addvalue:self.bwehost forhttpheaderfield:@"host"]; [therequest addvalue:self.bweheader forhttpheaderfield:@"referer"];  nsdata *data = [nsurlconnection sendsynchronousrequest:therequest returningresponse:&response error:&returnerror];  nsimage *camimage = [[nsimage alloc] initwithdata:data];  [self.imageview setimage:camimage]; [self.imageview setimagescaling:nsimagescaleproportionallyupordown]; 

Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -