42 #include <visp/vpConfig.h>
43 #if ( defined(VISP_HAVE_GDI) || defined(VISP_HAVE_D3D9) )
46 #include <visp/vpDisplayWin32.h>
47 #include <visp/vpDisplayException.h>
58 void vpCreateWindow(threadParam * param)
61 (param->vpDisp)->window.initWindow(param->title, param->x, param->y,
70 iStatus(false), window(rend)
103 "Image not initialized")) ;
106 window.renderer->setImg(I);
130 "Image not initialized")) ;
133 window.renderer->setImg(I);
153 strcpy(this->title, title) ;
161 threadParam * param =
new threadParam;
166 param->vpDisp =
this;
167 param->title = this->
title;
187 if(!
window.isInitialized())
192 "Window not initialized")) ;
215 window.renderer->setImg(I);
244 window.renderer->setImgROI(I,iP,width,height);
267 window.renderer->setImg(I);
295 window.renderer->setImgROI(I,iP,width,height);
326 WaitForSingleObject(
window.semaClick, 0);
327 WaitForSingleObject(
window.semaClickUp, 0);
328 WaitForSingleObject(
window.semaClick, INFINITE);
332 ret = (WAIT_OBJECT_0 == WaitForSingleObject(
window.semaClick, 0));
366 WaitForSingleObject(
window.semaClick, 0);
367 WaitForSingleObject(
window.semaClickUp, 0);
368 WaitForSingleObject(
window.semaClick, INFINITE);
372 ret = (WAIT_OBJECT_0 == WaitForSingleObject(
window.semaClick, 0));
414 WaitForSingleObject(
window.semaClick, 0);
415 WaitForSingleObject(
window.semaClickUp, 0);
416 WaitForSingleObject(
window.semaClick, INFINITE);
420 ret = (WAIT_OBJECT_0 == WaitForSingleObject(
window.semaClick, 0));
426 button =
window.clickButton;
467 WaitForSingleObject(
window.semaClickUp, 0);
468 WaitForSingleObject(
window.semaClick, 0);
469 WaitForSingleObject(
window.semaClickUp, INFINITE);
473 ret = (WAIT_OBJECT_0 == WaitForSingleObject(
window.semaClickUp, 0));
479 button =
window.clickButtonUp;
507 WaitForSingleObject(
window.semaKey, 0);
508 WaitForSingleObject(
window.semaKey, 0);
509 WaitForSingleObject(
window.semaKey, INFINITE);
513 ret = (WAIT_OBJECT_0 == WaitForSingleObject(
window.semaKey, 0));
544 WaitForSingleObject(
window.semaKey, 0);
545 WaitForSingleObject(
window.semaKey, 0);
546 WaitForSingleObject(
window.semaKey, INFINITE);
550 ret = (WAIT_OBJECT_0 == WaitForSingleObject(
window.semaKey, 0));
553 sprintf(
string,
"%s",
window.lpString);
575 ret = (WAIT_OBJECT_0 == WaitForSingleObject(
window.semaMove, 0));
633 SetWindowPos(
window.hWnd,HWND_TOP, winx, winy, 0, 0,
634 SWP_ASYNCWINDOWPOS | SWP_NOACTIVATE | SWP_NOZORDER |SWP_NOSIZE);
648 SetWindowText(
window.hWnd, windowtitle);
674 PostMessage(
window.getHWnd(), vpWM_DISPLAY, 0,0);
693 typedef struct _half_rect_t{
694 unsigned short left_top;
695 unsigned short right_bottom;
701 hr1.left_top = (
unsigned short)iP.
get_u();
702 hr1.right_bottom = (
unsigned short)(iP.
get_u()+width-1);
704 hr2.left_top = (
unsigned short)iP.
get_v();
705 hr2.right_bottom = (
unsigned short)(iP.
get_v()+height-1);
708 # if 1 // new version FS
709 WPARAM wp = (hr1.left_top <<
sizeof(
unsigned short)) + hr1.right_bottom;
710 LPARAM lp = (hr2.left_top <<
sizeof(
unsigned short)) + hr2.right_bottom;
711 # else // produce warnings with MinGW
712 WPARAM wp=*((WPARAM*)(&hr1));
713 LPARAM lp=*((WPARAM*)(&hr2));
715 PostMessage(
window.getHWnd(), vpWM_DISPLAY_ROI, wp,lp);
717 PostMessage(
window.getHWnd(), vpWM_DISPLAY, 0,0);
732 window.renderer->setPixel(ip, color);
744 unsigned int thickness )
748 window.renderer->drawLine(ip1, ip2, color, thickness);
764 unsigned int thickness )
768 window.renderer->drawLine(ip1,ip2,color,thickness,PS_DASHDOT);
785 unsigned int width,
unsigned int height,
786 const vpColor &color,
bool fill,
787 unsigned int thickness )
791 window.renderer->drawRect(topLeft,width,height,color, fill, thickness);
809 const vpColor &color,
bool fill,
810 unsigned int thickness )
814 unsigned int width =
static_cast<unsigned int>( bottomRight.
get_j() - topLeft.
get_j() );
815 unsigned int height =
static_cast<unsigned int>(bottomRight.
get_i() - topLeft.
get_i() );
816 window.renderer->drawRect(topLeft,width,height,color, fill, thickness);
831 const vpColor &color,
bool fill,
832 unsigned int thickness )
839 window.renderer->drawRect(topLeft,
840 static_cast<unsigned int>( rectangle.
getWidth() ),
841 static_cast<unsigned int>( rectangle.
getHeight() ),
842 color, fill, thickness);
859 unsigned int thickness )
863 window.renderer->drawCircle(center,radius,color,fill,thickness);
878 window.renderer->drawText(ip,text,color);
891 unsigned int thickness)
895 window.renderer->drawCross(ip, size, color, thickness);
909 unsigned int w,
unsigned int h,
910 unsigned int thickness)
915 window.renderer->drawArrow(ip1, ip2, color, w, h, thickness);
926 window.renderer->clear(color);
938 PostMessage(
window.getHWnd(), vpWM_CLOSEDISPLAY, 0,0);
943 WaitForSingleObject(
hThread, INFINITE);
947 window.initialized = false ;
959 window.renderer->getImage(I);