示例#1
0
        private WContext OpenSystemContext(bool ctrlSysCursor = true)
        {
            WContext context = WInfo.GetDefaultSystemContext();

            if (context == null)
            {
                return(null);
            }
            // Set system cursor if caller wants it.
            if (ctrlSysCursor)
            {
                context.Options |= (uint)ECTXOptionValues.CXO_SYSTEM;
            }
            else
            {
                context.Options &= ~(uint)ECTXOptionValues.CXO_SYSTEM;
            }
            context.Name = "BgoonLibrary Tablet Context";

            deviceID = WInfo.GetDefaultDeviceIndex();
            WintabAxis tabletX = WInfo.GetDeviceAxis(deviceID, EAxisDimension.AXIS_X);
            WintabAxis tabletY = WInfo.GetDeviceAxis(deviceID, EAxisDimension.AXIS_Y);

            NativeRect = new BRect(tabletX.axMin, tabletY.axMin, tabletX.axMax, tabletY.axMax);

            context.OutOrgX = context.OutOrgY = 0;
            context.OutExtX = (int)(context.OutExtX * OutputExtFactor);
            context.OutExtY = (int)(context.OutExtY * OutputExtFactor);
            //context.OutOrgX = context.OutOrgY = 0;
            //context.OutExtX = MaxPos.x;
            //context.OutExtY = MaxPos.y;

            //context.OutExtY *= -1;
            return(context.Open() ? context : null);
        }
示例#2
0
        private WContext OpenDigitalContext(bool ctrlSysCursor = true)
        {
            WContext context = WInfo.GetDefaultDigitizingContext();

            if (context == null)
            {
                return(null);
            }

            context.Options |= (uint)ECTXOptionValues.CXO_MESSAGES;
            if (ctrlSysCursor)
            {
                context.Options |= (uint)ECTXOptionValues.CXO_SYSTEM;
            }
            context.Name = "BgoonLibrary Tablet Context";

            deviceID = WInfo.GetDefaultDeviceIndex();
            WintabAxis tabletX = WInfo.GetDeviceAxis(deviceID, EAxisDimension.AXIS_X);
            WintabAxis tabletY = WInfo.GetDeviceAxis(deviceID, EAxisDimension.AXIS_Y);

            NativeRect = new BRect(tabletX.axMin, tabletX.axMax, tabletY.axMin, tabletY.axMax);

            context.OutOrgX = context.OutOrgY = 0;
            context.OutExtX = (int)(context.OutExtX * OutputExtFactor);
            context.OutExtY = (int)(context.OutExtY * OutputExtFactor);

            //context.OutExtY *= -1;

            return(context.Open() ? context : null);
        }