Re: Picture Box Tranparent, CreateDIBPatternBrushPT, PackedDIB
- From: "Cafarte" <plus2fun@xxxxxxxxx>
- Date: 30 Jan 2006 09:08:27 -0800
Sorry can't help you.
( I didn't understand a word...)
amech...@xxxxxxxxxxx wrote:
> 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!!!
.
- References:
- Picture Box Tranparent, CreateDIBPatternBrushPT, PackedDIB
- From: amechaly
- Picture Box Tranparent, CreateDIBPatternBrushPT, PackedDIB
- Prev by Date: Picture Box Tranparent, CreateDIBPatternBrushPT, PackedDIB
- Next by Date: Re: Picture Box Tranparent, CreateDIBPatternBrushPT, PackedDIB
- Previous by thread: Picture Box Tranparent, CreateDIBPatternBrushPT, PackedDIB
- Next by thread: Re: Picture Box Tranparent, CreateDIBPatternBrushPT, PackedDIB
- Index(es):
Relevant Pages
|
Loading