background-image

change background image of Framelayout via URL

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-28 08:40:10
问题 is it possible to use a url to set background for framelayout ? Example: i want to use the URL like this as my framelayout background. what i really want to achieve is that when my activity loads it will fetch the image from my domain and use it as my framelayout background image. i was able to do this but i used a imageview and a button. below is the code that i use: public class MyAppActivity extends Activity { ImageView imView; String imageUrl= "http://www.mydomain.com/resource/images/";

Repeating website background image - size vs speed

℡╲_俬逩灬. 提交于 2019-11-28 08:10:13
I was wondering if anyone has done any tests with background images. We normally create a background that repeats at least in one direction (x or y or both). Example Let's say we have a gradient background that repeats in X direction. Gradient height is 400px. We have several possibilities. We can create as small image as possible (1 pixel width and 400 pixels high) or we can create a larger image with 400 pixels height. Observation Since gradient is 400 pixels high we probably won't choose GIF format, because it can only store 256 adaptive colours. Maybe that's enaough if our gradient is

Responsive web design : “How to resize a background image according to browser window size using CSS”?

走远了吗. 提交于 2019-11-28 07:48:14
I am creating a site where my all products images will be re-size according to browser window size so i wrote some media queries where i used one big image and re-sized it in different window size but i have one image which i used in background , how i can re-size it? I want support it in all browser also in IE7 and 8. HTML <div></div> CSS div{ background: url("http://canadianneighborpharmacy.net/images/cnp/discount_20.png") no-repeat scroll 0 0 transparent; position:absolute; width:45px; height: 45px; } My live code is here :- http://jsfiddle.net/jamna/DdxbQ/19/ here i have a main "product

Background image doesn't repeat when browser window is smaller than content?

耗尽温柔 提交于 2019-11-28 07:20:50
问题 I have a header-container with a background image, like so: #header-container { background:url(../img/bg.jpg) repeat-x 0 0px; margin:0px auto; width:100%; text-align:center; } When my browser is in fullscreen (Firefox, Opera, IE), I get the following result (everything is fine): When I resize the browser to a smaller window i got this (so far so well): and when i scroll now to the right the background image doesn't repeat. Is there a way to fix it so that the image will repeat when I scroll

Resizing background-image always proportionally to scale with a center point

你说的曾经没有我的故事 提交于 2019-11-28 06:56:05
I want to be able to reproduce the behavior of this website's image when resizing. It seems like the background-image has a center point where the image start to crop when it cannot keep its proportion scale. Here is an example: http://themes.evgenyfireform.com/wp-jad/ For now my background has the following css: #bg { position: fixed; top: 0; left: 0px; width:100%; } The problem is that it's fixed and I want it to crop when the image can't be scale. You are looking for this combination: background-position:50% 50%; /* Sets reference point to scale from */ background-size:cover; /* Sets

Background Image Scaling While Maintaining Aspect Ratio

强颜欢笑 提交于 2019-11-28 06:51:01
I would like to have images for my background that change automatically like a slide show. But I would like the images to fill the background no matter what size the browser window is...and if it is scaled down, the aspect ratio of the image does not change. Here is an example of what I'm trying to do: http://www.thesixtyone.com/ How can I accomplish these tasks? Any help will be much appreciated. You can't, at least not like you are trying to now. What you can do, however, is create an <img> instead, and with css set position:absolute , scale it to 100% width and crop it from the parent with

Why an inline “background-image” style doesn't work in Chrome 10 and Internet Explorer 8?

人走茶凉 提交于 2019-11-28 06:42:17
Why the following example shows the image in Firefox 4, but not in Chrome 10 and Internet Explorer 8? HTML: <div style="background-image: url('http://www.mypicx.com/uploadimg/1312875436_05012011_2.png')"></div> CSS: div { width: 60px; height: 60px; border: 1px solid black; } Any ideas for workarounds? As c-smile mentioned: Just need to remove the apostrophes in the url() : <div style="background-image: url(http://i54.tinypic.com/4zuxif.jpg)"></div> Demo here Chrome 11 spits out the following in its debugger: [Error] GET http://www.mypicx.com/images/logo.jpg undefined (undefined) It looks like

Background image in a nested JPanel?

家住魔仙堡 提交于 2019-11-28 06:33:59
问题 I have a JPanel which contains 2 more JPanel. Located on the left(leftBox) and the right(rB), I wanted to add a background image on the right JPanel (rB). But the result I get is http://i.imgur.com/tHz1x.jpg the result I wanted http://i.imgur.com/xHbpx.jpg public void paintComponent(Graphics g) { //this.paintComponent(g); if(wdimage != null) g.drawImage(wdimage,0,0,800,800,rB); //(image,location x, location y, size x, size y) } The rB Panel is blocking the image, what I want is to display the

background-size:100% 100%; doesn't work properly in Chrome

删除回忆录丶 提交于 2019-11-28 06:20:31
I'm using an svg image as a background. I'm trying to use CSS3's background-size: 100% 100%; but it doesn't seem to work, even in browsers which should support it (like Chrome). If you look at this site you'll see the #special-post article (to the right/below the food image) with a red banner-looking background. Notice that as you shrink the window down, the height of the background image drops to retain it's proportions, rather then stretching, as I would like. EDIT: I checked this on FireFox and it works correctly... so this appears to be a webkit issue. EDIT: I checked this on Safari and it

Background size on iOS

匆匆过客 提交于 2019-11-28 06:03:19
I've spent the morning doing research on the following issue. I'm making a one page site, using a lot of images. I'm aware that Safari is known for its weird handling of background-attachment:fixed, but that's working fine; my problem is background-size:cover is not working in conjunction with fixed . I have 5 pages, all of which have a height or min-height of 100%. The last page is fixed like this: #div5 { height:100%; width:100%; position: relative; background-image: url("img/background.jpg"); background-attachment:fixed; -webkit-background-size: cover; -moz-background-size: cover; -o