Results 1 to 10 of 10

Thread: [RESOLVED] Drawing on Windowless Usercontrols

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2010
    Posts
    5

    Resolved [RESOLVED] Drawing on Windowless Usercontrols

    Hi all,

    I am developing a simple Label control. Pretty much the same as VB6's native version but with few additional features needed for my work. I have stumbled upon two major (yet seemingly minor at first) problems but I'll just stick to one of them in this thread: windowless owner-drawn usercontrols .

    As you all know, VB6 Label is windowless and can be transparent as well. But it's not just transparent apparently. It seems that it copies a chunk of desktop's DC (or parent's DC?) to itself and draws text on top of that. That way, its clear-type fonts will properly blend with background graphics. Either that, or it uses begin/end paint method by subclassing its parent WM_PAINT. This cannot be achieved with windows regions or VB6 Usercontrol's "Lightweight" or "Transparent" modes as they require a mask bitmap or mask region and thus no alpha blending can be accomplished with those two. Onto my question....

    Not only I am oblivious to how windowless controls function or how to use them, but I have no good reference/manual to start with. Microsoft documentation only covers basic concepts that don't delve into drawing clear type fonts onto your windowless control, or drawing anything at all in fact. My question is how does one draw text over a windowless Usercontrol? I am using DrawTextEx function to draw stuff onto a memory DC but what do I do with that DC if I don't even have a window to start with? I can't subclass anything as there's no window to subclass so I guess there must be some native VB feature I'm missing out. I'll mention again that transparent image property, or mask color property are useless here since DrawTextEx draws a 32bit bitmap onto the target surface, just like VB6 native Label.

    If anyone has any suggestion just shoot, I'm totally clueless ATM so still hoping it's just a minor problem.

    Thanks in advance!
    Last edited by SassyCat; Aug 19th, 2010 at 06:01 AM.

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