vidiware Posted January 12, 2003 Posted January 12, 2003 (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 January 12, 2003 by vidiware Quote
*Experts* Volte Posted January 12, 2003 *Experts* Posted January 12, 2003 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. Quote
vidiware Posted January 13, 2003 Author Posted January 13, 2003 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 Quote
*Experts* Volte Posted January 13, 2003 *Experts* Posted January 13, 2003 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. :) Quote
vidiware Posted January 13, 2003 Author Posted January 13, 2003 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 Quote
vidiware Posted January 15, 2003 Author Posted January 15, 2003 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 Quote
*Experts* Nerseus Posted January 15, 2003 *Experts* Posted January 15, 2003 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 Quote "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
vidiware Posted January 15, 2003 Author Posted January 15, 2003 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... Quote
*Experts* Nerseus Posted January 15, 2003 *Experts* Posted January 15, 2003 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 Quote "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
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.