Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get the image by byte[] for server #19

Closed
chrisTseng opened this issue Jul 22, 2011 · 1 comment
Closed

get the image by byte[] for server #19

chrisTseng opened this issue Jul 22, 2011 · 1 comment

Comments

@chrisTseng
Copy link

I want know how can use the SDWebImage,when the image not the url link.
I use like the following function to get the image:
-(void)getDocumentImages:(NSInteger)thePage
{

self.userName = [[NSUserDefaults standardUserDefaults] objectForKey:@"UserName"];
self.systemUrl = [[NSUserDefaults standardUserDefaults] objectForKey:@"SysUrl"];
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"http://%@/getDocmentimages",self.systemUrl]];
NSData *myPostData = [[NSString stringWithFormat:@"<documentInformationRequest><login_name>%@</login_name><document_id>%@</document_id><document_page>%d</document_page></documentInformationRequest>",self.userName,self.theDocID,thePage] dataUsingEncoding:NSUTF8StringEncoding];
[self setRequest:[ASIHTTPRequest requestWithURL:url]];
[self.request addRequestHeader:@"User-Agent" value:@"ASIHTTPRequest"];
NSMutableData *myMutablePostData = [NSMutableData dataWithData:myPostData];
[self.request setPostBody:myMutablePostData];
[self.request setTimeOutSeconds:60];
[self.request setRequestMethod:@"POST"];
[self.request addRequestHeader:@"Content-Type" value:@"application/xml"];
[self.request setDelegate:self];
[request setDidFinishSelector:@selector(requestForImageDone:)];
[request setDidFailSelector:@selector(requestWentWrong:)];
[request startAsynchronous];

}

  • (void)requestForImageDone:(ASIHTTPRequest *)theRequest{

    NSData *data = [theRequest responseData];
    UIImage *image = [UIImage imageWithData:data];
    }
    }

For that scene how toi use the SDwebimage?
actually i have a new ios developer,so i have any idea in cash.I need some one help. Thanks a lot

@rs
Copy link
Member

rs commented Aug 20, 2011

Sorry, I don't understand your question

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants