Search Results

Search found 1387 results on 56 pages for 'simon grey'.

Page 51/56 | < Previous Page | 47 48 49 50 51 52 53 54 55 56  | Next Page >

  • Making an owner-draw button transparent against its arbitrary background in WINCE

    - by EndsOfInvention
    Hi I am trying to place an owner-draw button transparently onto a background. I have no trouble doing this when the background is a solid colour but if the background is an image I cannot seem to get the correct HDC (handle to device context) to Bitblt() the area that button covers. The HDC that is passed as part of the DRAWITEMSTRUCT gives me a button-default-grey area. If I attempt to get the parent of the HWND and then the device context of that i.e pdc = GetDC(GetParent(hWnd)); then the background that gets BitBlt'd is the background of the last painted window. I hope this question makes sense. this is the code I have: pdis = (LPDRAWITEMSTRUCT)(lParam); hdc = pdis->hDC; button = pdis->CtlID - IDC_BUTOFFSET; //pdc = GetDC((hWnd)); pdc = GetDC(GetParent(hWnd)); hbm = CreateCompatibleBitmap(pdc, Buttons_[button]->bc.Size.cx, Buttons_[button]->bc.Size.cy); SelectObject(hdc, hbm); BitBlt(hdc, 0, 0, Buttons_[button]->bc.Size.cx, Buttons_[button]->bc.Size.cy, pdc, Buttons_[button]->bc.Position.x, Buttons_[button]->bc.Position.y, SRCCOPY); TIA Best regards Ends

    Read the article

  • LI Background Images (.PNG) not appeared in IE6

    - by Balkar
    Hi I am using the following CSS but it never shows background images in IE6. But if I remove the filter .. AlphaLoader command, then it shows with grey background. Here is my CSS Code .fg-block1 ul, .fg-block3 ul { list-style:none; } .fg-block1 ul li, .fg-block3 ul li { padding-left:28px; background:url(images/bullet-2.png) no-repeat left top; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; border-bottom:1px dotted #fff; text-align:left; background-position:1px 0; line-height:16px; padding-bottom:5px; margin-bottom:5px; } .fg-block3 ul li { border-bottom:none; } .fg-block1 ul li a, .fg-block3 ul li a { color:#fff; text-decoration:none; } .fg-block1 ul li a:hover, .fg-block3 ul li a:hover { color:#fff; text-decoration:underline; }

    Read the article

  • Dynamic margin (or simulation of margin) between left floated divs

    - by BugBusterX
    I have a number of divs floated left. When browser is resized they move down or up based on how many can fit on the line. I was wondering if there is a way to dynamically (with css) have those divs align (or have margin) in a way, that they would always fill the entire screen space by having their marhin resize? In other words margin between them would resize while browser is resized, but as soon as another div can fit it will be added in the line, or if minimum margin is reached and passed another div goes to next line while margins expand again. Here's an example how it is now, resize the wondow to see he leftover space that I want to "fill" <html> <head> <style> .test { float:left; width: 100px; height:100px; background-color: grey; margin: 0 10px 10px 0; } </style> </head> <body> <div class="test"></div> <div class="test"></div> <div class="test"></div> <div class="test"></div> <div class="test"></div> <div class="test"></div> <div class="test"></div> <div class="test"></div> <div class="test"></div> <div class="test"></div> <div class="test"></div> <div class="test"></div> </body> </html>

    Read the article

  • Why when i rotate the image black borders appear? PHP GD

    - by EAGhost
    This code generates two images using GD and rotates one of them. When I rotate the image black borders begin to appear. Anyone have an idea of how to resolve this? imagefilledrectangle($im, 0, 0, 300, 400, $black); imagefilledrectangle($im, 1, 1, 298, 398, $grey); imagefilledrectangle($im, 49, 69, 251, 271, $black); imagefilledrectangle($im, 50, 70, 250, 270, $white); imagefttext($im, 13, 0, 90, 30, $black, $font_file, "Wind Direcction"); $source=imagecreatetruecolor(100, 100); imagefilledrectangle($source, 0, 0, 100, 100, $white); $values = array( 20, 30, // Point 1 (x, y) 50, 0, 80, 30, 65, 30, 65, 100, 35, 100, 35, 30 // Point 7 (x, y) ); imagefilledpolygon($source, $values, 7, $black1); $asd=imagerotate($source, $rotate, 0); imagecolortransparent($asd, $black); imageantialias($asd, true); $insert_x = imagesx($asd); $insert_y = imagesy($asd); if($rotate==0 || $rotate==90 || $rotate==180 || $rotate==270){ imagecopymerge ( $im , $asd , 100 , 130 , 0 , 0 , $insert_x , $insert_y , 100 ); } if($rotate==45 || $rotate==135 || $rotate==225 || $rotate==315){ imagecopymerge ( $im , $asd , 85 , 110 , 0 , 0 , $insert_x , $insert_y , 100 ); } imageantialias($im, true); header('Content-Type: image/png'); imagepng($im); imagedestroy($im); ?

    Read the article

  • UIButton only responds in a small area

    - by Tom Irving
    I'm trying to add a UIButton to a UIView, but am having some trouble with getting it to respond to touches. I have a method which returns UIButtons after I provide it with a tag: - (UIButton*)niceSizeButtonWithTag:(int)tag { UIButton * aButton = [UIButton buttonWithType:UIButtonTypeCustom]; [aButton setTag:tag]; [aButton addTarget:self action:@selector(buttonWasTapped:) forControlEvents:UIControlEventTouchUpInside]; CGRect newFrame = aButton.frame; newFrame.size.width = 44; newFrame.size.height = 44; [aButton setFrame:newFrame]; return aButton; } As you can see I'm creating a new button and increasing the size. I use this in the following way: UIButton * anotherButton = [self niceSizeButtonWithTag:1]; [anotherButton setImage:[UIImage imageNamed:@"image" withExtension:@"png"] forState:UIControlStateNormal]; [anotherButton setCenter:CGPointMake(middleOfView)]; [aView addSubview:anotherButton]; I create a lot of buttons like this, hence the reason for the method. The buttons are always created and added to the subview perfectly. I can see the image and they're in the correct position. The problem is that they only respond to touches in a tiny strip. In this attached image, The yellow shows the whole frame of the button, The red shows the area that will respond to touches. The grey shows a section of the view the button is added to. If anyone could shed some light on why this is happening, it would be really useful.

    Read the article

  • Manually Trigger or Prevent Javascript Lazy Loading in Website from Bookmarklet

    - by stwhite
    One of the problems with using a bookmarklet for grabbing images on a page is that if a website uses lazy loading, the bookmarklet won't detect the image because it will have a placeholder, e.g. "grey.gif" and not the actual source of the image. Javascript on page load, is run to replace these urls. I'm looking for a solution to retrieve those images that are not being displayed by either triggering or preventing Lazy Loading from running. This bookmarklet isn't limited to one specific domain. So far some ideas I've had are: Ping the domain and retrieve the page html if no images are found the first time around: Problem: this then requires parsing the actual html. Problem: with lazy loading, a few images will always show, just none below the fold. Scroll page to initiate lazy loading when bookmarklet is clicked, then scroll back to top. Trigger Lazy Loading from inside bookmarklet using script. Lazy Loader adds the "original" attribute, potentially could check if attribute exists w/ value. Problem: ???

    Read the article

  • Google Maps: Simple app not working on IE

    - by Peter Bridger
    We have a simple Google Maps traffic application up at: http://www.avonandsomerset.police.uk/newsroom/traffic/ For some reason it's recently stopped working in IE correctly. At this point in time it was using V2 of the API, so I've just upgraded it to use V3 - but it still won't work in IE. It works fine in Chrome & Firefox. But in all versions of IE I've tired (6,7,8) the Google Map doesn't load fully. The problem The Google Map DIV will generally load all the controls (Zoom, Powered by Google, map types) but the actual map tiles do not appear in IE. I can just see the grey background of the DIV What I've tried I've commented down the JavaScript code to just the following on the page, but it still has the same problem: <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> <script type="text/javascript" > var map; $(document).ready(function () { initialize(); // Set-up Google map }); function initialize() { var options = { zoom: 9, center: new google.maps.LatLng(51.335759, -2.870178), mapTypeId: google.maps.MapTypeId.ROADMAP }; map = new google.maps.Map(document.getElementById("googleMap"), options); } </script>

    Read the article

  • Problem shrinking with StretchBlt()

    - by SparkyNZ
    Hi. I have some code that paints my own rectangular buttons based on a source bitmap. Most of the time the destination buttons are bigger than my source bitmap image and StretchBlt works fine. However, when the destination is smaller than the source image, StretchBlt refuses to fill the entire destination area. I know StretchBlt isn't great on quality when it comes to scaling down images but I'm not too concerned about that. I just don't want missing pixels. Here a link with the source image at the top and destination at the bottom: link text Note, I am actually shrinking parts of the source image into the destination. I am not shrinking the entire image down. So for example, I copy the corners size for size with BitBlt() then I stretch (squash) the horizontal pixel data between the corners from the source image into the destination DC. There is no fault with my source and destination coordinates. If I change from SRCCOPY to WHITENESS, the entire area fills with white as you'd expect. There is no grey bar where pixels haven't copied as you see in the Broken.bmp image above. Has anyone had this problem before, and if so, can somebody please suggest a solution? Cheers

    Read the article

  • Display one div if nothing is selected

    - by Levani
    I use this javascript to display different div classes upon selection. I need to display one div class if nothing is selected, for example when page is loaded, and that replace it with one of the divs according to the selection... <script type="text/javascript"><!-- var lastDiv = ""; function showDiv(divName) { // hide last div if (lastDiv) { document.getElementById(lastDiv).className = "hiddenDiv"; } //if value of the box is not nothing and an object with that name exists, then change the class if (divName && document.getElementById(divName)) { document.getElementById(divName).className = "visibleDiv"; lastDiv = divName; } } //--> </script> css: <style type="text/css" media="screen"><!-- .hiddenDiv { display: none; } .visibleDiv { display: block; border: 1px grey solid; } --></style> HTML: <form id="FormName" action="blah.php" method="get" name="FormName"> <select name="selectName" size="1" onChange="showDiv(this.value);"> <option value="">Choose One...</option> <option value="one">first</option> <option value="two">second</option> <option value="three">third</option> </select> </form> <p id="one" class="hiddenDiv">This is paragraph 1.</p> <p id="two" class="hiddenDiv">This is paragraph 2.</p> <p id="three" class="hiddenDiv">This is paragraph 3.</p> Can anyone please help?

    Read the article

  • Simple css class selector issue

    - by FlyingCat
    I am having a problem with a simple first of type css issue I have <div class='test'> <div>test 1</div> <div>test 2</div> </div> <div class='test'> <div>test 3</div> <div>test 4</div> </div> <div class='test'> <div>test 5</div> <div>test 6</div> </div> I want the first test div showing background red and the rest are blue. I have .test{ background-color: blue; margin: 15px; border-top: dashed 1px grey; } .test:first-of-type{ background-color: red; border-top:0; } but all my divs are showing blue. Am I doing something wrong here? Thanks for the help!

    Read the article

  • jQuery - disable selected options

    - by Jeffrey
    Need to disable already selected options in select box using jQuery. I'd like it to grey out like asmselect. Test my example here. //JS $("#theSelect").change(function(){ var value = $("#theSelect option:selected").val(); var theDiv = $(".is" + value); theDiv.slideDown().removeClass("hidden"); }); $("div a.remove").click(function () { $(this).parent().slideUp(function() { $(this).addClass("hidden"); }); }); //HTML <body> <div class="selectContainer"> <select id="theSelect"> <option value="">- Select -</option> <option value="Patient">Patient</option> <option value="Physician">Physician</option> <option value="Nurse">Nurse</option> </select> </div> <div class="hidden isPatient">Patient <a href="#" class="remove" rel="Patient">remove</a></div> <div class="hidden isPhysician">Physician <a href="#" class="remove" rel="Patient">remove</a></div> <div class="hidden isNurse">Nurse <a href="#" class="remove" rel="Patient">remove</a></div> </body>

    Read the article

  • Fitting Text into an Image

    - by Abs
    Hello all, I have a function which takes in a font (ttf or otf file) and generates an image of text in different fonts. The problem I have is trying to work out how I can make the text fit in the image regardless of the font-size, type of font, and amount of text. I have tried to make the image rectangle variable so that it contains the text of different fonts without cutting a bit of the text since the image is not long or wide enough. Here is the function that I currently have, I have tried using the number of characters to determine the width of the image, but in some cases for some fonts and sizes, it still gets cut off. function generate_image($save_path, $text, $font_path){ $length = strlen($text) * 15; // Create the image $im = imagecreatetruecolor($length, 40); $white = imagecolorallocate($im, 255, 255, 255); $grey = imagecolorallocate($im, 128, 128, 128); $black = imagecolorallocate($im, 0, 0, 0); imagefilledrectangle($im, 0, 0, $length, 40, $white); $font = $font_path; imagettftext($im, 30, 0, 0, 25, $black, $font, $text); if(imagepng($im, $save_path)){ $status = true; }else{ $status = false; } imagedestroy($im); return $status; } Thank you all for any help

    Read the article

  • Automating Excel 2010 using F#

    - by Clive Norman
    I have been searching for a FAQ to tell me how to open a Excel Workbook/Worksheet and also how to Save the File once I have finished. I notice that in most FAQ and all the books I have purchased on F# one is show how to create a new Workbook/Worksheet but is never shown how to either open or Save it. Being a newbie to F# I would very much appreciate it if anyone could kindly provide me with either an answer or perhaps a few pointers? Update As for why F# and not C# or VB? I am pleased to say that inspite of being a newbie (with the exception of Forth, VBA & Excel 2003, 2007 & 2010 and Visual Basic) I can do this in both VB, VBA & C# and since I've been retired on medical grounds, with plenty of time unfortunately on my hands, I like to continually set myself challenges to keep my little grey cells active and being a sucker for trying new languages....well! F# is now an intergral part of Visual Studio 2010 so I thought - why not. Consider this - if we are not willing to use or at least try a new languages - I would always be wonder if I might have prefer it to VBA, VB, C# ..... and if you look at it from another point of view, if no one is going to use it - why create it in the first place? I suppose you can say if cave men hadn't experimented and made fire by rubbing two sticks together - where would we be now and would matches have been invented? Although an complete answer would be good, I prefer a few pointers, to keep my challenge going. And lastly but not least - thank you for taking the trouble to respond!

    Read the article

  • Layout resize animation

    - by Marcin Sosna
    I have layout: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <LinearLayout android:id="@+id/main_fragment_container" android:layout_width="fill_parent" android:layout_height="fill_parent"> <RelativeLayout android:id="@+id/left_fragments_layout" android:layout_width="0dip" android:layout_height="fill_parent" android:layout_weight="1" android:background="#00F"> </RelativeLayout> <RelativeLayout android:id="@+id/graph_fragment_container" android:layout_width="0dip" android:layout_height="fill_parent" android:layout_weight="2.2" android:background="#666"> </RelativeLayout> <RelativeLayout android:id="@+id/right_fragments_layout" android:layout_width="0dip" android:layout_height="fill_parent" android:layout_weight="1" android:background="#00F"> </RelativeLayout> When I set visibility to GONE on left and right fragment container then they are animated to left and right. I try to set scale animation on resize center graph_fragment_container, my code: <scale android:fromXScale="100%" android:toXScale="50%" android:fillAfter="true" android:fillEnabled="true" android:duration="7000" /> Java code: Animation toLeftOut = AnimationUtils.loadAnimation( MainActivity.this, R.anim.to_left_out ); Animation toRightOut = AnimationUtils.loadAnimation( MainActivity.this, R.anim.to_right_out ); Animation scale = AnimationUtils.loadAnimation( MainActivity.this, R.anim.scal ); graphContainer.startAnimation( scale ); leftFragmentsLayout.startAnimation( toLeftOut ); rightFragmentsLayout.startAnimation( toRightOut ); Now graphContainer was resize after right and left layout animation end, and user see a grey backgound before center layout was resize.

    Read the article

  • Leftover Nav Bar in Landscape View

    - by Rob Bonner
    Hello, I am working to force a view into landscape mode, and have picked up all kinds of cool tips to make this happen, but am stuck on one item that is left on the screen. I have my XIB file laid out in landscape, and in my code I create the view controller normally: RedeemViewController *aViewController = [[RedeemViewController alloc] initWithNibName:@"RedeemViewController" bundle:nil]; aViewController.hidesBottomBarWhenPushed = YES; aViewController.wantsFullScreenLayout = YES; [[self navigationController] pushViewController:aViewController animated:YES]; Inside the controller viewDidLoad I complete the following: [[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeRight]; [[self navigationController] setNavigationBarHidden:YES animated:YES]; [UIView beginAnimations:@"View Flip" context:nil]; [UIView setAnimationDuration:.75]; [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; if (self.interfaceOrientation == UIInterfaceOrientationPortrait) { self.view.transform = CGAffineTransformIdentity; self.view.transform = CGAffineTransformMakeRotation(degreesToRadian(90)); self.view.bounds = CGRectMake(0.0, 0.0, 480, 320); } [UIView commitAnimations]; What I end up with is a perfectly rotated view, with a grey vertical bar on the left side (see pic). So to the question, how do I get rid of the bar? Edit: I am pretty sure this is the navigation bar that is not being hidden. This is a duplicate of another post, with some modified code, the other question was being answered with the bug.

    Read the article

  • Fast path cache generation for a connected node graph

    - by Sukasa
    I'm trying to get a faster pathfinding mechanism in place in a game I'm working on for a connected node graph. The nodes are classed into two types, "Networks" and "Routers." In this picture, the blue circles represent routers and the grey rectangles networks. Each network keeps a list of which routers it is connected to, and vice-versa. Routers cannot connect directly to other routers, and networks cannot connect directly to other networks. Networks list which routers they're connected to Routers do the same I need to get an algorithm that will map out a path, measured in the number of networks crossed, for each possible source and destination network excluding paths where the source and destination are the same network. I have one right now, however it is unusably slow, taking about two seconds to map the paths, which becomes incredibly noticeable for all connected players. The current algorithm is a depth-first brute-force search (It was thrown together in about an hour to just get the path caching working) which returns an array of networks in the order they are traversed, which explains why it's so slow. Are there any algorithms that are more efficient? As a side note, while these example graphs have four networks, the in-practice graphs have 55 networks and about 20 routers in use. Paths which are not possible also can occur, and as well at any time the network/router graph topography can change, requiring the path cache to be rebuilt. What approach/algorithm would likely provide the best results for this type of a graph?

    Read the article

  • Durandal Google Maps not showing properly

    - by user1891037
    Trying to show Google Maps using the Durandal. I'm now simply working with Durandal HTML Starter Kit so the other modules and all engine works properly. The thing is when I added the Google Map it doesn't fit the div size (the big part of div is just grey). As I understand, the problem is causing because Google Maps added before page is completely loaded. But I can't figure out how can I hook on page load event. Here is the module code: define(['knockout', 'gmaps'], function (ko, gmaps) { return { displayName: 'Google Maps', myMap: ko.observable({ lat: ko.observable(32), lng: ko.observable(10)}), activate: function () { console.log('activate'); ko.bindingHandlers.map = { init: function (element, valueAccessor, allBindingsAccessor, viewModel) { console.log('init'); var mapObj = ko.utils.unwrapObservable(valueAccessor()); var latLng = new gmaps.LatLng( ko.utils.unwrapObservable(mapObj.lat), ko.utils.unwrapObservable(mapObj.lng)); var mapOptions = { center: latLng, zoom: 5, mapTypeId: gmaps.MapTypeId.ROADMAP}; mapObj.googleMap = new gmaps.Map(element, mapOptions); } } }, attached: function() { console.log('attached'); }, compositionComplete: function() { console.log('compositionComplete'); } }; }); And a very simple HTML code: <section> <div id="gmap-canvas" data-bind="map:myMap"></div> </section> I'm loading Google Maps with async plug-in in my shell.js. It works fine. Screenshot with trouble here - http://clip2net.com/s/ibswAa P.S. div size is defined in .CSS file. P.S. I tried to use getElementById approach provided here and it's work great if placed in compositionComplete block. But when I tried to move my bindings to this block nothing happens at all. Thanks!

    Read the article

  • Setting up padding for websites in mobile devices

    - by ambrelasweb
    I had finished this website a while ago but something happened to it and I've now spent all day fixing it and getting it back from scratch as my backup wasn't correctly done. I don't quite understand what it's doing as I've done this technique on many other websites with no troubles, maybe I've looked at this website too long? Here is the website. I'm wanting to put some space on the left and right hand side, however I dont just have one container as I was needing the dark grey bar at 100% of the screen and always under the banner no matter where it was. So there are 4 "containing" divs that I want to have the space. I've placed soem CSS3 media queries in but now I'm getting a gap to the right. I was thinking it was because my background mages are going all the way across but they set at 100% so I'm just not understanding whats going on. It's somethign simple, I'm not seeing it right now.. This is what I have for the media queries /* Smartphones (portrait and landscape) ----------- */ @media only screen and (min-device-width : 320px) and (max-device-width : 480px) { #header, #banner, #main, #footer-widget-area { padding: 0 2em 0 2em; } } This is what t looks like on my iPhone Any advice is helpful and appreciated.

    Read the article

  • How to merge two icons together? (overlay one icon on top of another)

    - by demoncodemonkey
    I've got two 16x16 RGB/A .ICO icon files, each loaded into a separate System.Drawing.Icon object. How would you create a new Icon object containing the merge of the two icons (one overlaid on top of the other)? Edit: I probably wasn't too clear, I don't want to blend two images into each other, I want to overlay one icon on top of another. I should add that the icons already contain transparent parts and I do not need any transparent "blending" to make both icons visible. What I need is to overlay the non-transparent pixels of one icon over the top of another icon. The transparent pixels should let the background icon show through. For example, look at the stackoverflow icon. It has some areas that are grey and orange, and some areas that are totally transparent. Imagine you want to overlay the SO icon on top of the Firefox icon. You would see the greys and oranges of the SO icon in full colour, and where the SO icon is transparent, you would see those parts of the Firefox icon.

    Read the article

  • CSS to create curved corner between two elements?

    - by Tauren
    My UI has an unordered list on the left. When a list item is selected, a div appears on the right of it. I'd like to have a curved outer corner where the <li> and the <div> meet. See the white arrow in the image below. To extend the blue <li> to the edge of the <ul>, I'm planning to do something like this: li { right-margin: 2em; border-radius: 8px; } li.active { right-margin: 0; border-bottom-right-radius: 0; border-top-right-radius: 0; } Is there a better way to extend the <li> to the edge of the <ul>? Obviously, I'll include the webkit and mozilla border radius CSS as well. The main thing I'm unsure about is that outer corner underneath the bottom right corner of the active <li>. I have some ideas, but they seem like hacks. Any suggestions? NOTE that the <ul> is indicated in grey, but it would be white in the real design. Also, I'm planning to use Javascript to position the <div> correctly when an <li> is selected.

    Read the article

  • Speed comparison - Template specialization vs. Virtual Function vs. If-Statement

    - by Person
    Just to get it out of the way... Premature optimization is the root of all evil Make use of OOP etc. I understand. Just looking for some advice regarding the speed of certain operations that I can store in my grey matter for future reference. Say you have an Animation class. An animation can be looped (plays over and over) or not looped (plays once), it may have unique frame times or not, etc. Let's say there are 3 of these "either or" attributes. Note that any method of the Animation class will at most check for one of these (i.e. this isn't a case of a giant branch of if-elseif). Here are some options. 1) Give it boolean members for the attributes given above, and use an if statement to check against them when playing the animation to perform the appropriate action. Problem: Conditional checked every single time the animation is played. 2) Make a base animation class, and derive other animations classes such as LoopedAnimation and AnimationUniqueFrames, etc. Problem: Vtable check upon every call to play the animation given that you have something like a vector<Animation>. Also, making a separate class for all of the possible combinations seems code bloaty. 3) Use template specialization, and specialize those functions that depend on those attributes. Like template<bool looped, bool uniqueFrameTimes> class Animation. Problem: The problem with this is that you couldn't just have a vector<Animation> for something's animations. Could also be bloaty. I'm wondering what kind of speed each of these options offer? I'm particularly interested in the 1st and 2nd option because the 3rd doesn't allow one to iterate through a general container of Animations. In short, what is faster - a vtable fetch or a conditional?

    Read the article

  • Why pseudo-elements :before and :after appear in front of my DIV element and not behind?

    - by Dim13i
    I have a DIV element with this given class: .slideshow { background: white; width: 700px; height: 300px; padding:10px; margin: 0 auto; position: relative; box-shadow: 0px 0px 5px grey, 0px 10px 20px rgba(0,0,0,.1) inset; } I define those two pseudo-elements (:before and :after): .slideshow:before, .slideshow:after { content: " "; background: green; width: 50%; height: 50%; position: absolute; z-index: -10; } My problem is that those two pseudo-elements appear in front of my DIV and not behind. Is there any specific reason for this behaviour? Here is an example: EXAMPLE The Javascript part is a bit messy but i'm still working on it. Also I've noticed that if I delete all the JS part I don't have anymore this problem, but I don't think there is anything in the code that should modify the slideshow DIV SOLVED: The problem is in the javascript part where I have: $('.slideshow').css('-webkit-transform', 'rotate(0deg)'); Removing this line solved the problem. I guess that pseudo-elements :before and :after are not compatible with the property transform.

    Read the article

  • Best "Loading" feedback for ASP.Net?

    - by IP
    So, we have an ASP.Net application - fairly standard - and in there are lots of updatepanels, and postbacks. On some pages we have <ajax:UpdatePanelAnimationExtender ID="ae" runat="server" TargetControlID="updatePanel" BehaviorID="UpdateAnimation"> <Animations> <OnUpdating> <FadeOut Duration="0.1" minimumOpacity=".3" /> </OnUpdating> <OnUpdated> <FadeIn minimumOpacity=".5" Duration="0" /> </OnUpdated> </Animations> </ajax:UpdatePanelAnimationExtender> Which basically whites out the page when a postback is going on (but this clashes with modal dialog grey backgrounds). In some cases we have a progressupdate control which just has a spinny icon in the middle of the page. But none of them seem particularly nice and all a bit clunky. They also require a lot of code in various places around the app. What methods do other people use and find effective?

    Read the article

  • Opencv video frame not showing Sobel output

    - by user1016950
    This is a continuation question from Opencv video frame giving me an error I think I closed it off, Im new to Stackoverflow. I have code below that Im trying to see its Sobel edge image. However the program runs but the output is just a grey screen where if I mouseover the cursor disappears. Does anyone see the error? or is it a misunderstanding about the data structures Im using IplImage *frame, *frame_copy = 0; // capture frames from video CvCapture *capture = cvCaptureFromFile( "lightinbox1.avi"); //Allows Access to video propertys cvQueryFrame(capture); //Get the number of frames int nframe=(int) cvGetCaptureProperty(capture,CV_CAP_PROP_FRAME_COUNT); //Name window cvNamedWindow( "video:", 1 ); //start loop for(int i=0;i<nframe;i++){ //prepare capture frame extraction cvGrabFrame(capture); cout<<"We are on frame "<<i<<"\n"; //Get this frame frame = cvRetrieveFrame( capture ); con2txt(frame); frame_copy = cvCreateImage(cvSize(frame->width,frame->height),IPL_DEPTH_8U,frame->nChannels ); //show and destroy frame cvCvtColor( frame,frame,CV_RGB2GRAY); //Create Sobel output frame_copy1 = cvCreateImage(cvSize(frame->width,frame->height),IPL_DEPTH_16S,1 ); cvSobel(frame_copy,frame_copy1,2,2,3); cvShowImage("video:",frame_copy1); cvWaitKey(33);} cvReleaseCapture(&capture);

    Read the article

  • Implementations details of drag and drop of file path in cocoa.

    - by foo
    Hi, I'm trying to get a part of my window to react to drag and drop. In this case to copy the file path to the file being dropped on the view. I have looked over some documentation but I still have some problems to see exactly where I should implement my methods for drag and drop. I have seen some examples but almost all of them assumes that I want to drop an image on the view. I'm pretty new to cocoa and Xcode so, I have some problems with seeing the exact relation between interface builder and the generated code. I have created a subclass to NSView, called drop zone like this: #import <Cocoa/Cocoa.h> @interface dropZone : NSView { } @end I then use an NSRect to color it grey like this: #import "dropZone.h" @implementation dropZone - (void)drawRect:(NSRect)rect { NSRect bounds = [self bounds]; [[NSColor grayColor] set]; [NSBezierPath fillRect:bounds]; } @end I then drag this class to my window in interface builder. But I will need to implement the registerForDraggingTypes method, but where? I have also seen a convenience method in the Apple docs for file paths like this: dragFile:fromRect:slideBack:event: that might work.

    Read the article

< Previous Page | 47 48 49 50 51 52 53 54 55 56  | Next Page >