473,856 Members | 1,647 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Transparent Image?

4 New Member
I have seen many similar questions to mine, and I think I might have found one that was almost the same, but none of the solutions worked that I found.

I have a C# Windows form application, with an image over an image; If the top image were rectangular, this would work fine. But the problem is, it's not, and the top image is taking up too much space with it's "control" colored background.

I can make the background of the top image completely transparent using a transparency key, and I can (obviously) make the top image disappear by just turning off visibility. I need to be able to see both, without also dimming my top image. I actually managed to get the image itself transparent, so that the background color of the control shows through (I heard that panels worked better than PictureBox's with transparency, so I've been experimenting with those, too).

Is this impossible, or am I just not understanding the answers I found, or... ?
Mar 18 '09 #1
8 3952
3,525 Recognized Expert Specialist
Lots of background... I'm having trouble finding the actual goal and problem.

You want to see one image that is laid on top of another image, without "dimming" the top image, meaning you want it to be 100% opaque.

What exactly is the problem you are running into? Could you post a photo showing the bad result and describe what you are trying to avoid?
Mar 18 '09 #2
7,872 Recognized Expert Expert
I am confused, what exactly do you want to do here?
You have a picture of slightly smaller/non-rectanglular size over the top of another picture, and don't want the corners of that control to show up?
Setting the background of that control to transparent should have been enough?
Mar 18 '09 #3
4 New Member
I have an image, a large square. Over that, I have a smaller image. The smaller image is non-rectangular. The outside parts of the image shows through to the background color of the top box. Or, I can set the transparency key to the background color, and it shows through to my desktop.

A screen shot from my program.


edit: If you look at the example, I want the pink parts to show the card behind it.
Mar 18 '09 #4
3,525 Recognized Expert Specialist
Or, I can set the transparency key to the background color, and it shows through to my desktop.
Like all the way down to the WIndows desktop?

I would have figured if you set the transparacy for just the pointer image, but not for the card image you would have been ok.

Can you show us the code where you are doing all this?
Mar 18 '09 #5
4 New Member
Well.. I'm kinda noob-ish; I learn what I need when I need it.

When it shows through to the desktop, I set the Transparency Key of the form to the background color (MVS calls it "Crimson.") .

The transparency part is:

this.Transparen cyKey = System.Drawing. Color.Crimson;
Mar 18 '09 #6
3,525 Recognized Expert Specialist
Ok... So the two images you have... where exactly do they live?
Is one a picturebox and one the background image of the form?
Instead of setting the transparancy of the form, try setting it for just where you are showing your pointer graphic overlay.
Mar 18 '09 #7
4 New Member
I wasn't sure if it was appropriate to explain the details of implementation, but I'll explain.

The background is actually one of 9 images, placed in a sort-of grid as pictureboxes. This is so that I can scroll through a much larger map.

The front picture is also a picturebox, but like I said I've been experimenting with Panels.

I'm sorry, but I don't know what your advice means.
Mar 18 '09 #8
3,525 Recognized Expert Specialist
TIP: When you are writing your question, there is a button on the tool bar that wraps the [code] tags around your copy/pasted code. It helps a bunch. Its the button with a '#' on it. More on tags. They're cool. Check'em out.
Mar 22 '09 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

by: Fearless Freep | last post by:
I know there's a PIL mailing list but I thought I would try the question here as well. I'm using PIL on Python 1.5.2 (stop laughing, it's what the ISP has for CGI and I don't have a choice) Anyway. I have a basic image and I need to overlay an image on top of it and let some of the basic image show through. Just as an aside the images are not of the same size and the top image needs to be pasted
by: R.Marquez | last post by:
I am trying to create a simple script that Opens an existing PNG and resaves it with a transparent color. With the command line version of ImageMagic this is an easy endevor (and my current solution). I can simply do something like: convert -transparent black image.png image-transparent.png (That makes anything black transparent in the saved image.) It would seem that using PIL would make this simmilarly simple, but so
by: Chris Auer | last post by:
I have been banging my head for a couple of hours now. No matter what I do the color that I make transparent is black. Here is the code I am using from MSDN. I have tried bitmaps, jpegs, gifs and new bitmaps created in code, but I cant get any image to go transparent. Thanks if you can help. // Create a Bitmap object from an image file. Bitmap myBitmap = new Bitmap(System.Web.HttpContext.Current.Server.MapPath("resources/img/")
by: Raj | last post by:
Hi, Anyone has any idea as to how we can make a button or any standard windows control as transparent or semi-trnasparent. How can we do this in C#? Thanks, Rajendra
by: Tony Clark | last post by:
Hi, I have a bmp that is set in a panel, i want to make the white color in the bmp image transparent so i can see the color of the panel below. How is this done? thanks tony
by: Dale | last post by:
I am creating GIF images with transparent backgrounds on-the-fly for a web app and rendering them by using System.Drawing.Image.Save(Response.OutputStream, ImageType.GIF). I am confident that the transparency is working properly because if I save the created image to the local hard disk and then view it in a web page or an image editor, the transparency is correct. I can also view the transparency on-the-fly in a Windows.Forms...
by: Chuck Anderson | last post by:
Is it possible to overlay a transparent watermark on an image - dynamically? I'd like the result to look like this example: <http://www.cycletourist.com/temp/photo.php> That is a bit of overkill, but you can see what I mean. The watermark image (a png image) is included separately below the photo. I tried using a class from phpclasses.org <http://www.phpclasses.org/browse/package/1580.html...
by: NickP | last post by:
Hi there, I have a usercontrol that inherits from Windows.Forms.Button. In the OnCreateControl method I set the style of the control so that it supports transparent backcolor and set the background color to transparent. ..... Protected Overrides Sub OnCreateControl()
by: abc123456 | last post by:
Hello - I'm using imagecopyresample() to resize a GIF line-art type image onto a polygon created with GD_Image in PHP. Each has a transparent color (same color, I think!). The transparent color is dithering during the resize, though. Result is, some pixels aren't transparent anymore until I search the whole image for colors close rgb-wise to the original transparent color, and put it back to transparent. This color replacement step is...
by: pek | last post by:
Here is what I want: I have an image, let's say a JPEG 800x600... I want to create a transparent 128x128 PNG image and then resize the 800x600 to fit in the center of my transparent 128x128 PNG.. Can you help me/point me to the right direction..? Thank you very much in advance..
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, weíll explore What is ONU, What Is Router, ONU & Routerís main usage, and What is the difference between ONU and Router. Letís take a closer look ! Part I. Meaning of...
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.