Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 2005 > C# 2005
|
C# 2005 For discussion of Visual C# 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 19th, 2007, 12:26 PM
tal tal is offline
Authorized User
 
Join Date: Apr 2007
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Default Transparent PictureBox?

Hi guys,
Here's a tougher one:
Can you put two PictureBox one on another, and make the upper one transparent, so that you can see the image on the lower one, but when you paint (say a line) on the upper one, it is visible
(I set the upper one's background color to Transparent, but it doesn't work, even when using
"SetStyle(ControlStyles.SupportsTransparentBackCol or,true);"...)

 
Old April 19th, 2007, 12:34 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

In regards to using 2 picture boxes, I don't think you can achieve this type of functionality. (I may be wrong)

I am curious though, why would you need to do this? It is quite possible to load your lower image into memory and then "draw" on top of it without changing the physcial image file. Will this not work in your situation?

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========
 
Old April 19th, 2007, 12:56 PM
tal tal is offline
Authorized User
 
Join Date: Apr 2007
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by dparsons


I am curious though, why would you need to do this? It is quite possible to load your lower image into memory and then "draw" on top of it without changing the physcial image file. Will this not work in your situation?
Hi, thanks for replying:)

Well, i want to create a new (and different) image based on many locations in the other image.. sort of like you'd put a half-transparant paper on an image to copy some of it..

 
Old April 19th, 2007, 01:02 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Is this to be done in-code or decided based up user input?

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========
 
Old April 19th, 2007, 01:42 PM
tal tal is offline
Authorized User
 
Join Date: Apr 2007
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by dparsons
 Is this to be done in-code or decided based up user input?
User input of course, as I'd like him to SEE what's behind and draw according to it..;)

 
Old April 19th, 2007, 01:59 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

If i had to do this, I would use GDI+ (The System.Drawing namespace) to do this. I would use the original image as the base image and then create an in memory bitmap with a transparent background and actually draw on that bitmap.

Good GDI+ Tutorials are far and few between and, at the moment, I don't have any links readily available. Start snooping around google. ^^

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========





Similar Threads
Thread Thread Starter Forum Replies Last Post
Transparent Label morteza57 C# 5 February 15th, 2008 04:36 PM
Transparent Picturebox philip1981 General .NET 0 August 31st, 2005 08:08 AM
Transparent Frame rolandatem Pro VB 6 4 April 4th, 2005 06:15 PM
Transparent boxes patwadd Classic ASP Basics 0 February 1st, 2005 08:43 AM
Transparent Question Mosquito109 VS.NET 2002/2003 0 September 3rd, 2004 12:30 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.