你好!

創(chuàng)新互聯(lián)主要從事網(wǎng)站設(shè)計(jì)、做網(wǎng)站、網(wǎng)頁(yè)設(shè)計(jì)、企業(yè)做網(wǎng)站、公司建網(wǎng)站等業(yè)務(wù)。立足成都服務(wù)雨城,十余年網(wǎng)站建設(shè)經(jīng)驗(yàn),價(jià)格優(yōu)惠、服務(wù)專業(yè),歡迎來(lái)電咨詢建站服務(wù):13518219792
“在光線暗”的環(huán)境中拍照時(shí)不能按下不能拍照快門--- 相機(jī)無(wú)法對(duì)焦時(shí),快門是不會(huì)啟動(dòng)的。
除了采用夜間模式、打開閃光燈、打開對(duì)焦輔助燈外,還可以采取下列措施,提高對(duì)焦成功率:
1、提高ISO值(比如提高為ISO400、800、1600甚至更高)。
ISO數(shù)值的大小是數(shù)碼相機(jī)對(duì)光線反應(yīng)的敏感程度測(cè)量值,通常以ISO數(shù)值表示,數(shù)值越大表示感光性越強(qiáng),數(shù)值越小表示感光性越弱。
在室內(nèi)光線不足或拍攝夜景時(shí),使用高ISO值能使對(duì)焦成功率大為增加。但照片的噪點(diǎn)也會(huì)相應(yīng)增加。
2、如果環(huán)境光源偏暗,即可增加曝光值(如調(diào)整為+1EV、+2EV)以突顯畫面的清晰度。
數(shù)碼相機(jī)在拍攝的過程中,如果按下半截快門,液晶屏上就會(huì)顯示和最終效果圖差不多的圖片,對(duì)焦,曝光一起啟動(dòng)。這個(gè)時(shí)候的曝光,正是最終圖片的曝光度。
圖片如果明顯偏亮或偏暗,說(shuō)明相機(jī)的自動(dòng)測(cè)光準(zhǔn)確度有較大偏差,要強(qiáng)制進(jìn)行曝光補(bǔ)償,不過有的時(shí)候,拍攝時(shí)顯示的亮度與實(shí)際拍攝結(jié)果有一定出入。
數(shù)碼相機(jī)可以在拍攝后立即瀏覽畫面,此時(shí),可以更加準(zhǔn)確地看到拍攝出來(lái)的畫面的明暗程度,不會(huì)再有出入。如果拍攝結(jié)果明顯偏亮或偏暗,則要重新拍攝,強(qiáng)制進(jìn)行曝光補(bǔ)償。
另外,關(guān)于相機(jī)鎖定焦點(diǎn)的操作也要注意:
拍攝時(shí),應(yīng)該先半按下快門,不要松手,將取景屏里的鎖焦框?qū)古臄z的焦點(diǎn)(比如人物的臉部),待取景屏里的鎖焦框一下收小變綠色或相機(jī)發(fā)出“嘀”一聲,就表明焦點(diǎn)已經(jīng)鎖定,此時(shí)再加力完全按下快門就行了。
拍照時(shí),還必須保證持機(jī)的穩(wěn)定,機(jī)身的抖動(dòng)也會(huì)致使照片失焦而模糊。
可以實(shí)現(xiàn)的,二維碼包含的信息是由你控制的,對(duì)這兩個(gè)二維碼做不同標(biāo)示,掃描時(shí)根據(jù)這個(gè)標(biāo)示做個(gè)判斷就可以實(shí)現(xiàn)
打開相機(jī):
[cpp] view plain copy
//先設(shè)定sourceType為相機(jī),然后判斷相機(jī)是否可用(ipod)沒相機(jī),不可用將sourceType設(shè)定為相片庫(kù)
UIImagePickerControllerSourceType sourceType = UIImagePickerControllerSourceTypeCamera;
// if (![UIImagePickerController isSourceTypeAvailable: UIImagePickerControllerSourceTypeCamera]) {
// sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
// }
//sourceType = UIImagePickerControllerSourceTypeCamera; //照相機(jī)
//sourceType = UIImagePickerControllerSourceTypePhotoLibrary; //圖片庫(kù)
//sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum; //保存的相片
UIImagePickerController *picker = [[UIImagePickerController alloc] init];//初始化
picker.delegate = self;
picker.allowsEditing = YES;//設(shè)置可編輯
picker.sourceType = sourceType;
[self presentModalViewController:picker animated:YES];//進(jìn)入照相界面
[picker release];
打開相冊(cè):(區(qū)分pad和iphone)
for iphone:
[cpp] view plain copy
UIImagePickerController *pickerImage = [[UIImagePickerController alloc] init];
if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) {
pickerImage.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
//pickerImage.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum;
pickerImage.mediaTypes = [UIImagePickerController availableMediaTypesForSourceType:pickerImage.sourceType];
}
pickerImage.delegate = self;
pickerImage.allowsEditing = NO;
[self presentModalViewController:pickerImage animated:YES];
[pickerImage release];
for ipad:
[cpp] view plain copy
UIImagePickerControllerSourceType sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
//sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum; //保存的相片
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.allowsEditing = NO;//是否允許編輯
picker.sourceType = sourceType;
/*
如果從一個(gè)導(dǎo)航按鈕處呈現(xiàn),使用:
presentPopoverFromBarButtonItem:permittedArrowDirections:animated:;
如果要從一個(gè)視圖出呈現(xiàn),使用:
presentPopoverFromRect:inView:permittedArrowDirections:animated:
如果設(shè)備旋轉(zhuǎn)以后,位置定位錯(cuò)誤需要在父視圖控制器的下面方法里面重新定位:
didRotateFromInterfaceOrientation:(在這個(gè)方法體里面重新設(shè)置rect)
然后再次調(diào)用:
- (void)presentPopoverFromRect:(CGRect)rect inView:(UIView *)view permittedArrowDirections:(UIPopoverArrowDirection)arrowDirections animated:(BOOL)animated
*/
//UIPopoverController只能在ipad設(shè)備上面使用;作用是用于顯示臨時(shí)內(nèi)容,特點(diǎn)是總是顯示在當(dāng)前視圖最前端,當(dāng)單擊界面的其他地方時(shí)自動(dòng)消失。
UIPopoverController *popover = [[UIPopoverController alloc]initWithContentViewController:picker];
self.imagePicker = popover;
//permittedArrowDirections 設(shè)置箭頭方向
[self.imagePicker presentPopoverFromRect:CGRectMake(0, 0, 300, 300) inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
[picker release];
[popover release];
點(diǎn)擊相冊(cè)中的圖片 貨照相機(jī)照完后點(diǎn)擊use 后觸發(fā)的方法
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary
*)info
點(diǎn)擊cancel 調(diào)用的方法
- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker
if (is_ios7) {
AVAuthorizationStatus authstatus = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo];
if (authstatus ==AVAuthorizationStatusRestricted || authstatus ==AVAuthorizationStatusDenied) //用戶關(guān)閉了權(quán)限
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"請(qǐng)?jiān)谠O(shè)備的設(shè)置-隱私-相機(jī)中允許訪問相機(jī)。" delegate:self cancelButtonTitle:@"確定" otherButtonTitles:nil];
[alert show];
return;
}
ALAuthorizationStatus author = [ALAssetsLibrary authorizationStatus];
if (author == kCLAuthorizationStatusRestricted || author ==kCLAuthorizationStatusDenied)//用戶關(guān)閉了權(quán)限
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"請(qǐng)?jiān)谠O(shè)備的設(shè)置-隱私-照片中允許訪問照片。" delegate:self cancelButtonTitle:@"確定" otherButtonTitles:nil];
[alert show];
return;
}
}
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
//相冊(cè)是可以用模擬器打開
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) {
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
picker.allowsEditing = YES;
[self presentViewController:picker animated:YES completion:nil];
}else{
UIAlertView *alter = [[UIAlertView alloc] initWithTitle:@"Error" message:@"沒有相冊(cè)" delegate:nil cancelButtonTitle:@"取消" otherButtonTitles:nil, nil];
[alter show];
}
}else{
[MBProgressHUD showMessag:@"無(wú)法打開相機(jī)" toView:Main_WINDOW];
NSLog(@"模擬器無(wú)法打開相機(jī)");
}
文章名稱:ios開發(fā)照相機(jī),ios的相機(jī)
文章路徑:http://chinadenli.net/article12/dsgocgc.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供外貿(mào)網(wǎng)站建設(shè)、Google、企業(yè)建站、軟件開發(fā)、標(biāo)簽優(yōu)化、網(wǎng)站內(nèi)鏈
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)