→ twitcha101: 用processmessages寫一個delay函式試試? 09/19 17:04
我查查看 感謝提供
→ bdvstg: 一次出現是因為全部畫完才顯示吧? 畫一條顯示一次試試? 09/19 18:02
→ bdvstg: 還是我會錯意? 09/19 18:02
以下是我間化程式碼部分 請前輩看一下
for(int x=0;x<500;x++)
{
for(int y=0;y<500;y++)
{
繪圖(x,y,值) ;
}
Sleep(); (我放這邊應該沒錯吧)
}
不是應該顯示x整條後delay之後在下一條
可是結果還是一起出現
還是有其他delay的方法
※ 編輯: hotrain13 (140.130.9.102), 09/19/2015 18:14:04
※ 編輯: hotrain13 (140.130.9.102), 09/19/2015 18:28:27
→ bdvstg: 你的顯示哩? 應該要有個imshow之纇的吧? 09/19 18:45
我中間的繪圖函式 就直接顯示出來了
※ 編輯: hotrain13 (140.130.9.102), 09/19/2015 19:10:10
→ twitcha101: Sor,dev好像沒processmessage,不過我試自己寫的delay 09/19 20:06
→ twitcha101: 用在一般的迴圈是正常的,能貼下你寫的delay嗎 09/19 20:07
void delay(int sec)
{
int start=clock();
int end;
while(1)
{
end=clock();
if(((end-start)/1000.)==sec)
return;
}
}
這是我網路上看到人家的寫法
也有試過Sleep(); 也是不行
※ 編輯: hotrain13 (140.130.9.102), 09/19/2015 23:44:41
→ twitcha101: 那感覺像2樓說的,同語法,一條有成功?? 09/20 00:09
→ hotrain13: 我剛剛成功了 又找了另外的delay寫法 可是只能一秒 09/20 00:23
→ hotrain13: 請問一下前輩 如果我想要100mS的delay應該怎麼寫 09/20 00:24
→ hotrain13: 我解決了 謝謝各位前輩 09/20 00:37
→ bdvstg: 為什麼不用cv waitkey? dev-c不能用? 09/20 07:06
推 grayStone: 應該只能用waitkey 09/20 14:37
→ grayStone: erface.html#imshow 09/20 14:37
推 VSei: 迴圈中加入cvShowImage和cvWaitKey(0)可以手動一行一行show 09/21 09:02
→ VSei: imshow, This function should be followed by waitKey 09/21 09:12
→ VSei: function which displays the image for specified millisec 09/21 09:13
→ VSei: Otherwise, it won’t display the image. 09/21 09:13
→ VSei: waitKey(25) will display a frame for 25 ms 09/21 09:14
→ VSei: grayStone正解+1 09/21 09:25
→ lNishan: 是說我覺得waitKey滿不準確的@_@ 有人也覺得嗎 09/21 15:38
→ hotrain13: 感謝前輩們 09/22 22:08