Skip to main content

 none
How is pressure of pen acquired in C++ ? RRS feed

  • Question

  • Hi.
     
    How is pressure of pen acquired in C++ ?
    I wrote some code but cannot get the value of the STR_GUID_NORMALPRESSURE 
    how i get the pressure value to a int type value??

    virtual void NewPackets(
    IInkCursor* Cursor,
    IInkStrokeDisp* Stroke,
    long PacketCount,
    VARIANT* PacketData)
    {
    HRESULT hr;
    VARIANT PacketDescription;
    Stroke->get_PacketDescription(&PacketDescription);

    int cElements = PacketDescription.parray->rgsabound[0].cElements;
    int lLbound = PacketDescription.parray->rgsabound[0].lLbound;

    BSTR * bstrData;
    SafeArrayAccessData( PacketDescription.parray, ( void** )&bstrData );

    for(int i=lLbound; i<cElements; i++)
    {
    if(!wcscmp(bstrData[ i ], STR_GUID_NORMALPRESSURE))
    {
    VARIANT PacketValues;
    hr = Stroke->GetPacketValuesByProperty( bstrData[ i ], ISC_FirstElement, ISC_AllElements, &PacketValues);
    if(SUCCEEDED(hr))
    {
    //???.........
    }
    long Minimum = 0;
    long Maximum = 0;
    TabletPropertyMetricUnit Units;
    float Resolution;
    hr = Stroke->GetPacketDescriptionPropertyMetrics(bstrData[ i ], &Minimum, &Maximum, &Units, &Resolution);

    if(SUCCEEDED(hr))
    {
    //???.........
    }
    }
    }
    int nPressure = ???;
    }

    what should i do?
     
    Windows xp2 
    VisualStudio 2005.
    Acer TraveMate c100
    Tablet PC SDK 1.7
     
    Thanks.
    Wednesday, September 10, 2008 3:10 AM