macro TOUCH_COORD_TO_PIXEL (winuser.h)

Converte le coordinate tocco in pixel.

Sintassi

void TOUCH_COORD_TO_PIXEL(
   l
);

Parametri

l

Valore da convertire da coordinate tocco a pixel.

Valore restituito

nessuno

Osservazioni

La macro TOUCH_COORD_TO_PIXEL viene usata per convertire da coordinate tocco (attualmente centipixel) a pixel. Le coordinate tocco sono più granulari rispetto ai pixel in modo che gli sviluppatori di applicazioni possano usare la granularità di subpixel per applicazioni specializzate, ad esempio progettazione grafica.

Esempio

case WM_TOUCH:        
  cInputs = LOWORD(wParam);
  pInputs = new TOUCHINPUT[cInputs];
  if (pInputs){
    if (GetTouchInputInfo((HTOUCHINPUT)lParam, cInputs, pInputs, sizeof(TOUCHINPUT))){
      for (int i=0; i < static_cast<INT>(cInputs); i++){
        TOUCHINPUT ti = pInputs[i];
        index = GetContactIndex(ti.dwID);
        if (ti.dwID != 0 && index < MAXPOINTS){                            
          // Do something with your touch input handle
          ptInput.x = TOUCH_COORD_TO_PIXEL(ti.x);
          ptInput.y = TOUCH_COORD_TO_PIXEL(ti.y);
          ScreenToClient(hWnd, &ptInput);
          
          if (ti.dwFlags & TOUCHEVENTF_UP){                      
            points[index][0] = -1;
            points[index][1] = -1;                
          }else{
            points[index][0] = ptInput.x;
            points[index][1] = ptInput.y;                
          }
        }
      }
    }
    // If you handled the message and don't want anything else done with it, you can close it
    CloseTouchInputHandle((HTOUCHINPUT)lParam);
    delete [] pInputs;
  }else{
    // Handle the error here 
  }  

Requisiti

Requisito Valore
Client minimo supportato Windows 7 [solo app desktop]
Server minimo supportato Windows Server 2008 R2 [solo app desktop]
Piattaforma di destinazione Windows
Intestazione winuser.h (include Windows.h)

Vedi anche

Macro