From: Mike Williams on
"Jim Y" <jj819stuffNOSPAM(a)comcast.net> wrote in message
news:EPmdnTNTQcKvU4LYnZ2dnUVZ_vydnZ2d(a)comcast.com...

> For bmp graphics, I use the MS Paint and, in the Edit Colors, enter the
> RGB values into the Define Custom Colors chart. Prior to this original
> posting, it was all guess work on my part. Now I have the Hex and RGB
> equivalents for matching colors accurately.

I would still suggest that if you want to draw graphics with transparent
areas you should do it properly instead of just setting a colour in a
graphic in your paint program to match a backcolor of a Form or whatever,
otherwise you can have poroblems in certain circumstances when your code is
run on a machine set to anything less than full colour depth (16 bit, for
example, which believe it or not many machines still run at).

Mike


From: Jim Y on

"Mike Williams" <Mike(a)WhiskyAndCoke.com> wrote in message
news:%23MxlcMY5GHA.2288(a)TK2MSFTNGP05.phx.gbl...
> "Jim Y" <jj819stuffNOSPAM(a)comcast.net> wrote in message
> news:EPmdnTNTQcKvU4LYnZ2dnUVZ_vydnZ2d(a)comcast.com...
>
>> For bmp graphics, I use the MS Paint and, in the Edit Colors, enter the
>> RGB values into the Define Custom Colors chart. Prior to this original
>> posting, it was all guess work on my part. Now I have the Hex and RGB
>> equivalents for matching colors accurately.
>
> I would still suggest that if you want to draw graphics with transparent areas you should do it
> properly instead of just setting a colour in a graphic in your paint program to match a backcolor
> of a Form or whatever, otherwise you can have poroblems in certain circumstances when your code is
> run on a machine set to anything less than full colour depth (16 bit, for example, which believe
> it or not many machines still run at).
>
> Mike
>
>
I would love to use the transparency feature except the program that I am using (Button Gadget)
produces PNG and JPG formats. Only the PNG includes the transparency feature and VB will not accept
the PNG format. I have used HiJaak to convert the graphic to BMP and MS Paint to color the
background. I have been unable to convert the transparent feature in the process. I have tried
various ways without success. If you have any suggestions, I am willing to try them.

For one small program, I am attempting to make my own buttons with the Image Control. So far I am
going in circles. The graphics part is not going well. The Image Control is not a problem.

Jim Y


From: Larry Serflaten on

"Jim Y" <jj819stuffNOSPAM(a)comcast.net> wrote

> I would love to use the transparency feature except the program that I am using (Button Gadget)
> produces PNG and JPG formats. Only the PNG includes the transparency feature and VB will not accept
> the PNG format. I have used HiJaak to convert the graphic to BMP and MS Paint to color the
> background. I have been unable to convert the transparent feature in the process. I have tried
> various ways without success. If you have any suggestions, I am willing to try them.

If it were me, I grab a snapshot of all the buttons and other transparent things,
and load them up into Paint Shop Pro to make individual GIF files. Those GIF
images could then be stored in Image controls on a hidden form.

Any of the other forms that want to use those images would get them from the
hidden form. If there are a great many images, such that you don't want or need
to keep them all in memory, group them by functionality and put them on separate
forms so that you can load and unload them at will, as needed.

VB does support tansparency in GIF images, when used with the Image control.

LFS


From: Mike Williams on
"Jim Y" <jj819stuffNOSPAM(a)comcast.net> wrote in message
news:oKydnQg7RIhOH73YnZ2dnUVZ_oqdnZ2d(a)comcast.com...

> I would love to use the transparency feature except the program that I am
> using (Button Gadget) produces PNG and JPG formats. Only
> the PNG includes the transparency feature and VB will not accept the
> PNG format. I have used HiJaak to convert the graphic to BMP
> and MS Paint to color the background. I have been unable to . . .

What I meant is that you should simply draw the "transparent" parts of your
bitmap in white and then use a combination of blits or PaintPictures to draw
the bitmap to the Form with the white areas being transparent (not being
drawn at all). In other words, draw them in the same way as they would be
drawn if you use the TransparentBlt API (except of course you shouldn't
actually use TransparentBlt because of the bugs it has). Alternatively,
place the bitmap in a User Control with its BacxkStyle set to Transparent
and using thre appropriate MaskPicture and MaskColor. In that way (User
Control) you will also be able to give your "transparent button" click
events and other things.

Mike


From: Mike Williams on
"Jim Y" <jj819stuffNOSPAM(a)comcast.net> wrote in message
news:oKydnQg7RIhOH73YnZ2dnUVZ_oqdnZ2d(a)comcast.com...

.. . . by the way, just in case you don't know about User Controls, here is a
brief rundown of how to create one to suit your needs. First create a bitmap
in any drawing package and use white for any part of the bitmap that you
wish to be transparent. Save it as a standard .bmp file. Now start a new VB
project (just one Form) and use the menu item Project / Add User Control. If
there is more than one available option the select a standard User Control.

You will now see a design window that looks like a borderless Form. In the
properties window set its BackStyle to Transparent, its Picture property to
the picture you created and also its MaskPicture property to the picture you
created. Finally set its MaskColor property to white. Now close the User
Control design window (the cross in the top right corner just below the main
red cross which would close the project). You will now see a new control in
the list of available controls. Just place it on your Form in the same way
that you would for any other control. It should be exactly what you want.

Mike



First  |  Prev  |  Next  |  Last
Pages: 1 2 3 4 5 6 7 8
Prev: VB application to AS400 Emulator
Next: Vb6 Project won't load