Picture Box Tranparent, CreateDIBPatternBrushPT, PackedDIB




I have a picture box aligned top that acts as a title bar on my
application.
I use similar effects for menu bars,status bars, borders, etc...
I use a nice gradiant routine to make everything look nice.
They all act as containers for other Owner drawn User Controls, that
themselves use picture boxes for their drawing.(i.e no User Control
Modules from VB).

Therefore, in order for my controls to "blend in" nicely with their
containers, i need to
save, for each object, the pattern gradiant of its container. That
pattern will be used
to create a pattern brush, used for background, when i redraw my
controls.

Ex: picTitleBar.height =300
m_oFormControlBox.top=20
m_oFormControlBox.Bottom=120.

I need my m_oFormControlBox object to have a member that will hold a
copy of the gradiant
of the picTitleBar from position 20 to 120. Therefore, heigth 100 and
with a width of some small value since it will be an object on a
container alligned horizontal.

I can't use the picTitleBar.Image.Handle with CreatePaternBrush because
there is no way to specify coordinates of the portion of the pattern
that i need. And even if i could, it wouldn't work, since i do some
other drawing on it for corners on my container , and the pattern is
"corrupted" at top/left = 0 position.

I tried DIB Sections, but i cannot use CreatePatternBrush with it. I
tried creating a PackedDIB from that DIB Section and use
CreteDIBPatternBrushPT, but things don't seem to work.

I could have dummy images hidden on my application for each object, but
i don't like that solution. I already have too many picture/image
controls.

I read the great tutorial of Mike Sutton on his web site, thinking that
everything i needed was there, but my CreateDIBPatternBrushPT returns
0.

PS. I use a routine on a global module to do the gradiant, and
SetDIBBitsToDevice api with
AutoRedraw=True for my containers. It is at that point that a need to
populate the DIB Section member of each control that lives on that
container. When my Owner drawn user control need to be repainted, i
will create a brush for the background, to be used with some GDI API'S
like FillRect.

Please Help. Things would be so simple if there was a way to make a
picture box transparent!!!

.



Relevant Pages

  • Re: Picture Box Tranparent, CreateDIBPatternBrushPT, PackedDIB
    ... > themselves use picture boxes for their drawing.(i.e no User Control ... in order for my controls to "blend in" nicely with their ... > save, for each object, the pattern gradiant of its container. ...
    (microsoft.public.vb.winapi.graphics)
  • Re: Picture Box Tranparent, CreateDIBPatternBrushPT, PackedDIB
    ... > themselves use picture boxes for their drawing.(i.e no User Control ... in order for my controls to "blend in" nicely with their ... > save, for each object, the pattern gradiant of its container. ...
    (microsoft.public.vb.winapi.graphics)
  • Re: PRINT FORM
    ... 0) but some controls doesn't print. ... a container (Form or picture box or whatever) it fails to print the contents ... of any "contained control" that itself can act as a container. ... Box will do nicely) and use the PAINT and PRINT message method to draw the ...
    (microsoft.public.vb.general.discussion)
  • Re: Containers
    ... > to be contained in a picture box - answer set the Container property to the ... Can this be done so I can cycle through all controls ... But you certainly could loop through the form's Controls collection, ... examining each control's .container property. ...
    (microsoft.public.vb.com)
  • Re: Photo within Forms
    ... the Unbound Object Frame and Bound Object Frame. ... "ImageFrame" may mislead the OP to select one of the OLE Frame controls ... > Yes, the technique has changed; in older versions, it worked as I had ... > existing picture file for each record. ...
    (microsoft.public.access.forms)

Loading