Code for image swap of sprite images that works on retina screens (@2x)

Hello,
I'm having difficulty finding code (javascript, jquery or css) that will successfully swap-out lower-res sprite images for higher-res sprite images "@2x" intended for retina screens. I'm using DWCC/HTML5/CSS3. Can anyone make a recommendation?
Thanks for your help!

Does this help you?
http://css-tricks.com/snippets/css/retina-display-media-query/
Nancy O.

Similar Messages

  • Jsp code for image compression

    Hai,sir this is surendra i am doing a project using jsp and mysql.
    In that each user can put his image and i am storing that image in mysql blob but that results to that database size.
    So i need jsp code for image compression or another way for storing images.

    There's no need to store images in db. You may store them in a dedicated folder.

  • This is my Jsp code for image upload in database:

    This is my Jsp code for image upload in database:
    -----------Upload.jsp----------------
    <html>
    <head>
    </head>
    <body bgproperties="fixed" bgcolor="#CCFFFF">
    <form method="POST" action="UploadPicture.jsp" enctype="multiform/form-data">
    <%! int update=0; %>
    <%@ page import="java.util.*" %>
    <%@ page import="java.sql.*" %>
    <%@ page import="java.text.*" %>
    <%@ page import="java.sql.Date" %>
    <%@ page import="java.io.*"%>
    <%@ page language = "java" %>
    <%
    try
    String ct="3";
    String path;
    File image=new File(request.getParameter("upload"));
    path=request.getParameter("upload");
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con = DriverManager.getConnection("jdbc:odbc:itPlusElectronics","","");
    PreparedStatement pstmt=con.prepareStatement("insert into graphics values(?,?,?)");
    pstmt.setString(2,path);
    pstmt.setString(3,ct);
    InputStream is=new FileInputStream(path);
    pstmt.setBinaryStream(1, is, (int)(image.length()));
    int s=pstmt.executeUpdate();
    if(s>0)
    out.println("Uploaded");
    else
    %>
    unsucessfull
    <%}
    is.close();
    pstmt.close();
    catch(Exception e)
    }%>
    </p>
    <p><br>
    <img src="UploadedPicture.jsp">image</img>
    <p></p>
    </form>
    </body>
    </html>
    My database name is itPlusElectronics and the table name is "graphics".
    I have seen as a result of the above code that the image is stored in database as "Long binary data". and database table is look like as follows-------
    picture path id
    Long binary data D:\AMRIT\1-1-Picture.jpg 3
    To retrive and display i use this JSP code as--
    ------------------------UploadedPicture.jsp------------------------------
    <html>
    <head>
    </head>
    <body bgproperties="fixed" bgcolor="#CCFFFF">
    <%! int update=0; %>
    <%@ page import="java.util.*" %>
    <%@ page import="java.sql.*" %>
    <%@ page import="java.text.*" %>
    <%@ page import="java.io.*"%>
    <%@ page language = "java" %>
    <%@page import="javax.servlet.ServletOutputStream"%>
    <%
    try
    String path;
    path=request.getParameter("upload1");
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con = DriverManager.getConnection("jdbc:odbc:itPlusElectronics","","");
    PreparedStatement pst = con.prepareStatement("SELECT * FROM graphics WHERE id ='3'");
    // pst.setString(3, id);
    ResultSet rs = pst.executeQuery();
    path=rs.getString("path");
    if(rs.next()) {
    byte[] bytearray = new byte[4096];
    int size=0;
    InputStream sImage;
    sImage = rs.getBinaryStream(1);
    response.reset();
    response.setContentType("image/jpeg");
    response.addHeader("Content-Disposition","filename=path");
    while((size=sImage.read(bytearray))!= -1 )
    response.getOutputStream().write(bytearray,0,size) ;
    response.flushBuffer();
    sImage.close();
    rs.close();
    catch(Exception e)
    %>
    </body>
    </html>
    Now after browsing a jpg image file from client side and pressing submit button ;
    I am unable display the image in the Upload.jsp file.Though I use
    <img src="UploadedPicture.jsp">image</img> HTML code in Upload.jsp
    file .
    Now I am unable to find out the mistakes which is needed for displaying the picture in the Upload.jsp page..
    If any one can help with the proper jsp code to retrive and display the image ,please please help me !!!!!!!!!!!!!!!!!!!!!!!!!!

    dketcham wrote:
    cotton.m wrote:
    >
    2) I'm looking at how you called stuff, and you're trying to call the jsp file as an image? That jsp isn't the source of the image, just a page linking to an image. I think if you really want to do things that way you're going to need to just include that jsp within the jsp you're calling it from (or you can do it the easy way, and if you have the information to get the path of the image you want, you could simply call the image from the first jsp you posted)This is incorrect.
    There are two JSPs. The second when called will (if it worked) return the source of an image as stored in the database.even when called with <img src=xx.jsp>??
    Yes.
    If any of what I say next seems obvious or otherwise negative I apologize, just trying to explain and I don't know what you know vs what you don't.
    The link in the src is just a URL not a filetype. So just because it ends with JSP does not mean it has to return HTML. The content type is determined by the browser using the Content-Type header returned by the server in the HTTP response. In this case the header is set to be a jpeg so that's what the browser will attempt to interpret the content part of the response as.
    So in fact one is not limited to just HTML or images but whatever content type you would like to return (that the browser can understand anyway). This could be HTML or it could be an image of some type or it could be a PDF or it could be an Excel spreadsheet. All you have to do in the JSP is set the header appropriately and then send content that is actually in that format.
    This does not just apply to JSP by the way but all other web programming languages. You can do similar things to produce the same results in PHP, Perl, ASP etc.
    The only JSP/Servlet complication is whether or not doing this in a JSP is a "good" idea but I am not an expert enough at that to make a definitive statement. Mostly though JDBC in a JSP is a no-no.

  • Jquery or code for Image loading on Sp Gridview Pager(Next ,Prev) click functionality on sharepoint 2010

    Jquery or dynamic code for Image loading on Sp Gridview Pager(Next ,Prev) click functionality on sharepoint 2010.
    i have a dynamic SP gridview contains Previous and next
    buttons for paging.
    page doesn't contain Update panel.
    grdXRPSUsers.PagerSettings.Mode = PagerButtons.NextPrevious;
    grdXRPSUsers.PagerSettings.PreviousPageText = "< Previous Page";
    grdXRPSUsers.PagerSettings.NextPageText = "Next Page >";
    grdXRPSUsers.PagerSettings.FirstPageText = "First Page";
    grdXRPSUsers.PagerSettings.LastPageText = "Last Page";
    When i click on Next or Previous page in the gridview it will take more time and showing progress bar in th below.
    As per my client request, i need to change the
    progress bar to Loading image (Wheel at middle of the grid at fething time).
    How its possible either through jquery or Programming(code behind).
    Please help

    Hi,
    According to your description, my understanding is that  you want to add loading image when click the paging button to load the data.
    I suggest you can use Jquery BlockUI Plugin to show a block image when loding data in paging click event.
    Here is a similiar thread for your reference:
    How to display a loading image until a gridview is fully loaded
    More information:
    Jquery BlockUI Plugin
    Thanks
    Best Regards
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • HT5361 IN OS 10 where can one find the folder for images that came with email?

    IN OS 10 where can one find the folder for images that came with email?
    I wish to delete the leftover image files to free up drive headroom.

    I checked in this place, no dice!
    Home/Library/Mail Downloads, or
    the system "Downloads" folder

  • TS1646 I'v tried many times to update my applications however, my account can't do it because security code for my card is incorrect note that I'm sure my card details are correct completely so i need help to fix it as much as you can plz. Thnks

    Hi
    I'v tried many times to update my applications however, my account can't do it because security code for my card is incorrect note that I'm sure my card details are correct completely so i need help to fix it as much as you can plz. Thnks

    Look, I understand I still need a card attached to the account. The problem is, it won't accept my card because I only have 87 cents in my bank account right now.
    If I had known there would be so much trouble with the iTunes card, I would have just put the cash in my bank account in the morning instead of buying an iTunes card (I didn't expect the banks to be open on Thanksgiving of course).
    Apple will only accept cards that have a balance. The balance is so small in my account that it won't accept it as a valid card.
    I'm going to have to contact Apple anyway to reset the security questions. That's obvious. Your answers were not exactly helpful. You didn't tell me anything I don't already know, but thanks for trying to be helpful.

  • Is there a documented solution for the FlashPlayer Metafile Download error that works?

    Many people are experiencing problems when downloading the new FlashPlayer version 10.3.183.5 from the Adobe website.  During the download process a "Metafile Download Error" occurs when performed from an office or client facing facility.   This issue is not isolated to Win7, but is also an issue with Win XP and/or Vista.  Is there a documented solution for the FlashPlayer Metafile Download error that works?

    Use the download links in this post when that error occurs: http://forums.adobe.com/thread/889580

  • Help Needed with HTML code for Image Positioning

    Hi All,
    Need a little help with some code for positioning images.
    I initially used the following:
    This is fine, but the border automatically puts a black border around the photo - how do I change it to white? Is there a way to set margins too, to prevent the text butting up against the photo?
    I also used the following code with success:
    <style type="text/css"
    img
    float:right;
    border:2px solid white;
    margin: 0px 0px 15px 20px
    </style>
    This code works, however the problem with it is it is not individual to just one photo - it moved all my photos and on that page, I wanted one photo floated to left and another to the right.
    If I use this code, how can I make it photo specific, so that it only affects the placement, margins and borders of one photo?
    Any help would be great.
    Thanks

    CSS question, not iWeb question. Regardless, use inline CSS styling for the image. You can also wrap the image in its own tag and declare an id or simply declare an id for the img tag, then set the style for the id_name:
    <style type="text/css"
    img#id_name
    float:right;
    border:2px solid white;
    margin: 0px 0px 15px 20px
    </style>
    If you want to control the style of more than one image on a page but not all then use a class instead of an id.
    the border automatically puts a black border around the photo - how do I change it to white? Is there a way to set margins too, to prevent the text butting up against the photo?
    I believe you have discovered a solution for this according to your CSS code. You have set the border to white by looking at the code and adjusting it appropriately. Your margin is declared in the CSS also, adjust the pixels appropriately.
    Read up some more on CSS to educate yourself further. I suggest w3schools.com or a CSS forum instead of the iWeb forum if you have CSS questions. It's kind of like if you drive your auto to the supermarket so you decide to go to the supermarket and ask everyone in the produce section to help when you have car problems. All the supermarket does is provide a place to park your auto. If you have car problems then ask a mechanic. iWeb (and most of its users) doesn't specialize in code, it simply provides an area for you to place it. Granted you might get lucky and find a mechanic in the produce section of the supermarket, but you're more likely to find a specialist at an auto swap meet (or CSS coding forum)!

  • How can I insert a single image that resizes to full screen when I pinch it out?

    Hey there. I'm looking for a feature (similar to the gallery widget) where I can have 1 small image and when you tap or spread your fingers, it resizes to full screen. Is this possible?

    Thanks, Caleb, that worked!
    But I have a follow up question. So if I use Edit Mask so that I can only see a portion of the image, when I tap the image, I only enlarge the visible portion. In fact, it isn't even enlarged: I only see the same portion of the image at the same size. This is not the behaviour you get with the gallery widget. Is that also your experience, or am I missing something?
    In thinking about it, I can probably make do with the gallery widget in the cases where I would like this behaviour, but it seems like this should work.

  • Recommended image size and dimensions for images displayed on iPad retina?

    What are the recommended dpi image size and dimensions for images designed in DPS app as displayed on an iPad retina?

    Take a look at the following link:
    http://blogs.adobe.com/indesigndocs/2012/03/guidelines-for-creating-folios-for-ipad-3.html

  • I am getting ready to wipe a PC clean but wanted to know how to get the activation code for the Version of Adobe reader that is currently installed on the PC?

    I do not have the activation code for this PC and need to know how to get the software loaded back on it after a clean install of the OS and other programs.

    If you use any additional subscription services to Adobe Reader, they are activated with your Adobe ID & password.

  • Help!  code for specifying .vtt caption file doesn't work!

    Hi folks,
    I hope this is something simple.....
    I'm writing plain jane HTML5 code to play .mp4s on mobile devices that won't play Flash content.  I HAVE to have them accessible to the deaf and hard of hearing, so they have to be captioned.  I have the caption files for everything, in .vtt format (which this stuff is supposed to recognize).
    Here's the code:
    <video controls><source src="/sites/default/files/videos/Cathys_voicedintro_draft1.mp4" type="video/mp4">
    <track label="English" kind="captions" srclang="en" src="captions/Cathy_intro.vtt" default>
    </video>
    </body>
    When I hit the link to this page in a browser, the CC button appears for just a second or two....then it disappears.  The video plays fine.  On mobile devices, the video plays fine and the CC option is always there (on some devices) but turning on CC doesn't do anything.
    Have I missed something simple?  I'm on a serious deadline and this has stonewalled me.

    #1 You're going to need more than 1 MP4 file type as some browsers don't support MP4s.  I typically use MP4, OGV and WEBM to cover all bases.
    #2 Refer to this Mozilla development article on adding captions to videos.  Pay close attention to the Caption Menu CSS and scripts.
    Adding captions and subtitles to HTML5 video - App Center | MDN
    Nancy O.

  • My redemption code for OS X Mountain Lion does not work. It claims it is not a valid code.

    I purchased my MacBook Pro on August 2nd and it did not have the new software installed. I went to the website to redeem my code but everytime I tried to redeem the code in the App Store it said it was invalid. I e-mailed Apple back for a new redemption code and the same thing happened. Both of the content codes are not valid. Am I doing something wrong?

    I thinks so. You get 2 emails. You use the code from the one to unlock the redeem code from the other, then you enter that unlocked code into the redeem field.

  • Need audio drivers for hp media center pc m7780n that works on windows 7 ultimate 64 bit

    need drivers that works on windows 7 ultimate 64 bit.

    Hi:
    You can download the latest audio drivers from the Realtek site below. Accept the agreement. Download and install the first one on the list.
    http://www.realtek.com.tw/downloads/downloadsView.aspx?Langid=1&PNid=24&PFid=24&Level=4&Conn=3&DownT...
    Paul

  • Code for image shadow effect

    iWeb creates very nice shadows. Is it a separate image created on the fly or some javascript? Is there any way to get the code that generates that effect? I'd like to extend it to other pages that weren't made in iWeb.
    Thanks in advance.
    Mike

    OK. Here's the solution for anyone interested. A couple of warnings first though: Apple has a naming scheme with the shadows. If you rename "shadow_1" to "shadow_pocket", for example (even if you change it in the HTML file too, it won't work.
    If you saw the code I posted last time, you know how to use one type of shadow. The code below is a javascript file that allows 3 different shadows. Be careful to put braces and parenthesis in the right places. Javascript is a very sensitive language. You can use divs to enclose the images you want to add the shadow effect to. The divs need to have class="tinyText shadow_X", where X is the kind of shadow you want.
    On to the offset… This was actually very easy. It is found in the Javascript below "IWPoint(0.0000,1.0000)". In that example, it literally means that the shadow is offset 1 pixel downward and no horizontal offset. It's a simple (x,y) coordinate system where x and y are the pixel increments from the original image.
    The Javascript code:
    setTransparentGifURL('Media/transparent.gif');function applyEffects()
    {var registry=IWCreateEffectRegistry();registry.registerEffects({shadow_1:new IWShadow({blurRadius:2,offset:new IWPoint(0.0000,1.0000),color:'#000000',opacity:1.000000}),shadow_2:new IWShadow({blurRadius:5,offset:new IWPoint(0.0000,2.0000),color:'#000000',opacity:1.000000}),shadow_0:new IWShadow({blurRadius:5,offset:new IWPoint(0.0000,2.0000),color:'#000000',opacity:1.00000})});registry.applyEffect s();}
    function hostedOnDM()
    {return false;}
    function onPageLoad()
    {loadMozillaCSS('Blank_files/BlankMoz.css')
    fixAllIEPNGs('Media/transparent.gif');applyEffects()}
    Apple has done incredible work on these JavaScript libraries. So, anyone that wants to add beautiful shadows to their images will find these posts helpful.
    Thanks for your help too Old Toad.
    Mike

Maybe you are looking for

  • Food for thought: integrating SOAP in WLS6

    Looking at the multitude of questions regarding SOAP and WLS 6, I think the time has come to make some kind of HOWTO on integrating SOAP (especially apache's rpcrouter) in WLS 6. Like many others, I also have a strong need to make my EJB's available

  • Preflight keeps saying  "Unable to save the PDF File after post processing"

    I'm at a loss how to overcome this. Spent almost a whole day, together with another person, trying to fix it with no success! I use Adobe pro CC on a PC I usually receive pdf files from this one client who edits and formats a book in Mac Pages. Up un

  • Iphone 5 activation problem

    Hello Yesterday I had to restore my IPhone because it went in to recovery mode. Now i have restored it and i cant activate it with my giffgaff sim even though i have been using it since August 2013 How can i solve this? Thanks in advance

  • Searching items in InfoPath form library

    Hi, I have an Infopath form library, in which I have done the property promotion and exposed some of the columns. I am trying for search functionality. How to search items in infopath form library? Is there any OOB webparts which can be used to displ

  • No Entry Sign on booting

    Ok so i have a old eMac, and its not booting. Its just sits with the apple logo on start up, makes the chime but does not move. I held the option key, and got the option to boot of the mac HD. But as soon as i click on it, the apple logo dissapears,