background-image

Can not draw image on JTextArea background when using Nimbus Look And Feel

眉间皱痕 提交于 2019-12-02 01:23:15
I am drawing an image on JTextArea background, it is drawn using other look and feels (Metal, Windows etc) but when I use Nimbus Look And Feel it does not draw image What can be the possible problem and how to fix that? Here is the code I am using Image TextArea Class public class ImageTextArea extends JTextArea{ File image; public ImageTextArea(File image) { setOpaque(false); this.image=image; } @Override public void paintComponent(final Graphics g) { try { // Scale the image to fit by specifying width,height g.drawImage(new ImageIcon(image.getAbsolutePath()).getImage(),0,0,getWidth()

Plotly background images

北慕城南 提交于 2019-12-02 01:13:56
I'm trying to get a background image on my graph using plotly. I can't seem to get ANY image to display without using one of the images.plot.ly links. I tried web URLs and local images in the same folder as the project. This is what is showing up when I used the image URL from their tutorial: https://plot.ly/python/images/ This is the only time I can get anything to show up. Any other link just produces nothing on the graph. Any tips? I have searched high and low for this. layout = dict(title = 'Crime Cluster Statistics', yaxis = dict(zeroline = False), xaxis = dict(zeroline = False), images=

Rare IE10 bug: CSS animation of background-position fails with multiple backgrounds and percentage

北慕城南 提交于 2019-12-02 01:12:37
This is a very specific bug - however, I would love for someone to show me a workaround! The bug basically consists in IE10 failing to do CSS animation of background-position when these two conditions are met at the same time : Having multiple backgrounds Setting background-position in percent Here's a demo, compare Chrome with IE10: http://codepen.io/dalgard/pen/LiyIK You need to put a percentage sign after the zeros. It must be so: @keyframes move { 0% { background-position: 0%, 0%; } 100% { background-position: 0%, 100%; } } 来源: https://stackoverflow.com/questions/17053703/rare-ie10-bug-css

change background image of webkit-slider-thumb by jquery

六眼飞鱼酱① 提交于 2019-12-02 00:50:32
I searched for a while but couldn't find anything useful.I have the following css input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 10px; background-image: url('http://www.w3schools.com/html/smiley.png'), -webkit-gradient( linear, left top, left bottom, color-stop(0, #fefefe), color-stop(0.49, #dddddd), color-stop(0.51, #d1d1d1), color-stop(1, #a1a1a1) ); background-size:20px; background-repeat: no-repeat; } Now I want to change the background image to some other image src by the help of jquery or plain javascript which I can test

CSS Background. Combining content-box with cover

我怕爱的太早我们不能终老 提交于 2019-12-01 23:24:17
If I use both background-origin: content-box; and background-size: cover; on an element with some padding. The background image still covers the bottom padding (in latest versions of Safari, Chrome, Firefox and IE) div { background-image: url('http://lorempixel.com/400/200/'); background-origin: content-box; background-repeat: no-repeat; background-size: cover; border: 5px red solid; padding: 20px; } jsfiddle here Is this the correct behaviour? If so, why (am I missing something obvious here)? Yes, this is the correct behaviour. background-origin simply shifts the background image. It doesn't

How to do equivalent of a linear-gradient with opacity on a seamless background image in CSS

蓝咒 提交于 2019-12-01 22:39:03
问题 I want to do this essentially in CSS: div { background: linear-gradient(to top, rgba(255,0,0,0), rgba(255,0,0,1), rgba(255,0,0,0)); width: 1000px; height: 1000px; } <div>hello</div> But instead of a color , I want to gradient-fade-in-and-out a background image, like this: background: linear-gradient(to top, transparent, url(/myimage.png) repeat, transparent); How to accomplish this in CSS, or if it's not possible in CSS, in JS. My image is a seamless texture, so maybe that might factor into

Inline SVG not working as background-image in IE

妖精的绣舞 提交于 2019-12-01 22:00:42
I'm trying to set the background-image css property to encoded data URI content as shown in this fiddle It works as expected for all browsers I tested. The only browser that doesn't show the contents is IE 9/10. But I have another example that works in IE 9/10. The difference here is that the data URI contents are initially created in Chrome (by Raphaël) and then used in the example. If the SVG is created in IE (as in the 1st fiddle by Raphaël) itself it's not being displayed if used as background-image data. Where is the issue in IE? Is it related to my code or maybe something goes wrong in

How to do equivalent of a linear-gradient with opacity on a seamless background image in CSS

谁说我不能喝 提交于 2019-12-01 21:15:55
I want to do this essentially in CSS: div { background: linear-gradient(to top, rgba(255,0,0,0), rgba(255,0,0,1), rgba(255,0,0,0)); width: 1000px; height: 1000px; } <div>hello</div> But instead of a color , I want to gradient-fade-in-and-out a background image, like this: background: linear-gradient(to top, transparent, url(/myimage.png) repeat, transparent); How to accomplish this in CSS, or if it's not possible in CSS, in JS. My image is a seamless texture, so maybe that might factor into the equation since it is repeated. I also want to set the background-size to different sizes to figure

How to set a different background image for each page in Rails 3 site?

余生颓废 提交于 2019-12-01 20:58:48
问题 I'm trying to figure out how to set a different background image for each page of my Rails 3 site. How can I accomplish this without having to repeat what I have in my css file for each page? application.html.erb <!DOCTYPE html> <html> <head> <title>Site title</title> <%= stylesheet_link_tag "application", :media => "all" %> <%= javascript_include_tag "application" %> <%= csrf_meta_tags %> </head> <body> <div class="container"> <div class="content"> <%= yield %> </div> <%= render 'layouts

How to set a different background image for each page in Rails 3 site?

若如初见. 提交于 2019-12-01 18:40:19
I'm trying to figure out how to set a different background image for each page of my Rails 3 site. How can I accomplish this without having to repeat what I have in my css file for each page? application.html.erb <!DOCTYPE html> <html> <head> <title>Site title</title> <%= stylesheet_link_tag "application", :media => "all" %> <%= javascript_include_tag "application" %> <%= csrf_meta_tags %> </head> <body> <div class="container"> <div class="content"> <%= yield %> </div> <%= render 'layouts/footer' %> </div> </body> </html> pages.css.scss .container { width: 800px; height: 640px; position: