Exemple #1
0
        private static void CreateAndCombineRoundRectRgn(IntPtr hrgnSource, Rect region, double radius)
        {
            var hrgn = IntPtr.Zero;

            try
            {
                hrgn = CreateRoundRectRgn(region, radius);
                var result = NativeMethods.CombineRgn(hrgnSource, hrgnSource, hrgn, RGN.OR);
                if (result == CombineRgnResult.ERROR)
                {
                    throw new InvalidOperationException("Unable to combine two HRGNs.");
                }
            }
            catch
            {
                PlatformUtil.SafeDeleteObject(ref hrgn);
                throw;
            }
        }