Search Results

Search found 4135 results on 166 pages for 'img'.

Page 23/166 | < Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >

  • jQuery Cycle plugin z-index float problem

    - by Antony Carthy
    When I try to place an element on top of my jQuery Cycle element, it doesn't work. The element is always behind the jQuery cycle element. I use float: right; to position the element, and set its z-index to 100000, to no avail. Firebug sees the Cycle element and its children as having low z-indexes, and shows the floating element to be in the right place. The element never shows above the Cycling images. <!-- the cycling set --> <div id='headerimages'> <img src='images/header1.jpg' alt='' style='' /> <img src='images/header2.jpg' alt='' style='' /> <img src='images/header3.jpg' alt='' style='' /> </div> <!-- the floating element --> <img src='images/logotransparent.png' alt='' id='logo' />

    Read the article

  • PHP Regexp problem...

    - by Crazy
    Hi! I want to replace this line : <img width="600" height="256" alt="javascript00" src="http://localhost/img/test.png" title="javascript00" class="aligncenter size-full wp-image-1973"> With this : <p align="center"><img width="600" height="256" alt="javascript00" src="http://localhost/img/test.png" title="javascript00"></p> By use a simple regexp. It consists to delete the image class and add a <p align="center"> around :) Thanks for help! And merry christmas :)

    Read the article

  • How to Clear an image control in WPF (C#)

    - by antongladchenko
    I have an image control with a source image located in my c drive. I get a message that the image is being used by another process whenever I try to delete the original image to change it with another one dynamically. How do I release the image from the image control to be able to delete it. I tried this variants: string path = ((BitmapImage)img.Source).UriSource.LocalPath; img.SetValue(System.Windows.Controls.Image.SourceProperty, null); File.Delete(path); And: string path = ((BitmapImage)img.Source).UriSource.LocalPath; img.Source = null; File.Delete(path) But it's not work...

    Read the article

  • Traversing/Manipulating new window from parent window with jquery

    - by Anthony
    I found a question already with a possible solution, but I had already tried the method suggested before reading it, and it even says it's inconsistent. So I guess I'm wondering why this doesn't work: $("img").click(function() { var imgwindow = window.open('imgwin.html','','width=460,height=345'); alert(imgwindow.find("img").attr("src")); }); The goal is to set the new window's img to the same src as the image that the user clicked to open the new window. But in the above scenario, I'm just trying to tap into the new window to get what it's already-set src. I have imgwin.html already written with a default src for the image, so it should alert that url. Instead I just get undefined. I also tried the following (which should be identical on the back end), but with the same results: $("img").click(function() { var imgwindow = window.open('imgwin.html','','width=460,height=345'); alert($("img",imgwindow).attr("src")); }); I even tried variations of wrapping the imgwindow variable in $() in case somehow jquery wasn't picking up on the variable as a DOM element. The only thing I can guess is that since window.open() is a method, jquery doesn't treat it like a DOM element, even though all documentation from basic javascript tutorials treat the variable as both a method to open the window and the pointer to the window's inner DOM.

    Read the article

  • OpenCV Python HoughCircles error

    - by Dan
    Hi, I'm working on a program that detects circular shapes in images. I decided a Hough Transform would be the best, and I found one in the OpenCV library. The problem is that when I try to use it I get an error that I have no idea how to fix. Is OpenCV for Python not fully implemented? Is there a fix to the library I need for the program to work? Here's the code: import cv #cv.NamedWindow("camera", 1) capture = cv.CaptureFromCAM(0) while True: img = cv.QueryFrame(capture) gray = cv.CreateImage(cv.GetSize(img), 8, 1) edges = cv.CreateImage(cv.GetSize(img), 8, 1) cv.CvtColor(img, gray, cv.CV_BGR2GRAY) cv.Canny(gray, edges, 50, 200, 3) cv.Smooth(gray, gray, cv.CV_GAUSSIAN, 9, 9) storage = cv.CreateMat(1, 2, cv.CV_32FC3) #This is the line that throws the error cv.HoughCircles(edges, storage, cv.CV_HOUGH_GRADIENT, 2, gray.height/4, 200, 100) #cv.ShowImage("camera", img) if cv.WaitKey(10) == 27: break And here is the error I'm getting: OpenCV Error: Null pinter () in unknown function, file ..\..\..\..\ocv\openc\src\cxcore\cxdatastructs.cpp, line 408 Traceback (most recent call last): File "ellipse-detect-webcam.py", line 20, in cv.HoughCircles(edges, storage, cv.CV_HOUGH_GRADIENT, 2, gray.height/4, 200, 100) cv.error Thanks in advance for the help.

    Read the article

  • ASP.NET site move to IIS7 results in gibberish characters in page output

    - by frankadelic
    I have an ASP.NET site that was working fine running on Windows Server 2003 / IIS6. I moved it to Windows Server 2008 / IIS7 and the aspx page output now includes gibberish text. For example: p???? ????? The majority of the page renders properly, but there is gibberish here and there. I have checked the event logs and there is nothing. Any idea what's going on here? How can I fix this? I have noticed that this issue shows up when I include multiple Server.Execute statements in the aspx code: <% Server.Execute("/inc/top.inc"); %> <% Server.Execute("/inc/footer.inc"); %> The .inc files above contain just html. It appears that the files have to be of a significant length to cause the error. Here is the sample html I've been testing with: <div class="logo"> <a href="/"> <img src="/logo.png" alt="logo" width="31" height="29" class="logoimg" /> </a> </div> <div class="logo"> <a href="/"> <img src="/logo.png" alt="logo" width="31" height="29" class="logoimg" /> </a> </div> <div class="logo"> <a href="/"> <img src="/logo.png" alt="logo" width="31" height="29" class="logoimg" /> </a> </div> <div class="logo"> <a href="/"> <img src="/logo.png" alt="logo" width="31" height="29" class="logoimg" /> </a> </div> <div class="logo"> <a href="/"> <img src="/logo.png" alt="logo" width="31" height="29" class="logoimg" /> </a> </div> <div class="logo"> <a href="/"> <img src="/logo.png" alt="logo" width="31" height="29" class="logoimg" /> </a> </div> Also, the gibberish characters appear inconsistently. If I ctrl+F5 the pages, the gibberish characters change and occasionally don't appear at all.

    Read the article

  • Blackberry - Listfield layout question

    - by Kai
    I'm having an interesting anomaly when displaying a listfield on the blackberry simulator: The top item is the height of a single line of text (about 12 pixels) while the rest are fine. Does anyone know why only the top item is being drawn this way? Also, when I add an empty venue in position 0, it still displays the first actual venue this way (item in position 1). Not sure what to do. Thanks for any help. The layout looks like this: ----------------------------------- | *part of image* | title | ----------------------------------- | | title | | * full image * | address | | | city, zip | ----------------------------------- The object is called like so: listField = new ListField( venueList.size() ); listField.setCallback( this ); listField.setSelectedIndex(-1); _middle.add( listField ); Here is the drawListRow code: public void drawListRow( ListField listField, Graphics graphics, int index, int y, int width ) { listField.setRowHeight(90); Hashtable item = (Hashtable) venueList.elementAt( index ); String venue_name = (String) item.get("name"); String image_url = (String) item.get("image_url"); String address = (String) item.get("address"); String city = (String) item.get("city"); String zip = (String) item.get("zip"); EncodedImage img = null; try { String filename = image_url.substring(image_url.indexOf("crop/") + 5, image_url.length() ); FileConnection fconn = (FileConnection)Connector.open( "file:///SDCard/Blackberry/project1/" + filename, Connector.READ); if ( !fconn.exists() ) { } else { InputStream input = fconn.openInputStream(); byte[] data = new byte[(int)fconn.fileSize()]; input.read(data); input.close(); if(data.length > 0) { EncodedImage rawimg = EncodedImage.createEncodedImage( data, 0, data.length); int dw = Fixed32.toFP(Display.getWidth()); int iw = Fixed32.toFP(rawimg.getWidth()); int sf = Fixed32.div(iw, dw); img = rawimg.scaleImage32(sf * 4, sf * 4); } else { } } } catch(IOException ef) { } graphics.drawText( venue_name, 140, y, 0, width ); graphics.drawText( address, 140, y + 15, 0, width ); graphics.drawText( city + ", " + zip, 140, y + 30, 0, width ); if(img != null) { graphics.drawImage(0, y, img.getWidth(), img.getHeight(), img, 0, 0, 0); } }

    Read the article

  • How to display a JSON error message?

    - by Tiny Giant Studios
    I'm currently developing a tumblr theme and have built a jQuery JSON thingamabob that uses the Tumblr API to do the following: The user would click on the "post type" link (e.g. Video Posts), at which stage jQuery would use JSON to grab all the posts that's related to that type and then dynamically display them in a designated area. Now everything works absolutely peachy, except that with Tumblr being Tumblr and their servers taking a knock every now and then, the Tumblr API thingy is sometimes offline. Now I can't foresee when this function will be down, which is why I want to display some generic error message if JSON (for whatever reason) was unable to load the post. You'll see I've already written some code to show an error message when jQuery can't find any posts related to that post type BUT it doesn't cover any server errors. Note: I sometimes get this error: Failed to load resource: the server responded with a status of 503 (Service Temporarily Unavailable) It is for this 503 Error message that I need to write some code, but I'm slightly clueless :) Here's the jQuery JSON code: $('ul.right li').find('a').click(function() { var postType = this.className; var count = 0; byCategory(postType); return false; function byCategory(postType, callback) { $.getJSON('{URL}/api/read/json?type=' + postType + '&callback=?', function(data) { var article = []; $.each(data.posts, function(i, item) { // i = index // item = data for a particular post switch(item.type) { case 'photo': article[i] = '<div class="post_wrap"><div class="photo" style="padding-bottom:5px;">' + '<a href="' + item.url + '" title="{Title}" class="type_icon"><img src="http://static.tumblr.com/ewjv7ap/XSTldh6ds/photo_icon.png" alt="type_icon"/></a>' + '<a href="' + item.url + '" title="{Title}"><img src="' + item['photo-url-500'] + '"alt="image" /></a></div></div>'; count = 1; break; case 'video': article[i] = '<div class="post_wrap"><div class="video" style="padding-bottom:5px;">' + '<a href="' + item.url + '" title="{Title}" class="type_icon">' + '<img src="http://static.tumblr.com/ewjv7ap/nuSldhclv/video_icon.png" alt="type_icon"/></a>' + '<span style="margin: auto;">' + item['video-player'] + '</span>' + '</div></div>'; count = 1; break; case 'audio': if (use_IE == true) { article[i] = '<div class="post_wrap"><div class="regular">' + '<a href="' + item.url + '" title="{Title}" class="type_icon"><img src="http://static.tumblr.com/ewjv7ap/R50ldh5uj/audio_icon.png" alt="type_icon"/></a>' + '<h3><a href="' + item.url + '">' + item['id3-artist'] +' - ' + item['id3-title'] + '</a></h3>' + '</div></div>'; } else { article[i] = '<div class="post_wrap"><div class="regular">' + '<a href="' + item.url + '" title="{Title}" class="type_icon"><img src="http://static.tumblr.com/ewjv7ap/R50ldh5uj/audio_icon.png" alt="type_icon"/></a>' + '<h3><a href="' + item.url + '">' + item['id3-artist'] +' - ' + item['id3-title'] + '</a></h3><div class="player">' + item['audio-player'] + '</div>' + '</div></div>'; }; count = 1; break; case 'regular': article[i] = '<div class="post_wrap"><div class="regular">' + '<a href="' + item.url + '" title="{Title}" class="type_icon"><img src="http://static.tumblr.com/ewjv7ap/dwxldhck1/regular_icon.png" alt="type_icon"/></a><h3><a href="' + item.url + '">' + item['regular-title'] + '</a></h3><div class="description_container">' + item['regular-body'] + '</div></div></div>'; count = 1; break; case 'quote': article[i] = '<div class="post_wrap"><div class="quote">' + '<a href="' + item.url + '" title="{Title}" class="type_icon"><img src="http://static.tumblr.com/ewjv7ap/loEldhcpr/quote_icon.png" alt="type_icon"/></a><blockquote><h3><a href="' + item.url + '" title="{Title}">' + item['quote-text'] + '</a></h3></blockquote><cite>- ' + item['quote-source'] + '</cite></div></div>'; count = 1; break; case 'conversation': article[i] = '<div class="post_wrap"><div class="chat">' + '<a href="' + item.url + '" title="{Title}" class="type_icon"><img src="http://static.tumblr.com/ewjv7ap/MVuldhcth/conversation_icon.png" alt="type_icon"/></a><h3><a href="' + item.url + '">' + item['conversation-title'] + '</a></h3></div></div>'; count = 1; break; case 'link': article[i] = '<div class="post_wrap"><div class="link">' + '<a href="' + item.url + '" title="{Title}" class="type_icon"><img src="http://static.tumblr.com/ewjv7ap/EQGldhc30/link_icon.png" alt="type_icon"/></a><h3><a href="' + item['link-url'] + '" target="_blank">' + item['link-text'] + '</a></h3></div></div>'; count = 1; break; default: alert('No Entries Found.'); }; }) // end each if (!(count == 0)) { $('#content_right') .hide('fast') .html('<div class="first_div"><span class="left_corner"></span><span class="right_corner"></span><h2>Displaying ' + postType + ' Posts Only</h2></div>' + article.join('')) .slideDown('fast') } else { $('#content_right') .hide('fast') .html('<div class="first_div"><span class="left_corner"></span><span class="right_corner"></span><h2>Hmmm, currently there are no ' + postType + ' posts to display</h2></div>') .slideDown('fast') } // end getJSON }); // end byCategory } }); If you'd like to see the demo in action, check out Elegantem but do note that everything might work absolutely fine for you (or not), depending on Tumblr's temperament.

    Read the article

  • Move multiple BufferedImage in Java2D?

    - by zo0mbie
    How can I mousedrag different BufferedImages in Java2D? For instance, if I have ten or more images, how can I move that images which my mouse is over? Now I'm importing an BufferedImage with BufferedImage img = new BufferdImage(new File("filename")); And I'm painting this with Graphics2D with public void paintComponent(Graphics g) { super.paintComponent(g); g2d = (Graphics2D) g; g2d.drawImage(img, x1, y1, null); g2d.drawImage(img2, x2, y2,null); } Everytime I'm moving on a image I'm repaint()-ing the entire screen. My mousemove class is as follows class MouseMotionHandler extends MouseMotionAdapter { @Override public void mouseDragged(MouseEvent e) { x1 = e.getX() - (img.getWidth() / 2); y1 = e.getY() - (img.getHeight() / 2); repaint(); } } With this method I'm able to "drag" one picture, but what to do when I will drag more individually?

    Read the article

  • How do you display a list of images, from a folder on hard drive, on ASP.NET website?

    - by Jordan S
    I am trying to make a simple photo gallery website. Using ASP.NET and C#. Right now I don't have a server set up but I am just using the development one that Visual Studio Starts when you make a website project and run it. I have a folder on my hard drive that contains an unknown number of images. I want to write a piece of code that will go through each image and add them to the default webpage. I have tried this code but it doesn't work. What am I doing wrong? Should I be using a ListView control or a DataView or something like that? Do I need to add a virtual directory in order to access the images? If so, how do I to that on this test server? ALSO, how do I set the position and alignment of these pictures? For example, how would I make it so that the pictures are in a line vertically and centered on the webpage? protected void Page_Load(object sender, EventArgs e) { string[] filesindirectory = Directory.GetFiles(@"C:\Users\Jordan\Desktop\Web Images"); int i = 1; foreach (string s in filesindirectory) { Image img = new Image(); img.ID = "image" + i.ToString(); img.ImageUrl = s; img.Visible = true; Page.Controls.Add(img); i++; } }

    Read the article

  • OutOfMemory exception when loading an image in .Net

    - by Ben
    Hi, Im loading an image from a SQL CE db and then trying to load that into a PictureBox. I am saving the image like this: if (ofd.ShowDialog() == DialogResult.OK) { picArtwork.ImageLocation = ofd.FileName; using (System.IO.FileStream fs = new System.IO.FileStream(ofd.FileName, System.IO.FileMode.Open)) { byte[] imageAsBytes = new byte[fs.Length]; fs.Read(imageAsBytes, 0, imageAsBytes.Length); thisItem.Artwork = imageAsBytes; fs.Close(); } } and then saving to the Db using LINQ To SQL. I load the image back like so: using (FileStream fs = new FileStream(@"C:\Temp\img.jpg", FileMode.CreateNew ,FileAccess.Write )) { byte[] img = (byte[])encoding.GetBytes(ThisFilm.Artwork.ToString()); fs.Write(img, 0, img.Length); } but am getting an OutOfMemoryException. I have read that this is a slight red herring and that there is probably something wrong with the filetype, but i cant figure what. Any ideas? Thanks picArtwork.Image = System.Drawing.Bitmap.FromFile(@"C:\Temp\img.jpg");

    Read the article

  • Simplemodal: four times on a page leads to extra "next" or "previous" button

    - by DDF
    We are experiencing a problem with each instance of the call to the simplemodal div class .basic-modal-content adding an extra next or previous button in the modal windows. We are using simplemodal in four places on a page using a common JS in the container (provided below) and a common CSS format for the modal windows. In one area we are using six "statements" in a window with a next and previous button. I would include a picture of the modal window but it's being disallowed by the system as I'm a first time poster to this forum. In the other three areas we are using three "biographies" in a similar window with the ability to see each of the three bios from each of modal windows. We are using a common Simplemodal JS script in the page which has the following code: <script> $(function() { $('a').each(function() { $(this).click(function() { $('#modal_' + this.id).modal({ overlayClose:true }); }); }); var num_divs = $('div.basic-modal-content').length; $('div.basic-modal-content').each(function(i) { /* if there is a previous div add a link to it */ if (i > 0) { /* get the ID for previous div */ var prev_id = $(this).prev('.basic-modal-content').attr('id'); /* add the link with click event */ $('<a href="#" class="simplemodal-container-prev"></a>') .click(function() { $.modal.close(); $('#' + prev_id).modal({overlayClose:true}); }) .appendTo($(this)); } /* if there is a next div add a link to it */ if (i < num_divs - 1) { /* get the ID for next div */ var next_id = $(this).next('.basic-modal-content').attr('id'); /* add the link with click event */ $('<a href="#" class="simplemodal-container-next"></a>') .click(function() { $.modal.close(); $('#' + next_id).modal({overlayClose:true}); }) .appendTo($(this)); } }); }); </script> and some CSS to create an image for each window that shows the progress bar through the ul/li list. The code to produce the above looks like this: <h1>Our HEADLINE</h1> <div id='basic-modal'> <ul> <li><a href='#' id='one'>TEXT 1</a></li> <li><a href='#' id='two'>TEXT 2</a></li> <li><a href='#' id='three'>TEXT 3</a></li> <li><a href='#' id='four'>TEXT 4</a></li> <li><a href='#' id='five'>TEXT 5</a></li> <li><a href='#' id='six'>TEXT 6</a></li> </ul> </div> <div class="basic-modal-content" id="modal_one"> <img src="link to modal_one.png" alt="progress bar"/> <h3>headline text</h3> <p>body text</p> </div> <div class="basic-modal-content" id="modal_two"> <img src="link to modal_two.png" alt="progress bar"/> <h3>headline text</h3> <p>body text</p> </div> <div> ... other divs 3 4 and 5 </div> <div class="basic-modal-content" id="modal_six"> <img src="link to modal_six.png" alt="progress bar"/> <h3>headline text</h3> <p>body text</p> </div> </div> The ul/li structure works on the main page for the links. The modal windows allow one to browse through all of the six TEXTs. There is a common CSS style to the windows and a custom image in each of the modal windows derived from the "#modal_[number] img" CSS in the form of a progress bar. It should be noted that the first modal window in the first set of ul/li (the six) do not exhibit the extra previous button. Here is the relevant code from one of the three biographic links. You will note that the biographic links each have to have all three in this current configuration. <h4>Our HEADLINE</h4> <div class="bottom-widget-text"> <img src="picture" alt="not relevant to the simplemodal problem"/> <p>Read about person NUMBER 1 by clicking on the following link: <a href='#' id='seven' >Expand</a> </p> </div> <div class="basic-modal-content" id="modal_seven"> <img src="link to modal_seven.png" alt="portrait 1"/> <h3>headline text</h3> <p>BIOGRAPHY</p> </div> <div class="basic-modal-content" id="modal_eight"> <img src="link to modal_eight.png" alt="portrait 2"/> <h3>headline text</h3> <p>BIOGRAPHY</p> </div> <div class="basic-modal-content" id="modal_nine"> <img src="link to modal_nine.png" alt="portrait 3"/> <h3>headline text</h3> <p>BIOGRAPHY</p> </div> </div> Similarly the "biographies" open up from a different area of the page. The modal windows allow one to browse through all three of the BIOs. The bios use the SAME CSS style windows and a custom image in each of the modal windows derived from the "#modal_[number] img" CSS in the form of a portrait. Everything is working well except one thing: the first six windows have an extra next button that leads to an image of the close widow button only. Similarly, the BIOs pages have extra previous button that leads to the same "close button only" shown above. We want to maintain the same base CSS for the modal windows for this page. We want to keep the JS simple. The only behavior that is bad is the extra previous and next bottons that appear to be spurious. So is this a fix to the JS? Or do I have the instances of the modal windows too entangled? Perhaps there is a better method for having multiple instances of a simplemodal window on the same page? Or is the problem the "#" variable being common to each of the uses of the JS? Thanks in advance. DDF

    Read the article

  • Jquery fadeOut looking different in FF than in Chrome/Safari

    - by StealthRT
    Hey all, i have a page that when a user desides to delete a company, it fades out using the jquery fadeOut() command. This works great and does as it should in FireFox but for some reason it doesn't do the same in Chrome/Safari browsers. The problem is that i have a png image overlay on top of the company logo image that also fades out with the company logo. But if there are more than one company logo on the page, it moves the others in the place where the one got deleted. Like i said, it works fine (and as it should) in Firefox and even IE (SHOCK!) but not in Chrome or Safari. This is the code i use to delete (fade out) the section: $('#moreInfoM' + theNum).fadeOut("slow"); $('#moreInfo' + theNum).fadeOut("slow"); $('#liNum' + theNum).fadeOut("slow"); Where moreInfoM, moreInfo & liNum are all within the code for each logo image. TheNum is just a unique number for each logo just for reference. And the ASP code: For iLoop = LBound(compNames) to UBound(compNames) theWidth = (iwidth / 2) ImgDimension(Server.MapPath("img/company/" & compNames(iLoop) & ".jpg")) theWidth = (iwidth / 2) response.write "<li onClick=""$('#moreInfo" & y & "').slideToggle('slow');"" id=""liNum" & y & """>" & vbcr if theBrowser = "chrome" or theBrowser = "safari" then response.write "<img src=""img/clickMI.png"" width=""97"" height=""33"" style=""position:absolute;width:97px;height:33px;z-index:12;padding-top: 54px; padding-left:" & theWidth & "px;"">" & vbcr else response.write "<img src=""img/clickMI.png"" width=""97"" height=""33"" style=""position:absolute;width:97px;height:33px;z-index:12;padding-top: 50px; padding-left:" & theWidth & "px;"">" & vbcr end if response.write "<img src=""img/company/" & compNames(iLoop) & ".jpg"" height=""60"" style=""border: 1px solid #4C3C1B;padding: 2px;background-color: #CCC; margin-left: 10px; margin-right: 10px; margin-bottom: 5px; margin-top: 5px;"" id=""moreInfoM" & y & """ />" & vbcr response.write "</li>" & vbcr y = y + 1 Next I have made a video of FF and Chrome to give you a better understanding. http://www.youtube.com/watch?v=ZQaRvosvRKE Thanks! David

    Read the article

  • How to retrieve a pixel in a tiff image (loaded with JAI)?

    - by Ed Taylor
    I'm using a class (DisplayContainer) to hold a RenderedOp-image that should be displayed to the user: RenderedOp image1 = JAI.create("tiff", params); DisplayContainer d = new DisplayContainer(image1); JScrollPane jsp = new JScrollPane(d); // Create a frame to contain the panel. Frame window = new Frame(); window.add(jsp); window.pack(); window.setVisible(true); The class DisplayContainer looks like this: import java.awt.event.MouseEvent; import java.awt.geom.AffineTransform; import javax.media.jai.RenderedOp; import com.sun.media.jai.widget.DisplayJAI; public class DisplayContainer extends DisplayJAI { private static final long serialVersionUID = 1L; private RenderedOp img; // Affine tranform private final float ratio = 1f; private AffineTransform scaleForm = AffineTransform.getScaleInstance(ratio, ratio); public DisplayContainer(RenderedOp img) { super(img); this.img = img; addMouseListener(this); } public void mouseClicked(MouseEvent e) { System.out.println("Mouseclick at: (" + e.getX() + ", " + e.getY() + ")"); // How to retrieve the RGB-value of the pixel where the click took // place? } // OMISSIONS } What I would like to know is how the RGB value of the clicked pixel can be obtained?

    Read the article

  • Pear Mail + Pear mail-mime URLs corrupted

    - by Nir
    I'm using pear mail and pear mail mime to send UTF8 HTML emails. When I input urls such as //www.site.com.img they appear in the email as http:///www.site.com.img (note the three slashes). Anyone know how to use //www urls with pear-mail/mime ? To duplicate you can use the following code (taken from here) with change <?php require_once 'Mail.php'; require_once 'Mail\mime.php'; $message = new Mail_mime(); $text = 'Hello this is the Plain email'; $html = '<b>Hello</b> <img src="//www.site.com/img.src"/><hr />This is the HTML email.'; $message->setTXTBody($text); $message->setHTMLBody($html); $body = $message->get(); $extraheaders = array('From' => '[email protected]', 'Subject' => 'Subject'); $headers = $message->headers($extraheaders); $mail = Mail::factory('mail'); $mail->send('[email protected]', $headers, $body); ?> You will see the image as http:///www.site.com/img.src

    Read the article

  • correct fisheye distortion

    - by Will
    I have some points that describe positions in a picture taken with a fisheye lens. I've found this description of how to generate a fisheye effect, but not how to reverse it. How do you calculate the radial distance from the centre to go from fisheye to rectilinear? My function stub looks like this: Point correct_fisheye(const Point& p,const Size& img) { // to polar const Point centre = {img.width/2,img.height/2}; const Point rel = {p.x-centre.x,p.y-centre.y}; const double theta = atan2(rel.y,rel.x); double R = sqrt((rel.x*rel.x)+(rel.y*rel.y)); // fisheye undistortion in here please //... change R ... // back to rectangular const Point ret = Point(centre.x+R*cos(theta),centre.y+R*sin(theta)); fprintf(stderr,"(%d,%d) in (%d,%d) = %f,%f = (%d,%d)\n",p.x,p.y,img.width,img.height,theta,R,ret.x,ret.y); return ret; }

    Read the article

  • Rails + AMcharts (with export image php script) - PHP script converted to controller?

    - by Elliot
    Hey Guys, This one might be a little confusing. I'm using AMCharts with rails. Amcharts comes with a PHP script to export images called "export.php" I'm trying to figure out how to take the code in export.php and put it into a controller. Here is the code: <?php // amcharts.com export to image utility // set image type (gif/png/jpeg) $imgtype = 'jpeg'; // set image quality (from 0 to 100, not applicable to gif) $imgquality = 100; // get data from $_POST or $_GET ? $data = &$_POST; // get image dimensions $width = (int) $data['width']; $height = (int) $data['height']; // create image object $img = imagecreatetruecolor($width, $height); // populate image with pixels for ($y = 0; $y < $height; $y++) { // innitialize $x = 0; // get row data $row = explode(',', $data['r'.$y]); // place row pixels $cnt = sizeof($row); for ($r = 0; $r < $cnt; $r++) { // get pixel(s) data $pixel = explode(':', $row[$r]); // get color $pixel[0] = str_pad($pixel[0], 6, '0', STR_PAD_LEFT); $cr = hexdec(substr($pixel[0], 0, 2)); $cg = hexdec(substr($pixel[0], 2, 2)); $cb = hexdec(substr($pixel[0], 4, 2)); // allocate color $color = imagecolorallocate($img, $cr, $cg, $cb); // place repeating pixels $repeat = isset($pixel[1]) ? (int) $pixel[1] : 1; for ($c = 0; $c < $repeat; $c++) { // place pixel imagesetpixel($img, $x, $y, $color); // iterate column $x++; } } } // set proper content type header('Content-type: image/'.$imgtype); header('Content-Disposition: attachment; filename="chart.'.$imgtype.'"'); // stream image $function = 'image'.$imgtype; if ($imgtype == 'gif') { $function($img); } else { $function($img, null, $imgquality); } // destroy imagedestroy($img); ?>

    Read the article

  • pseudo class a:focus

    - by Les
    Trying to find out more about css pseudo class a:focus Am trying to adapt some code. Have tried a:focus img {border:2px solid rgb(155, 205, 255);} and a:focus img {background:rgb(155, 205, 255);} Neither work. Yet a:hover img {background:rgb(155, 205, 255);} works fine on hover. Does anyone know what I've done wrong? Les

    Read the article

  • LINQ to SQL join when there aren't results

    - by Boarder2
    Given the following database structure I'm trying to write a LINQ query that will return images grouped by tags it's associated with. So far I've got this: var images = from img in db.Images join imgTags in db.ImageTags on img.idImage equals imgTags.idImage join t in db.Tags on imgTags.idTag equals t.idTag where img.OCRData.Contains(searchText.Text) group img by new { t.TagName } into aGroup select new { GroupName = aGroup.Key.TagName, Items = from x in aGroup select new ImageFragment() { ImageID = x.idImage, ScanDate = x.ScanTime } }; Which works great. However, I also want to return Images that do not have any tags associated with them in a group of "(Untagged)" or something. I can't wrap my head around how I would do this without inserting a default tag for every image and that seems like generally not a very good solution.

    Read the article

  • CSS width fills out in IE8 Compatibility mode, works as it should in normal mode

    - by Colin
    I am trying to create a border around an image on the page, and the border works fine in IE8 Normal mode, but fills to 100% of the outer div in IE8 compatibility mode, my css is the following: .page-layout .page-header .page-image { float:left; vertical-align:top; width:170px; } .page-layout .page-header .page-image div, .page-layout .page-header .page-image img { float:left; } .page-image-imgtop { background-image:url('/Style Library/images/pagecontent-image-top-bg.png'); background-repeat:repeat-x; height:6px; float:left; clear:both; width:100%; } .page-image-imgleft { background-image:url('/Style Library/images/pagecontent-image-bg-left.png'); background-repeat:repeat-y; float:left; text-align:right; clear:both; } .page-image-imgright { margin-left:7px; padding-right:8px; background-image:url('/Style Library/images/pagecontent-image-bg-right.png'); background-repeat:repeat-y; background-position:top right; float:left; clear:both; } .page-image-imgbottom { background-image:url('/Style Library/images/pagecontent-image-bottom-bg.png'); background-repeat:repeat-x; height:6px; float:left; clear:both; width:100%; } And the following HTML: <div class="page-image"> <div class="page-image-imgleft"> <div class="page-image-imgtop"> <img src="/Style Library/images/pagecontent-image-top-left.png" style="float:left;" /> <img src="/Style Library/images/pagecontent-image-top-right.png" style="float:right" /> </div> <div class="page-image-imgright"> <img src="MAINIMAGE.jpg" style="border-width:0px;text-align:top;" /> </div> <div class="page-image-imgbottom"> <img src="/Style Library/images/pagecontent-image-bottom-left.png" style="float:left;" /> <img src="/Style Library/images/pagecontent-image-bottom-right.png" style="float:right" /> </div> </div> </div>

    Read the article

  • CSS: Chrome and Safari seem to 'add' border to width, while IE, Firefox & Opera don't

    - by Michiel
    Hey guys, I'm trying to achieve cross-browser consistency for my website, but I have been trying all day now and its driving me nuts (0.38 am here in Europe now..). It's about this page: http://www[insert-dot-here]geld[insert-dash-here]surfen[insert-dot-here]nl/uitbetalingen.html (please note that I prefer this URL not to be made crawlable for seo-bots) If you view this page in IE, Firefox or Opera, everything is fine, but in Chrome and Safari the tables are a little out of line (as you'll probably clearly notice). What seems to be the problem?; it appears to me that in Chrome and Safari the left and right border (2px) in total are added to the set table width, while in the other browsers the border is considered part of the width. The (most) relevant CSS-lines are the following ones (from the tabel.css-file, also available through the page's source file): table.uitbetaling { margin: 11px 18px 10px 19px; border: 1px solid #8ccaee; width: 498px; padding: 0; } table.uitbetaling img, table.uitbetaling td { margin: 0; border: 0; padding: 0; width: 496px; } table.uitbetaling tr { margin: 0; border: 0; padding: 0 1px 0 0; } So basically I have used a table-structure to organize images, like this; (the class of the table is 'uitbetaling') <table> <tr><td><img /></td></tr> <tr><td><img /></td></tr> ... <tr><td><img /></td></tr> </table> If, here, I set the width of 'table.uitbetaling' and 'table.uitbetaling img, table.uitbetaling td' to the same value (e.g. both 496 or 498), the 'problem' in Chrome and Safari is solved, however in Firefox the right side border is than blank. Because the right-side border can't 'fit' in anymore. 'img' and 'td' must be at least 2px more narrow than 'table.uitbetaling' for the right-border be visible in Firefox. Is there any way to solve this? Thanks so much in advance for your insights!!

    Read the article

  • jQuery find value then replace SRC

    - by Charles Web Dev
    Hello all, Can anyone see anything that is wrong with this code it just isn't working... I am tring to: get the value of #product-variants-option-0 search #preload for the relevant image and then change div.image img src to that image jQuery(document).ready(function($) { $('#product-variants-option-0').change(function() { // What is the sku of the current variant selection. var select_value = $(this).find(':selected').val(); if (select_value == "Kelly Green") { var keyword = "kly"; }; var new_src = $('#preload img[src*=keyword]'); $('div.image img').attr('src', new_src); }); }); The selection: <select class="single-option-selector-0" id="product-variants-option-0"> <option value="Kelly Green">Kelly Green</option> <option value="Navy">Navy</option> <option value="Olive">Olive</option> <option value="Cocoa">Cocoa</option> </select> I'm trying to search an unordered list: <ul id="preload" style="display:none;"> <li><img src="0z-kelly-green-medium.jpg"/></li> <li><img src="0z-olive-medium.jpg"/></li> </ul> The image I'm trying to replace is this:

    Read the article

  • JavaScript String Replace with a tricky regular expression

    - by Juri
    Hi. I'm trying to work out what regular expression I would need to change this string html = '<img style="width: 311px; height: 376px;" alt="test" src="/img/1268749322.jpg" />'; to this html = '<img width="311" height="376" alt="test" src="/img/1268749322.jpg" />'; with the help of Javascript.replace. This is my start: html = html.replace(/ style="width:\?([0-9])px*"/g, "width=\"$1\""); Can anyone help me? THANKS

    Read the article

  • How to rotate 4 images, fading between each one?

    - by Darryl Hein
    I have 4 images, which I want to fade between each other in a loop. I have something like the following: <img src="/images/image-1.jpg" id="featureImg1" /> <img src="/images/image-2.jpg" id="featureImg2" style="display:none;" /> <img src="/images/image-3.jpg" id="featureImg3" style="display:none;" /> <img src="/images/image-4.jpg" id="featureImg4" style="display:none;" /> I am up for revisions to the HTML, although I cannot use absolute positioning in this case. I am using jQuery else where on the site, so it's available. I also need to deal with an image not being loaded right away as the images are larger.

    Read the article

< Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >