Solved

Transparent PictureBoxes

Posted on 2003-11-12
8
316 Views
Last Modified: 2010-05-01
I need my program to have PictureBoxes that are transparent. I don't just mean have pictures that are coloured the same as the Form, I want to be able to see controls behind them.

Any ideas?
Thanks,
adbabypenguin
0
Comment
Question by:adbabypenguin
  • 3
  • 2
8 Comments
 
LVL 3

Expert Comment

by:monkesdb
Comment Utility
Picture1.Visible = False
0
 

Author Comment

by:adbabypenguin
Comment Utility
Oh yeah... I want to have a picture displayed in the Boxes as well... Picture1.Visible=False ain't much help
0
 
LVL 3

Expert Comment

by:monkesdb
Comment Utility
Picture1.ZOrder = -1 (i think)

or you can just "Send to back" in the editor.
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 

Author Comment

by:adbabypenguin
Comment Utility
Let me make it clear what I want to do:

I have a file called House.bmp. It has a blue background. On top of the background, there is a house.

I also have a file called School.bmp. It also has a blue background. On top of the background, there is a school.

There are two Picture Boxes.
One is Pic1, The other Pic2.
They contain the two pictures.
Pic2 partly overlaps Pic1.
I want the blue part of the image to be transparent, so that I can see part of the image behind it.
0
 
LVL 3

Accepted Solution

by:
monkesdb earned 140 total points
Comment Utility
right, this makes it more clear. if you want it all to appear inside the picturebox with the house then this is how to do it. otherwise, if they need to overlap then you should paint the picture of the house onto something else and then to this ontop of that. but here you get the basic idea.

Go to the API Viewer and add BitBlt.

you need to create a mask so black is what you don't want to show through and white is what will.

PicSchoolMask.Picture = LoadPicture("C:\...mask.jpg")
PicSchoolMask.Visible = False

PicSchool.Picture = LoadPicture("C:\...image.jpg")
PicSchool.Visible = False

PicHouse.Picture = LoadPicture("C:\...house.jpg")

TheHeight = PicSchool.ScaleHeight
TheWidth = PicSchool.ScaleWidth

BitBlt PicHouse.hDC, X, Y, TheWidth, TheHeight, PicSchoolMask.hDC, 0, 0, vbSrcAnd
BitBlt PicHouse.hDC, X, Y, TheWidth, TheHeight, PicSchool.hDC, 0, 0, vbSrcPaint
0
 
LVL 49

Expert Comment

by:DanRollins
Comment Utility
Moderator, my recommended disposition is:

    Accept monkesdb's comment(s) as an answer.

Dan Rollins -- EE database cleanup volunteer
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now