Saturday, November 30, 2013

How to get a picture of the width and height jepg size!

I now have only one jepg picture data buffer (char * pbuf), do not know the width and height of the image, in the image display width and height when needed, how to get it to the width and height? ?
Reply:
How nobody can return it? ? ?

Reply:
Because you give points too.
Reply:
I am a novice, this has been the highest score I can give up! We help out!
Reply:
Impossible to give the highest score, even if you just registered also can send 100 postings. Your generous enough, others did not power.

I tell you approach it with a size method UIImage class. For example:
UIImage * p = [UIImage imageNamed: @ "a.jpg"];
Width: p.size.width
Height: p.size.height
Reply:
Thank you, my heroes! I have only one picture of the buf (char * pbuf) but no picture names. This method may not work you. I want to affirm that: I just posted when the system prompted me to send only 22 points in the post. I have no way!
Reply:
2 ways it can go about the next jpeg file header format, remove the file information.
Or
NSData * data = [NSData dataWithBytes: .......];
UIImage * image = [UIImage imageWithData: data];
The rest is the same as above.

No comments:

Post a Comment