background-image

Set the Background Image of a SurfaceView

谁都会走 提交于 2019-11-29 04:28:06
Is there a way to set the background image of a SurfaceView? Does it have to be done in xml or can I do it all in Java - I've got something that looks like this in my constructor: Drawable sky = (getResources().getDrawable(R.drawable.sky)); this.setBackgroundDrawable(sky); But it still doesn't show anything. You cannot set a background drawable on a SurfaceView. You'll have to draw the background onto the surface yourself. Try this public void surfaceCreated(SurfaceHolder arg0) { Bitmap background = BitmapFactory.decodeResource(getResources(), R.drawable.background); float scale = (float

How can I set fixed position Background image in jquery mobile for iPhone app using Phonegap

假如想象 提交于 2019-11-29 04:26:31
I am doing a iPhone app using Phonegap & also using jquery mobile. I want to set background image for data-role=page div. In this height of page is equal to screen & hence background is set to size of screen. But the page content length is much greater than screen & hence gray background is seen after image completes. My question is whether there is a way so that we can keep the background image fixed & scroll or move only content of page & not background image. Just to mention I have tried full size background jquery pluggin . Its working on Android but not on iOS. Can anyone please help?

Positioning background image, adding padding [duplicate]

随声附和 提交于 2019-11-29 04:24:40
问题 This question already has an answer here: CSS: Background image and padding 8 answers I'd like to add a background to a div, position right center, but!, have some padding to the image. The div has padding for the text, so I want to indent the background a little. probably makes most sense w/ example: http://jsbin.com/umuvud/edit#javascript,html,live Thanks! 回答1: Updated Answer: It's been commented multiple times that this is not the correct answer to this question, and I agree. Back when

Get final size of background image

坚强是说给别人听的谎言 提交于 2019-11-29 04:12:21
is there an easy way to get the final height and width of a background image with Javascript or jQuery even if a background-size property was applied? I mean, I know I can get the background image url and load it to an Image object and then get the width and height. But it is the size of the source image. If someone scaled it with CSS then the size changed How can I find its final size? @edit it is different from the question marked as similar because it doesnt say how to get the size in pixels if someone changed the background-size Using getComputedStyle , I've created this script that

CSS show div background image on top of other contained elements [duplicate]

风流意气都作罢 提交于 2019-11-29 03:13:11
This question already has an answer here: CSS background image on top of <img> 2 answers Not sure if this is possible and how, but I tried playing around with the z-index of the elements in my code with no success. I have a div element that has a background image set in css. inside the div, i have other elements, like div and img. I am trying to have the main div that contains the background image stay on top, since I want that background image to show on top of the other elements (this background image has some rounded corners that I want to show on top of the image included in this div).

Changing iphone lock screen programmatically when app is running in background

点点圈 提交于 2019-11-29 01:58:14
问题 I am developing an iphone app where i have to change lockscreen image programmatically when app is running in background.I have got lots of stuff saying it is not possible but there is an app for this please let me know how to acheive this. Thanks. 回答1: The only way you can change the lockscreen image is when you are playing audio. Police Scanner+ does play audio, and therefore can set an image. This only works with iOS 5+ and is done something like this. - (void)setupNowPlayingInfoCenter:

Blurry background images after update to IE11

≡放荡痞女 提交于 2019-11-29 01:16:35
问题 So this morning I got an automatic update to IE 11, after checking my eyes it appears that some of my background images are blurry. I had to check that it was not my image causing the problem, so after firing up Chrome, they were nice and crisp again... I am completely baffled. I've now uninstalled the IE11 update and they are once again nice and crisp in IE10... Has anyone else encountered this? I've included a screen shot showing the images in the different browsers. Here is a link to a

How to use CSS media query to scale background-image to viewing window

為{幸葍}努か 提交于 2019-11-29 00:24:29
I have this large image as a background for a website: body { background: #000 url(/assets/img/living.jpg) no-repeat center center; background-attachment: fixed; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; height:100%; } But on my mobile device (iPhone 4S - Safari), the background-attachment: fixed does't seem to be having the same effect as it would on a desktop. Why is that and can I use a media query to fix that? Try this - you don't always need a media query to handle background images. The CSS3 background-size:cover

Can I use an image from my local file system as background in HTML?

人盡茶涼 提交于 2019-11-28 22:43:38
I've got an HTML document hosted on a remote web server. I'm trying to have one of the elements on the web page use an image file from my local file system as its background image. No luck with Chrome, Safari or Firefox (haven't tried IE). Here's an example of what I've tried so far. <!DOCTYPE html> <html> <head> <title>Experiment</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <style> html,body { width: 100%; height: 100%; } </style> </head> <body style="background: url('file:///Users/username/Desktop/background.png')"> </body> </html> If I inspect the body element

Change background-image of a div with fade effect every 10 seconds with jquery

眉间皱痕 提交于 2019-11-28 21:57:20
I would like to create a slideshow in the header area of my page. It should change the background image every 10 seconds with a nice fade effect. And since I'm using jQuery for other stuff already I would like to use it for that as well. So my markup is just: <div id="header"> <!--other stuff here...--> </div> And my CSS at the moment is: #header { background: url('images/header_slides/slide_1.jpg') no-repeat; } So now what I want is that after 10 seconds it would change to #header { background: url('images/header_slides/slide_2.jpg') no-repeat; } with a nice slow fade effect. Hussein I