English 中文(简体)
C# transparency PNG for htons, panel...how?
原标题:C# transparent PNG for buttons, panels...how?

我正在寻找很多东西,看到几个例子,但至少对我不工作。 这是我需要的:在我的申请中,我需要使用透明的PNG信标,用于工具栏,也用于可观的视觉物体的表述,即72x72“页面”icon,可以围绕客户领域的所有要素进行,并可能的话。 第一,我思考的是使用一个 but子,把它留给透明的全国过渡政府,把“软弱化”作为“透明化”:它赢得了t work,但纽伦始终表现出了坚实的色。 至于小组,同样的问题:我可以把一个透明的全国过渡政府作为背景形象,但控制从来看“透明”,而全国过渡政府有透明度的领域。 我认为,情况箱和任何其他控制都允许图像背景。 因此,我猜测,这实际上是要使控制具有透明度。 任何想法?

如果我需要制定某种习俗,即“im子”或“age子板”——真正使巴布亚新几内亚透明化,小组等! 另外,请指出的是,使用甲型六氯环己烷频道的PNG透明度问题,而不是透明的六氯苯,在当今时代,这给MHO带来体面的全球倡议。

卡车

lit

问题回答

Ok I发现,除了对小组,而且对纽芬兰和我猜测的其他控制,还有以下的 code:

public class TransparentPanel : Panel <==change to Button for instance, and works
    {
        Timer Wriggler = new Timer();
        public TransparentPanel()
        {
            Wriggler.Tick += new EventHandler(TickHandler);
            this.Wriggler.Interval = 500;
            this.Wriggler.Enabled = true;
        }
        protected void TickHandler(object sender, EventArgs e)
        {
            this.InvalidateEx();
        }
        protected override CreateParams CreateParams
        {
            get
            {
                CreateParams cp = base.CreateParams;
                cp.ExStyle |= 0x00000020; //WS_EX_TRANSPARENT 
                return cp;
            }
        }
        protected void InvalidateEx()
        {
            if (Parent == null)
            {
                return;
            }
            Rectangle rc = new Rectangle(this.Location, this.Size);
            Parent.Invalidate(rc, true);
        }
        protected override void OnPaintBackground(PaintEventArgs pevent)
        {
            // Do not allow the background to be painted  
        }
    }

页: 1 似乎在为图像Boxes工作。





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签