From: Helmut Meukel on
Hi all,

I used in some apps a tiled background picture - usually on an form -
to display a company logo.
That's easy, load the logo into a StdPicture und use PaintPicture in
2 nested loops to paint the logo "tiles" on the form background.

In a new app I have to tile the customers logo on the client area of
a MDI form. And the MDI form has no PaintPicture, ScaleMode,
ScaleX, or ScaleY.
I first thought about StdPicture.Render but it seems for the destination
ScaleMode must be vbPixels.
I came up with two solutions in plain VB6 and used the second:

1) a PictureBox on the MDI form.
first load the logo into a StdPicture.
in MDIform_Resize:
PicBG.Align = vbAlignTop
PicBG.Align = vbAlignLeft
'now the PicBG fills the client area of the MDI form
Call DrawTiledBackgroundPicture(PicBG, LogoPic)

2) no PictureBox, a helper form instead (a child form).
Private Sub MDIForm_Load()
Dim pic As StdPicture
Set pic = LoadPicture("G:\BMPs\theirLogo.bmp", vbLPLarge, vbLPColor)
myChildForm.Move 0, 0, 160000, 90000 'exceed any possible screen size
Call DrawTiledBackgroundPicture(myChildForm, pic)
Me.Show
Set Me.Picture = myChildForm.Image
Unload myChildForm
Me.WindowState = vbNormal
End Sub

The second solution is independent of the actual size of the MDI form, no code
necessary in the resize event, the huge tiled picture is always there, covering
the
client area of the MDI form.

I would like to tile the picture on the MDI forms client area without using a
PictureBox or helper form.
I've little experience with the graphic APIs and it seems the MDI form is
somewhat
different from the normal VB form.
So will code exaples I find on the internet work for MDI forms too?
I didn't find code for MDI forms but probably I didn't ask the right questions.
(English isn't my first language).
Please advice. If you think I should better stay with one of the solutions I
have,
please say so.

Kind regards,

Helmut.

From: Karl E. Peterson on
Helmut Meukel wrote:
> I would like to tile the picture on the MDI forms client area without using a
> PictureBox or helper form.

You might, or might not <g>, like what I rigged up here:

http://vb.mvps.org/samples/MdiBack

It's pretty much a "set it and forget it" helper class that does the
dirty work for you.

--
..NET: It's About Trust!
http://vfred.mvps.org


From: Helmut Meukel on
"Karl E. Peterson" <karl(a)exmvps.org> schrieb im Newsbeitrag
news:eZiNBDBsKHA.3408(a)TK2MSFTNGP06.phx.gbl...
> Helmut Meukel wrote:
>> I would like to tile the picture on the MDI forms client area without using a
>> PictureBox or helper form.
>
> You might, or might not <g>, like what I rigged up here:
>
> http://vb.mvps.org/samples/MdiBack
>
> It's pretty much a "set it and forget it" helper class that does the dirty
> work for you.
>
> --
> .NET: It's About Trust!
> http://vfred.mvps.org
>

Karl, thank you.

Helmut.

From: Helmut Meukel on

"Helmut Meukel" <NoSpam(a)NoProvider.de> schrieb im Newsbeitrag
news:eHgC$RBsKHA.3800(a)TK2MSFTNGP06.phx.gbl...
> "Karl E. Peterson" <karl(a)exmvps.org> schrieb im Newsbeitrag
> news:eZiNBDBsKHA.3408(a)TK2MSFTNGP06.phx.gbl...
>> Helmut Meukel wrote:
>>> I would like to tile the picture on the MDI forms client area without using
>>> a
>>> PictureBox or helper form.
>>
>> You might, or might not <g>, like what I rigged up here:
>>
>> http://vb.mvps.org/samples/MdiBack
>>
>> It's pretty much a "set it and forget it" helper class that does the dirty
>> work for you.
>>
>> --
>> .NET: It's About Trust!
>> http://vfred.mvps.org
>>
>
> Karl, thank you.
>
> Helmut.
>

Karl,

I've tested your solution and I like it.
It's more than I asked for (tiled, centered, stretched and colored).
So I put it into my toolbox too, for future use. <g>

Thanks again.

Helmut.

From: Karl E. Peterson on
Helmut Meukel wrote:
> "Helmut Meukel" <NoSpam(a)NoProvider.de> schrieb...
>> "Karl E. Peterson" <karl(a)exmvps.org> schrieb...
>>> Helmut Meukel wrote:
>>>> I would like to tile the picture on the MDI forms client area without
>>>> using a
>>>> PictureBox or helper form.
>>>
>>> You might, or might not <g>, like what I rigged up here:
>>>
>>> http://vb.mvps.org/samples/MdiBack
>>>
>>> It's pretty much a "set it and forget it" helper class that does the dirty
>>> work for you.
>>
>> Karl, thank you.
>
> I've tested your solution and I like it.
> It's more than I asked for (tiled, centered, stretched and colored).

I frequently have "issues" with overkill, yeah. <g>

> So I put it into my toolbox too, for future use. <g>
>
> Thanks again.

Glad that worked out for you! Thanks...

--
..NET: It's About Trust!
http://vfred.mvps.org