Hurry! MAsk problem Answer qucikly

vidiware

Active member
Joined
Dec 3, 2002
Messages
39
Is there a way to get bitblt to work?
I want to have transparent images...

If you use.

XXX.MAkeTransparent (cl.White)
That color changes to the same as the background of the form...
I want to use that black mask system that everything that is not covered with black is invisible...
how do ya do this in vb.net?

or is there another way to make the thing completely transparent, (exept at the colored points ;-))
 
Last edited by a moderator:
OK, This worked for me.

I put a colorful background on the form (nothing solid), and I put
a picture with a white background in a picturebox.
Code:
        Dim bm As New Bitmap(PictureBox1.Image)
        Dim g As Graphics = Me.CreateGraphics
        bm.MakeTransparent(Color.White)

        g.DrawImage(bm, New Point(25, 25))
That worked. The background of the form showed through where
the white was. I did not see the grey of the form at all. Try pasting
your code to see what you are doing wrong.
 
Well yeah...
the background color...
but if you put that image on the top of another one...
its still same color as the background,

conclution:
it is gointg to the same color as the background...
Not transparent
 
No, I put the image (a bitmap from the library, in this case) over top
of Windows XPs "bliss" background on the form, and the corners
of the image that were white showed the clouds and grass background
through.

Please paste your code so that I can see if theres anything wrong
with it. :)
 
Originally posted by VolteFace
No, I put the image (a bitmap from the library, in this case) over top
of Windows XPs "bliss" background on the form, and the corners
of the image that were white showed the clouds and grass background
through.

Please paste your code so that I can see if theres anything wrong
with it. :)

Well you had a point:D
I did somehting wrong!
And I corrected it tnx to u!:D :D
 
But thiere is a small but!!!!
The image is transparent compared to the background of the form!!!
But its not transparent at other picture boxes
 
True enough - pictureboxs appear to only show transparency through the form, not other pictureboxs. Im not sure if thats a bug or not...

You may have to move away from PictureBoxs if you want the layered transparent effect. Its a bit more manual but not too bad - just save your images as Bitmap objects and draw them manually in the Paint even (or wherever else you need it).

-Nerseus
 
ok but the code you showed me made some terrible buggy stripes around the image...

Is there any guides?
The Picturebox thing is already too slow...
 
I sent you an updated version via email. It removes the issue - I had been using DrawRectangle to erase the previous image. I should have been using FillRectangle. I tweaked it a bit, including removing the Menu form as it wasnt really being used. You can always add it back in later if you like.

For everyone else, vidiware asked me not to post the code. If anyone cares to see the basics, let me know. I can post some of the relevent looping/drawing code.

-Nerseus
 
Back
Top