473,748 Members | 10,058 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Shading parts of an image

Hello all,

I have an image that is set up like a table of smaller images. Instead
of just creating the smaller images separately and putting them
together with a table or CSS, I decided to just make one big image.
Now I'm starting to regret that because I need to be able to shade some
of the smaller images out depending on certain criteria. Is there any
way to have a transparent div of some sort that could be positioned
over the smaller images to make an image look like it's shaded? I'd
want to have a div with a gray background that has some transparency to
it so people can still see the image below it.

Is this at all possible or am I just going to have to cut the larger
image up into smaller images and have two of each image -- one normal
and one shaded?

Thanks in advance!

Oct 9 '06 #1
6 5461
On 2006-10-09, Bryan <BT**********@g mail.comwrote:
Hello all,

I have an image that is set up like a table of smaller images. Instead
of just creating the smaller images separately and putting them
together with a table or CSS, I decided to just make one big image.
Now I'm starting to regret that because I need to be able to shade some
of the smaller images out depending on certain criteria. Is there any
way to have a transparent div of some sort that could be positioned
over the smaller images to make an image look like it's shaded? I'd
want to have a div with a gray background that has some transparency to
it so people can still see the image below it.
You can do exactly that in Firefox with the -moz-opacity property, but
it's not widely supported by other browsers, so probably not a good idea.

div
{
color: gray;
-moz-opacity: 0.5;
}
Is this at all possible or am I just going to have to cut the larger
image up into smaller images and have two of each image -- one normal
and one shaded?
I think that is the only way to do it.
Oct 9 '06 #2
Ben C wrote:
On 2006-10-09, Bryan <BT**********@g mail.comwrote:
>Hello all,

I have an image that is set up like a table of smaller images. Instead
of just creating the smaller images separately and putting them
together with a table or CSS, I decided to just make one big image.
Now I'm starting to regret that because I need to be able to shade some
of the smaller images out depending on certain criteria. Is there any
way to have a transparent div of some sort that could be positioned
over the smaller images to make an image look like it's shaded? I'd
want to have a div with a gray background that has some transparency to
it so people can still see the image below it.

You can do exactly that in Firefox with the -moz-opacity property, but
it's not widely supported by other browsers, so probably not a good idea.

div
{
color: gray;
-moz-opacity: 0.5;
}
>Is this at all possible or am I just going to have to cut the larger
image up into smaller images and have two of each image -- one normal
and one shaded?

I think that is the only way to do it.
Another way would be to overlay filters/screens over the desired image
segments.

--
Gus
Oct 9 '06 #3
"Bryan" <BT**********@g mail.comwrote in message
news:11******** **************@ m7g2000cwm.goog legroups.com...
Hello all,

I have an image that is set up like a table of smaller images. Instead
of just creating the smaller images separately and putting them
together with a table or CSS, I decided to just make one big image.
Now I'm starting to regret that because I need to be able to shade some
of the smaller images out depending on certain criteria. Is there any
way to have a transparent div of some sort that could be positioned
over the smaller images to make an image look like it's shaded? I'd
want to have a div with a gray background that has some transparency to
it so people can still see the image below it.

Is this at all possible or am I just going to have to cut the larger
image up into smaller images and have two of each image -- one normal
and one shaded?

Thanks in advance!
Are the images (in this case, bits of your image) the same except for
textual content, or are they different in other ways? - If they only differ
in textual content then you can have real text with just two small images.

If they are different then you are best doing as you say, using transparent
<div>s. For style you can use {opacity:0.5} to cover standards compliant
browsers.

Older versions of firefox (and similar) need {-moz-opacity:0.5} instead and
if you want to also work in IE6 then you can use {filter:alpha(o pacity=50)}.
These work pretty well, and shouldn't cause a problem in other browsers, but
they won't validate (because they're not valid).

Martin
Oct 9 '06 #4
Thanks guys for all the suggestions. Martin, is what your referring to
by recommending {filter:alpha(o pacity=50)} the same as what Gus
mentioned above?

Oct 9 '06 #5
Ben C wrote:
On 2006-10-09, Bryan <BT**********@g mail.comwrote:
>Hello all,

I have an image that is set up like a table of smaller images. Instead
of just creating the smaller images separately and putting them
together with a table or CSS, I decided to just make one big image.
Now I'm starting to regret that because I need to be able to shade some
of the smaller images out depending on certain criteria. Is there any
way to have a transparent div of some sort that could be positioned
over the smaller images to make an image look like it's shaded? I'd
want to have a div with a gray background that has some transparency to
it so people can still see the image below it.

You can do exactly that in Firefox with the -moz-opacity property, but
it's not widely supported by other browsers, so probably not a good idea.

div
{
color: gray;
-moz-opacity: 0.5;
}
>Is this at all possible or am I just going to have to cut the larger
image up into smaller images and have two of each image -- one normal
and one shaded?

