Results 1 to 4 of 4

Thread: draw semi transparent rectangle

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2001
    Location
    The Netherlands
    Posts
    184

    Question draw semi transparent rectangle

    Hi all,

    does anybody know how to create a semi-transparent filled rectangle on a object? I can draw filled, gradient filled rectangles without any problem. But i now have something in which they need to be semi transparent.

    Regards,

    per-i

  2. #2
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132
    You will ahve to do alpha blending.
    There is a sample @vbaccelerator.com:

    http://www.vbaccelerator.com/home/VB...on/article.asp

    There is also very nice sample by Karl E. Peterson but it only works in Win2K but take a look at it.
    Go to http://www.mvps.org/vb/index2.html?samples.htm and download Translucent.zip

  3. #3
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709
    We also have some good stuff here in the Forums too!

    Alpha + Blend


    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Mar 2001
    Location
    The Netherlands
    Posts
    184
    Hi all,

    RobDog888 the link you gave if for alphablending a form. It requires a Hwnd. I need to alpha blend a rectangle over a control. The control has got a userdrawn event which allows you to do this. It provides you with the measurements of the rectangle and gives you a Hdc for the rectangle. I use alpha blending with form already in my program though.

    The sample from vbaccelerator seems to use a Hdc and standard GDI.

    The second link doesn't seem to work though

    Regards,,

    per-i

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width