Results 1 to 26 of 26

Thread: The (Container) User Control: Child supports transparency *Resolved*

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2003
    Location
    When?!?!
    Posts
    108

    The (Container) User Control: Child supports transparency *Resolved*

    Ok, now that I got my crappy container, I have created my gradient. Now the crappy crap crap problem here is that I want my full of crap UC to be compatible with .NET's crappy alpha blending. crappy crapity crap. Ca-c-crap crap crap crap. Ca-crap c-c-can som-m-m-e-crap s-someone help crap crap crap??
    Last edited by Danny J; Nov 1st, 2003 at 08:03 PM.
    DannyJoumaa
    Advanced VB6 Programmer
    Intermediate-Advanced VB .NET Programmer
    Intermediate C# Programmer
    Intermediate Win32 Developer
    Beginner Mac OS X Developer
    Contact: [email protected]

    Favorite Sayings:
    "Every time you open your mouth, you prove your an idiot."
    "God is a programmer. Satan is a bug. Life is debugging."

  2. #2
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    if you stop talking crap it would make more sense

    you want teh control itself to be semi transparent?
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Aug 2003
    Location
    When?!?!
    Posts
    108
    No, I created a gradient User Control with this code.
    VB Code:
    1. Private Sub Gradiate(ByVal color1 As Color, ByVal color2 As Color, ByVal mode As System.Drawing.Drawing2D.LinearGradientMode)
    2.         Dim ghcs As Graphics = Me.CreateGraphics
    3.         Dim brush As New System.Drawing.Drawing2D.LinearGradientBrush(New RectangleF(0, 0, Me.Width, Me.Height), color1, color2, mode)
    4.         ghcs.FillRectangle(brush, New RectangleF(0, 0, Me.Width, Me.Height))
    5.         ghcs.Dispose()
    6.     End Sub
    My User Control's soul purpose is to allow alphablending into objects. Some alphablending code would bee down there:
    VB Code:
    1. Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    2.         Label1.BackColor = Color.FromArgb(100, 255, 255, 255)
    3.     End Sub
    Now my whole point here is to let the child control alphablend with my User Control's gradient. What do I end up with? I end up alphablending with my User Control's BackColor. I want it to alphablend with my gradient. Is there any way to do this?
    Last edited by Danny J; Oct 18th, 2003 at 05:06 PM.
    DannyJoumaa
    Advanced VB6 Programmer
    Intermediate-Advanced VB .NET Programmer
    Intermediate C# Programmer
    Intermediate Win32 Developer
    Beginner Mac OS X Developer
    Contact: [email protected]

    Favorite Sayings:
    "Every time you open your mouth, you prove your an idiot."
    "God is a programmer. Satan is a bug. Life is debugging."

  4. #4
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    hehe so basically you're trying to make the child controls be semi transparent umm as far as I know, no, .NET doesnt support this. The only thing it lets you do is to have the child controls have the same background color as the parent control.
    a lot of people have asked about this, there may be a solution, but not that I know of. search the vb.net forums though, you may find somethign useful
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Aug 2003
    Location
    When?!?!
    Posts
    108

    Now what?

    Can you tell me Hdc in VB .NET???
    DannyJoumaa
    Advanced VB6 Programmer
    Intermediate-Advanced VB .NET Programmer
    Intermediate C# Programmer
    Intermediate Win32 Developer
    Beginner Mac OS X Developer
    Contact: [email protected]

    Favorite Sayings:
    "Every time you open your mouth, you prove your an idiot."
    "God is a programmer. Satan is a bug. Life is debugging."

  6. #6
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    Re: Now what?

    Originally posted by Danny J
    Can you tell me Hdc in VB .NET???
    Hdc? you mean the handle?

    umm if that's what you want, I usually use
    someControl.Handle.ToInt32

    dunno if that helps
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Aug 2003
    Location
    When?!?!
    Posts
    108
    Listen, my boss is gonna kill me. I need that code!!
    DannyJoumaa
    Advanced VB6 Programmer
    Intermediate-Advanced VB .NET Programmer
    Intermediate C# Programmer
    Intermediate Win32 Developer
    Beginner Mac OS X Developer
    Contact: [email protected]

    Favorite Sayings:
    "Every time you open your mouth, you prove your an idiot."
    "God is a programmer. Satan is a bug. Life is debugging."

  8. #8
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    Danny, without pretending you have no idea what you're doing, where are you calling your gradiate function from? I'm assuming your making a call to it from your usercontrol OnPaint event correct? (cause otherwise it woudn't work).

    Even further along than that..... I can honestly say that is no shocking surprise its alphablending with the backcolor since your assigining the color to the label backcolor. Label.Backcolor=...

    If I understand your dilemma, you are actually wanting to alphablend a region of color (your gradient).. maybe this article will help... http://www.codeproject.com/gdi/pxalphablend.asp

    Perhaps if you make a mockup in photoshop and paste it in here, we can get a better idea of your objectives.
    Last edited by nemaroller; Oct 18th, 2003 at 10:35 PM.

  9. #9

    Thread Starter
    Lively Member
    Join Date
    Aug 2003
    Location
    When?!?!
    Posts
    108
    First of all, the smaple in code project, I don't understand cpp so thats probably one of the reasons I am posting my problem in VB .NET. I made a PSP image like you told me to, so here it is.
    Attached Images Attached Images  
    DannyJoumaa
    Advanced VB6 Programmer
    Intermediate-Advanced VB .NET Programmer
    Intermediate C# Programmer
    Intermediate Win32 Developer
    Beginner Mac OS X Developer
    Contact: [email protected]

    Favorite Sayings:
    "Every time you open your mouth, you prove your an idiot."
    "God is a programmer. Satan is a bug. Life is debugging."

  10. #10
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    take a look at the SetStyle() function, maybe that could help you a little. But still I dont think you can easily fix this
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  11. #11

    Thread Starter
    Lively Member
    Join Date
    Aug 2003
    Location
    When?!?!
    Posts
    108
    I don't have SetStyle and I am using 2003
    DannyJoumaa
    Advanced VB6 Programmer
    Intermediate-Advanced VB .NET Programmer
    Intermediate C# Programmer
    Intermediate Win32 Developer
    Beginner Mac OS X Developer
    Contact: [email protected]

    Favorite Sayings:
    "Every time you open your mouth, you prove your an idiot."
    "God is a programmer. Satan is a bug. Life is debugging."

  12. #12
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    just type setstyle and press spess, intellisense will do the rest to help you
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  13. #13

    Thread Starter
    Lively Member
    Join Date
    Aug 2003
    Location
    When?!?!
    Posts
    108
    Found it, but not helping......
    DannyJoumaa
    Advanced VB6 Programmer
    Intermediate-Advanced VB .NET Programmer
    Intermediate C# Programmer
    Intermediate Win32 Developer
    Beginner Mac OS X Developer
    Contact: [email protected]

    Favorite Sayings:
    "Every time you open your mouth, you prove your an idiot."
    "God is a programmer. Satan is a bug. Life is debugging."

  14. #14

    Thread Starter
    Lively Member
    Join Date
    Aug 2003
    Location
    When?!?!
    Posts
    108
    PLEEEAAASE!! I will even pay someone money for an answer!!! Sommmeeeoooonne!!!!
    DannyJoumaa
    Advanced VB6 Programmer
    Intermediate-Advanced VB .NET Programmer
    Intermediate C# Programmer
    Intermediate Win32 Developer
    Beginner Mac OS X Developer
    Contact: [email protected]

    Favorite Sayings:
    "Every time you open your mouth, you prove your an idiot."
    "God is a programmer. Satan is a bug. Life is debugging."

  15. #15
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    look, umm, why dont you draw the text on the control instead of using a lable? just use e.graphics.drawString in teh usercontrol's paint event.

    again,I think there is no straight-forward way to get this done. So you can find a way around it. I think the easiest way is to draw the text.
    is that the only thing you have in your user control? a lable control? that's all? should work if so
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  16. #16

    Thread Starter
    Lively Member
    Join Date
    Aug 2003
    Location
    When?!?!
    Posts
    108
    I am creating this control for one main reason, so I can get the nice bar you see that have a colapsing feature. WinXP bar uses alphablending when the user clicks on the title. You know, Microsoft has made a clear-enough solutions for themselves, so why not cut us some slack??
    DannyJoumaa
    Advanced VB6 Programmer
    Intermediate-Advanced VB .NET Programmer
    Intermediate C# Programmer
    Intermediate Win32 Developer
    Beginner Mac OS X Developer
    Contact: [email protected]

    Favorite Sayings:
    "Every time you open your mouth, you prove your an idiot."
    "God is a programmer. Satan is a bug. Life is debugging."

  17. #17
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    Originally posted by Danny J
    I am creating this control for one main reason, so I can get the nice bar you see that have a colapsing feature. WinXP bar uses alphablending when the user clicks on the title. You know, Microsoft has made a clear-enough solutions for themselves, so why not cut us some slack??
    did you try DrawString? should work perfectly infact I dont see why you want to use a label control

    are you using this as the title bar of a form?
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  18. #18
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    Look, tell your boss that instead of paying you $25 an hour to write the code for a control such as this, which theoretically would take a good week of debugging after the writing, tell him to spend $199 on a commercial control.

    www.dotnetmagic.com



    Download the demo, install it, run the samples, Run SampleTabbedAdv.

  19. #19

    Thread Starter
    Lively Member
    Join Date
    Aug 2003
    Location
    When?!?!
    Posts
    108
    nemaroller quit being a *&$^

    MrPolite I want my my control to be able to allow a child component to alphablend with the fade. Its not just a label.
    DannyJoumaa
    Advanced VB6 Programmer
    Intermediate-Advanced VB .NET Programmer
    Intermediate C# Programmer
    Intermediate Win32 Developer
    Beginner Mac OS X Developer
    Contact: [email protected]

    Favorite Sayings:
    "Every time you open your mouth, you prove your an idiot."
    "God is a programmer. Satan is a bug. Life is debugging."

  20. #20
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    Danny, not trying to be an a^^. Just trying to save you from headache, and in the process, save your boss some $.

  21. #21

    Thread Starter
    Lively Member
    Join Date
    Aug 2003
    Location
    When?!?!
    Posts
    108
    It seemed to me you were moking me and my job for a $ 25 dollar labor, and I find that an insult...
    DannyJoumaa
    Advanced VB6 Programmer
    Intermediate-Advanced VB .NET Programmer
    Intermediate C# Programmer
    Intermediate Win32 Developer
    Beginner Mac OS X Developer
    Contact: [email protected]

    Favorite Sayings:
    "Every time you open your mouth, you prove your an idiot."
    "God is a programmer. Satan is a bug. Life is debugging."

  22. #22
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    I'm not clear on what it is exactly that you are trying to accomplish. Did you ever try the DrawString solution that MrPolite suggested? If so how did it work out? If not why?

  23. #23
    Fanatic Member
    Join Date
    Jul 2003
    Posts
    830
    I have tried the DotNetMagic and although it appears to be something great, it kept giving me errors and an I think someone else here mentioned that it gave them errors as well. However, if you can get it to work then it might be your best and quickest solution. Another idea is to talk to the guy that developed it. I understand he is an excellent programmer.

    On another note, don't tell someone (especially your boss) that you can do something when you can't. As for as the $25 per hour comment, .....well......I know a guy who delivers pizza for a living and is probably better programmer than most folks here. Just because you make more than $25 per hour doesn't make you a good programmer or less of an [insulting comment here]. This thread proves that.

  24. #24
    Lively Member
    Join Date
    May 2002
    Posts
    94
    2 more days... any luck?
    If your post is resolved, mark it as such using the thread tools, Keep the forums tidy.

  25. #25

    Thread Starter
    Lively Member
    Join Date
    Aug 2003
    Location
    When?!?!
    Posts
    108

    Bump

    After checking the West hemisphere of the globe, at the very end ended up at an abandoned website.

    'Just set the BackColor to a translucent color, that will be completly invisible'

    That resulted in Color.FromArgb(0, 0, 0, 0)

    Thanks so much for all of your help!!
    DannyJoumaa
    Advanced VB6 Programmer
    Intermediate-Advanced VB .NET Programmer
    Intermediate C# Programmer
    Intermediate Win32 Developer
    Beginner Mac OS X Developer
    Contact: [email protected]

    Favorite Sayings:
    "Every time you open your mouth, you prove your an idiot."
    "God is a programmer. Satan is a bug. Life is debugging."

  26. #26
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    Re: Bump

    Originally posted by Danny J
    After checking the West hemisphere of the globe, at the very end ended up at an abandoned website.

    'Just set the BackColor to a translucent color, that will be completly invisible'

    That resulted in Color.FromArgb(0, 0, 0, 0)

    Thanks so much for all of your help!!
    uuuh how does that work??? that lets you see through the label and see the gradient on your usercontrol?!
    but thats same as setting the backcolor to color.transparent at design time
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

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