I think that is the only way to do it.
Actually, the CSS3 'opacity' property *is* widely supported across many
browsers:

div.shader
{
background-color: gray;
opacity: 0.5;
}

The only exception is IE <= 6, which has its own way of accomplishing
this - which you can add, as long as you don't care about your CSS
validating (the CSS spec says that CSS code shouldn't have to validate
in order for the valid portion to be understood - so this shouldn't be a
big deal).

div.shader
{
background-color: gray;
opacity: 0.5;
filter:progid:D XImageTransform .Microsoft.Alph a(opacity=50);
}

Change 'opacity' value to anything between 0 and 1 - 0 being invisible
and 1 being completely opaque. Change the 'opacity=' value in the DX
filter to the 'opacity' value times 100.

Jeremy
Oct 10 '06 #6
"Bryan" <BT**********@g mail.comwrote in message
news:11******** **************@ i3g2000cwc.goog legroups.com...
Thanks guys for all the suggestions. Martin, is what your referring to
by recommending {filter:alpha(o pacity=50)} the same as what Gus
mentioned above?
I think so, yes.

I would look at Jeremy's answer too, as his sytax for use of filter (for
IE6) might be a bit more accurate than mine (best to test in IE6 just to
make sure). Also, he explains which way is more transparent opaque.

Hope that it all works - post a link to the site so we can see it working.

Martin
Oct 10 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2238
by: red | last post by:
I'm probably crazy for even trying this but I'm trying to make a script that will iterate through my databases, iterate through all the tables, and show everything on one page in forms that allow me to change the data when I hit the submit button. Blogs are displayed as links to image.php?id=$id along with browse buttons so new images can be uploaded. The idea is to make an idiot proof way for artists to change their web databases without...
2
8454
by: KP | last post by:
I want to automatically highlight parts of a webpage (make them standout from the rest of the contents). These parts could be as small as single image tags, and as large as complex tables, parts of tables etc. What is guaranteed, however, is that the part to be highlighted will always be a complete block. Ideally I would like to is insert a single html tag around this block so that the contents of the block will standout on the page. I...
2
1229
by: info | last post by:
Hello, The problem is to acquire image data and process them in parallel on a Windows 2000 system. So I am thinking of two threads. First thread is puting all the image data into a std::queue and a second thread is reading out the image data and is processing them. Processing the data might be much slower than acquiring it, that is why the memory consumption can possibly grow
1
7356
by: jeffgeorge | last post by:
Using a bit of code to produce alternate line shading in a report. Seems it should work for a form as well but no luck. Does anyone have any ideas what I need to change or if it is even possible to alternate shade a form??? Private Sub Alternate_Detail_Format(Cancel As Integer, FormatCount As Integer) Const vbLightGrey = 12632256
3
3174
by: buck | last post by:
reports/ can we alternate formatting such as "no shading" and then "shading" for multiple records such as a phone directory in Access2000 reports
1
1202
by: Meena Desai | last post by:
Hi, I am trying WEB PARTS in my site. I have prepared a sample site for that, in which I have placed 2 web part zones on a Page. Both zones contain Image buttons for Close verb and Minimize verb. The WebPartPageMenu containes BrowseModeVerb, DesignModeVerb and EditModeVerb. The problem is: when I browse the page in Internet browser, it does not display the Image buttons for Close verb and Minimize verb. I have set the VerbButtonType to...
1
2186
by: rudjohn | last post by:
I've been tasked with the not-enviable job of creating an application with multiple, semi-customizable templates. My basic concept, thus far, has been a combination of Master Pages (for layout) and WebPartZones. Each master page implements an interface (call it IMasterPage), which provides public properties for the WebPartManager and 3 WebPartZones. (Rule #1 was static number of zones.) However, each template can have these zones be...
0
1084
by: tommydog | last post by:
i want to add a parts viewer system to a website. the user selects the item they own from a database and then the page shows a parts diagram, related diagrams and a parts list (to be integrated into ASP cart) the parts image needs to be zoomable (image resize / crop but without shoving the rest of the site around) i see honda (engine dept) have made one: www.honda-engines-eu.com/en/service/spareparts/heepartscatalogue/index.jsp what do...
76
4084
by: lorlarz | last post by:
Crockford's JavaScript, The Good Parts (a book review). This shall perhaps be the world's shortest book review (for one of the world's shortests books). I like Douglas Crockford (because I am a crabby old man too; plus he _is_ smart and good).. But, how can he write a book on the good parts of JavaScript and not mention functions that address CSS & DOM? Weird. It's like
0
8984
marktang
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...
0
8823
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,...
0
9363
jinu1996
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...
1
9312
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,...
0
8237
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6793
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6073
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();...
0
4864
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2206
bsmnconsultancy
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.