コード例 #1
0
        protected virtual void DrawBackground(ImageWithDeviceContext destImage)
        {
            if (BackgroundImage == null)
            {
                return;
            }

            ImageRenderer.StretchImageWithOutMargin(destImage, RealX, RealY, Size.Width, Size.Height,
                                                    BackgroundImage, 0, BackgroundImage.Width, BackgroundImage.Height,
                                                    BackgroundImageStretchExcludeMargin, Opacity);
        }
コード例 #2
0
        private void DrawImage(IDeviceContext destImage, LayeredPopupMenuItem item, Rectangle bounds, bool hovered)
        {
            ImageWithDeviceContext itemImage = ItemBackgroundImage;

            if (item.Checked || hovered)
            {
                itemImage = ItemHoveredBackgroundImage;
            }

            ImageRenderer.StretchImageWithOutMargin(destImage, bounds.X, bounds.Y, bounds.Width, bounds.Height,
                                                    itemImage, 0, itemImage.Width, itemImage.Height,
                                                    StretchMargin, 255);
        }
コード例 #3
0
 protected virtual void DrawBackground(ImageWithDeviceContext bufferImage)
 {
     ImageRenderer.StretchImageWithOutMargin(bufferImage, 0, 0, Width, Height, BackgroundImage, 0,
                                             BackgroundImage.Width, BackgroundImage.Height, StretchMargin, 255);
 }