Re: Transparency (2)



Sorry, my mistake. The problem is that in my second posting some text is
missing. I sent the draft in stead of the full document.

Since the user control contains transparent labels I simply cannot set it's
background to transparent. It's simple to work around that by using the
code below. Assuming that Form1 has a bacground picture, a button named
Command1 and a usercontrol named UserControl11. The user control has a
transparent label with some wisdom of your choise as it's caption.

The user control has this ugly thing (that of course could easily be
replaced by all sorts of fine API's and such):

Public Sub SetPicture(X As Single, Y As Single)
PaintPicture Parent.Picture, 0, 0, ScaleWidth, ScaleHeight, X, Y,
ScaleWidth, ScaleHeight
End Function

And behind the command button you find this:

Private Sub Command1_Click()
UserControl11.SetPicture UserControl11.Left, UserControl11.Top
End Sub

Now the usercontrol seems transparent and as long as it's AutoRedraw is set
to True the label is fully visible. However, the effect I am looking for is
semi-transparency. So... If I could apply some magic to the picture before
blitting/painting it on the usercontrol in order to make it lighter it
should appear half-transparent. Of course I could simply supply 2 images -
the one used for the form and another one that has been "adjusted" for use
on the user control. But there has to be a better, more automatic way?

To fully answer your question about what I want to do, Mike: I want/need a
semi-transparent user control... If I can get that by cheating and
bluffing, that's just fine. :-) It's just that I wanted to break my
request for help into 2 sections since they involve 2 totally different
approaches to the problem: The first one was about doing things legally if
possible, the other was a suggestion to an alternative. I did however
manage to mess things up pretty nicely, didn't I? :-) Sorry again, at
least this should be more to the point then.

Thanks

Irene.



"Mike Williams" <Mike@xxxxxxxxxxxxxxxxx> wrote in message
news:dmc1fq$4jr$1@xxxxxxxxxxxxxxxxxxxxxxx
> "Steinar" <leebouf@xxxxxxxxxxx> wrote in message
> news:eKydndny9tFoeRXe4p2dnA@xxxxxxxxxxxxxx
>
>> In order to get the transparency mentioned in my last message,
>> I can of course simply use the background of the form (or whatever
>> container) as the picture property of the user control. This illusion
>> works fine actually (since I don't want the controls to be transparent
>> as well), but isn't . . . (something missing here ?) How can I take a
>> section of a picture and make it "lighter", and
>> therefore acting as semi-transparent when compaired to the original?
>
> Now you've really got me confused. You've spoken about transparency and
> about translucency and about "making things lighter". These are three
> different things. Perhaps you'd better tell us *exactly* what it is you
> want to do. Often, telling us *why* you want to do it is even better.
> Perhaps you can explain exactly what it is your app is doing and exactly
> what effect you wish to achieve. You can create an "always on top moves
> with the main Form" second Form (to create the effect of a translucent
> control or a set of translucent controls in XP) or you can create
> "transparency" in a user control (as mentioned in Jerry French's answer)
> or you can make all (or part) of your main Form's picture background
> "lighter". Which do you want to do.
>
> Mike
>
>


.


Loading