Jump to content
Xtreme .Net Talk

Recommended Posts

Posted (edited)

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 ;-))

Edited by vidiware
  • *Experts*
Posted

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.

        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.

Posted

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

  • *Experts*
Posted

No, I put the image (a bitmap from the library, in this case) over top

of Windows XP's "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 there's anything wrong

with it. :)

Posted
No, I put the image (a bitmap from the library, in this case) over top

of Windows XP's "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 there's anything wrong

with it. :)

 

Well you had a point:D

I did somehting wrong!

And I corrected it tnx to u!:D :D

  • *Experts*
Posted

True enough - picturebox's appear to only show transparency through the form, not other picturebox's. I'm not sure if that's a bug or not...

 

You may have to move away from PictureBox's if you want the layered transparent effect. It's 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

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
  • *Experts*
Posted

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 wasn't 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

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...