Search Results

Search found 4126 results on 166 pages for 'barney white'.

Page 57/166 | < Previous Page | 53 54 55 56 57 58 59 60 61 62 63 64  | Next Page >

  • HTML/CSS issue with a:hover and spans

    - by Tribalcomm
    Any way I can get this working? I have a block of code: <p><a href="http://foo.com"><span class="title">Title</span><br /><br /> Some text no greater than a couple of lines...</a></p> My styles are: p {color:#FFF;} a {color:#999;} .title {color:#FFF; font-weight:bold;} a:hover {color:#FF0;} My problem is as follows: I want the title to be white and bold and the body to be gray, but when you hover over any part, I want the title AND text to become yellow. However, in the above scenario, only the text becomes yellow because the span color (white) overrides the a:hover. If I add: .title:hover {color:#FF0;} then the title color only changes if I specifically hover over the title. It also doesn't change the text to yellow, as it is now a span hover... Any way I can resolve this, even if it requires a little JS? Thanks!

    Read the article

  • XSLT Built-in Template Rules for attributes

    - by Martin Smith
    I'm sure that this is an extremely basic question but here goes anyway! I have read that the built in template rule for text and attribute nodes in XSLT is <xsl:template match="text()|@*"> <xsl:value-of select="."/> </xsl:template> However for the source document <?xml version="1.0"?> <booker> <award> <author blah="test">Aravind Adiga</author> <title>The White Tiger</title> <year>2008</year> </award> </booker> And XSLT <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="text"/> </xsl:stylesheet> I get the following output applying the transform in Visual Studio. Can someone please explain why I don't see "test" in the output? Aravind Adiga The White Tiger 2008

    Read the article

  • latex padding / margin hell

    - by darren
    hi everyone I have been wrestling with a latex table for far too long. I need a table that has has centered headers, and body cells that contain text that may wrap around. Because of the wrap-around requirement, i'm using p{xxx} instead of l for specifying cell widths. The problem this causes is that cell contents are not left justified, so the look like spaced-out junk. To fix this problem I'm using \flushleft for each cell. This does left justify contents, but puts in a ton of white space above and below the contents of the cell. Is there a way to stop \flushleft (or \center for that matter) to stop adding copious amounts of verical whitespace? thanks \begin{landscape} \centering % using p{xxx} here to wrap long text instead of overflowing it \begin{longtable}{ | p{4cm} || p{3cm} | p{3cm} | p{3cm} | p{3cm} | p{3cm} |} \hline & % these are table headings. the \center is causing a ton of whitespace as well \begin{center} \textbf{HTC HD2} \end{center} & \begin{center} \textbf{Motorola Milestone} \end{center} & \begin{center} \textbf{Nokia N900} \end{center} & \begin{center} \textbf{RIM Blackberry Bold 9700} \end{center} & \begin{center} \textbf{Apple iPhone 3GS} \end{center} \\ \hline \hline % using flushleft here to left-justify, but again it is causing a ton of white space above and below cell contents. \begin{flushleft}OS / Platform \end{flushleft}& \begin{flushleft}Windows Mobile 6.5 \end{flushleft}& \begin{flushleft}Google Android 2.1 \end{flushleft}& \begin{flushleft}Maemo \end{flushleft}& \begin{flushleft}Blackberry OS 5.0 \end{flushleft}& \begin{flushleft}iPhone OS 3.1 \end{flushleft} \\ \hline

    Read the article

  • Drawing a relative line in C#

    - by icemanind
    Guys, I know this is going to turn out to be a simple answer, but I can't seem to figure it out. I have a C# Winform application that I am trying to build. I am trying to draw a white line 60 pixels above the bottom of the form. I am using this code: private void MainForm_Paint(object sender, PaintEventArgs e) { e.Graphics.DrawLine(Pens.White, 10, this.Height-60, 505, this.Height-60); } Simple enough, however no line is drawn. After some debugging, I figured out that it IS drawing the line, but it is drawing it outside my form. If I change the -60 to -175, then I can see it at the bottom of my form. This would solve my problem, except as my form's height changes, the line draws closer and closer to the bottom of my form until eventually, its off the form again. What am I doing wrong? Am I using the wrong graphics unit? Or is there a more complex calculation I need to do to determine 60 pixels from the bottom of my form?

    Read the article

  • asp.net calendar control appears below textfield

    - by user279521
    I ma using an image button to display an asp.net calendar control (this control comes with VS 2008). However, when I click the image button, the calendar controls is displayed "below" the textfield that it is suppoed to populate. How can I get the control to appear on the right side of the textfield? My code is: <asp:ImageButton ID="imgCalendar" runat="server" Height="17px" ImageUrl="~/Images/CAL.gif" onclick="imgCalendar_Click1" Width="19px" Visible="true" ImageAlign="Middle" /> <asp:Panel ID="Panel1" runat="server"> <asp:Calendar ID="calStartDate" runat="server" BackColor="Transparent" BorderColor="#FFCC66" BorderWidth="1px" DayHeaderStyle-BackColor="gainsboro" DayNameFormat="Shortest" FirstDayOfWeek="Monday" Font-Bold="True" Font-Names="Verdana" Font-Size="8pt" ForeColor="Gray" Height="102px" OnSelectionChanged="calStartDate_SelectionChanged" OtherMonthDayStyle-ForeColor="gray" SelectedDayStyle-BackColor="Navy" SelectedDayStyle-Font-Bold="True" SelectorStyle-BackColor="gainsboro" ShowGridLines="True" TitleStyle-BackColor="gray" TitleStyle-Font-Bold="True" TitleStyle-Font-Size="12px" TodayDayStyle-BackColor="gainsboro" Visible="False" Width="62px"> <SelectedDayStyle BackColor="#404040" Font-Bold="True" /> <TodayDayStyle BackColor="#3A080B" ForeColor="White" /> <SelectorStyle BackColor="#FFCC66" /> <OtherMonthDayStyle ForeColor="#CC9966" /> <NextPrevStyle Font-Size="9pt" ForeColor="#3A080B" /> <DayHeaderStyle BackColor="#3A080B" Font-Bold="True" Height="1px" ForeColor="White" /> <TitleStyle BackColor="#E0C16B" Font-Bold="True" Font-Size="9pt" ForeColor="#3A080B" /> </asp:Calendar> </asp:Panel>

    Read the article

  • Reduce size and change text color of the bootstrap-datepicker field

    - by Lisarien
    Programing an Android application based on HTML5/JQuery launching in a web view, I'm using the Eternicode's bootstrap-datepicker. BTW I'm using Jquery 1.9.1 and Bootstrap 2.3.2 with bootstrap-responsive. The picker is working fine but unfortunately I get yet two issues which I was not able to solve at this time: the picker theme is not respected and some dates are not readable (see the attached picture). Some there is css conflict such as the datepicker's font is displayed white on white background. I'm not able to reduce the size of the date picker field such as it holds on alone row. My markup code is: <div class="row-fluid" style="margin-right:0px!important"> <label id="dateId" class="span6">One Date</label> <div id="datePurchase" class="input-append date"> <input data-format="yyyy-MM-dd" type="text" /> <span class="add-on"> <i data-time-icon="icon-time" data-date-icon="icon-calendar"></i> </span> </div> </div> I init the datepicker by Javascript: $("#dateId").datetimepicker({ pickTime: false, format: "dd/MM/yyyy", startDate: startDate, endDate: endDate, autoclose: true }); $("#dateId").on("changeDate", onChangeDate); Do you get any idea about these issues? Thanks very much

    Read the article

  • How to customize HeaderTemplate of ValidationSummary Silverlight control?

    - by BravcM
    Hello, I'd like to customize HeaderTemplate of ValidationSummary control from Silverlight Toolkit and display localized Header. But I cant figure out how to display error counter right to header's text ... Can anybody help me with this? My current XAML code ... <sdk:ValidationSummary Grid.Row="3"> <sdk:ValidationSummary.HeaderTemplate> <DataTemplate> <Grid Background="Red"> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto" /> <ColumnDefinition Width="Auto" /> </Grid.ColumnDefinitions> <TextBlock UseLayoutRounding="False" Foreground="White" Text="Editing Errors:" /> <TextBlock UseLayoutRounding="True" Foreground="White" FontWeight="Bold" Text="{Binding DisplayedErrors.Count}" Grid.Column="1" /> </Grid> </DataTemplate> </sdk:ValidationSummary.HeaderTemplate> Thanks in advance!

    Read the article

  • Finding a picture in a picture with java?

    - by tarrasch
    what i want to to is analyse input from screen in form of pictures. I want to be able to identify a part of an image in a bigger image and get its coordinates within the bigger picture. Example: would have to be located in And the result would be the upper right corner of the picture in the big picture and the lower left of the part in the big picture. As you can see, the white part of the picture is irrelevant, what i basically need is just the green frame. Is there a library that can do something like this for me? Runtime is not really an issue. What i want to do with this is just generating a few random pixel coordinates and recognize the color in the big picture at that position, to recognize the green box fast later. And how would it decrease performance, if the white box in the middle is transparent? The question has been asked several times on SO as it seems without a single answer. I found i found a solution at http://werner.yellowcouch.org/Papers/subimg/index.html . Unfortunately its in C++ and i do not understand a thing. Would be nice to have a Java implementation on SO.

    Read the article

  • Gtk, Trying to set GtkLabel text color (gtkrc).

    - by PP
    Hi all, I have written one small gtkrc file and I am trying to set Text color for GtkLabel, but it is not working out following is the rc file. style "my-theme-label" { xthickness = 10 ythickness = 10 bg[NORMAL] = "#ffffff" bg[ACTIVE] = "#ffffff" bg[PRELIGHT] = "#ffffff" bg[SELECTED] = "#ffffff" bg[INSENSITIVE] = "#ffffff" fg[NORMAL] = "#ffffff" fg[INSENSITIVE] = "#ffffff" fg[PRELIGHT] = "#ffffff" fg[SELECTED] = "#ffffff" fg[ACTIVE] = "#ffffff" text[NORMAL] = "#ffffff" text[INSENSITIVE] = "#434346" text[PRELIGHT] = "#ffffff" text[SELECTED] = "#ffffff" text[ACTIVE] = "#ffffff" base[NORMAL] = "#000000" base[INSENSITIVE] = "#00ff00" base[PRELIGHT] = "#0000ff" base[SELECTED] = "#ff00ff" base[ACTIVE] = "#f39638" } widget_class "*<GtkLabel>" style "my-theme-label" My application uses 2 rc files and I have added my rc file using gtk_rc_add_default_file( rcfile ); but this style is not getting set to GtkLabel. Also i tried to create different style for same type of widgets. as follows but in some cases it works and in some it does not work. style "my-button-style-black" { ... } style "my-button-style-white" { ... } widget "*.MyWhiteButton" style "my-button-style-white" widget "*.MyBlackButton" style "my-button-style-black" GtkButton *button = gtk_button_new_with_label("Test"); gtk_widget_set_name(button, "MyWhiteButton"); Is it right? It is not working out. Is it because I am using 2 rc files? Thanks, PP.

    Read the article

  • not Display text

    - by tismon
    <?php header ("Content-type: image/pjpeg"); $string = "manujagadeesh!!!"; $font =8; $width = ImageFontWidth($font)* strlen($string) ; $height = ImageFontHeight($font) ; $im = ImageCreateFromjpeg("sachin.jpg"); $x=100; $y=200; $background_color = imagecolorallocate ($im, 255, 255, 255); //white background $text_color = imagecolorallocate ($im, 0, 0,0);//black text imagestring ($im, $font, $x, $y, $string, $text_color); imagejpeg ($im); ?> this is the add text to image in php wen we inclue the my html page the text is not displaying for eg <?php header ("Content-type: image/pjpeg"); $string = "manujagadeesh!!!"; $font =8; $width = ImageFontWidth($font)* strlen($string) ; $height = ImageFontHeight($font) ; $im = ImageCreateFromjpeg("sachin.jpg"); $x=100; $y=200; $background_color = imagecolorallocate ($im, 255, 255, 255); //white background $text_color = imagecolorallocate ($im, 0, 0,0);//black text imagestring ($im, $font, $x, $y, $string, $text_color); imagejpeg ($im); ?> hi welcome couldn't see the hi wlecome

    Read the article

  • CSS styles are not applied to elements added to JavaFX component tree

    - by pazabo
    I have applied CSS style to JavaFX components and it looks like everything is working fine except one situation: when I add JavaFX components to component tree on-the-fly their CSS styles are not applied. For example following code: package test; import javafx.stage.Stage; import javafx.scene.Scene; import javafx.scene.shape.Rectangle; import javafx.scene.input.MouseEvent; import javafx.util.Math; import javafx.scene.paint.Color; function getRect(): Rectangle { return Rectangle { x: 230 * Math.random() y: 60 * Math.random() width: 20, height: 20 styleClass: "abc" } } def stage: Stage = Stage { scene: Scene { width: 250, height: 80 stylesheets: "{__DIR__}main.css" content: [ Rectangle { x: 0, y: 0, width: 250, height: 80 fill: Color.WHITE onMouseClicked: function (evt: MouseEvent): Void { insert getRect() into stage.scene.content; } } getRect() ] } } with following stylesheet: .abc { fill: red; } in main.css file (both in test package) display red square on white background, but after clicking the main rectangle black (not red) squares are added to scene. I noticed that: Components added dynamically look just like style information was not applied. If you set their style in JavaFX code then everything works fine. After changing stylesheets property (so that it points to another valid stylesheet) the objects already added render properly. Does anyone know the solution to this problem? I could of course put all the properties into JavaFX code or provide another stylesheet (for every existing stylesheed) that would contain the same data and change stylesheet right after adding any component, but I would like to find some elegant solution. Thanks in advance.

    Read the article

  • How can a ListBoxItem property be set in Silverlight at runtime?

    - by sympatric greg
    Given this XAML, I need to resize the userControl in response to user input. How can I set a new width for ListBoxItem (or perhaps the StackPanel)? <ScrollViewer x:Name="ScrollViewer" Margin="0" BorderBrush="Transparent" Width="165" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Hidden"> <ListBox x:Name="AttributeListBox" ItemsSource="{Binding Attributes}" BorderBrush="Red" Width="160" Foreground="AntiqueWhite" Background="Transparent" IsEnabled="False" HorizontalAlignment="Stretch"> <ListBox.ItemContainerStyle> <Style TargetType="ListBoxItem"> <Setter Property="HorizontalAlignment" Value="Stretch"/> <Setter Property="Width" Value="150"/> <Setter Property="Margin" Value="0,-2,0,0"/> <Setter Property="HorizontalContentAlignment" Value="Left" /> <Setter Property="Template" Value="{StaticResource ListBoxItemSansFocus}" /> </Style> </ListBox.ItemContainerStyle> <ListBox.ItemTemplate> <DataTemplate> <StackPanel x:Name="ListBoxItemStackPanel" HorizontalAlignment="Stretch" Orientation="Vertical" > <TextBlock FontSize="10" Text="{Binding Key}" Foreground="White" FontWeight="Bold" HorizontalAlignment="Stretch" Margin="2,0,0,0" TextWrapping="Wrap"/> <TextBlock FontSize="10" Text="{Binding Value}" Foreground="White" Margin="6,-2,0,0" TextWrapping="Wrap"/> </StackPanel> </DataTemplate> </ListBox.ItemTemplate> </ListBox> </ScrollViewer>

    Read the article

  • Theme change doesn't work on <4.0 as it should

    - by user1717276
    I have some difficulties with setting up a "theme switcher" programmatically. I would like to switch themes from app (between White (Theme.Light.NoTitleBar) and Dark (Theme.Black.NoTitleBar)) and what I do is: I set a SharedPreference: final String PREFS_NAME = "MyPrefsFile"; final SharedPreferences settings = getSharedPreferences(PREFS_NAME, 0); final SharedPreferences.Editor editor = settings.edit(); and than I have a two buttons to switch themes (second one is almost identical) Button ThemeWhite = (Button) findViewById(R.id.ThemeWhite); ThemeWhite.setOnClickListener(new OnClickListener() { public void onClick(View v) { editor.putBoolean("Theme", false); editor.commit(); System.exit(2); } }); and in begging of each activity I check SharedPreference boolean theme = settings.getBoolean("Theme", false); if(theme){ this.setTheme(R.style.Theme_NoBarBlack); } else{ this.setTheme(R.style.Theme_NoBar); } setContentView(R.layout.aplikacja); I define themes in file styles.xml in folder values: <resources> <style name="Theme.NoBar" parent="@android:style/Theme.Light.NoTitleBar" /> <style name="Theme.NoBarBlack" parent="@android:style/Theme.NoActionBar" /> in values-v11: <resources> <style name="Theme.NoBar" parent="@android:style/Theme.Holo.Light.NoActionBar" /> <style name="Theme.NoBarBlack" parent="@android:style/Theme.Holo.NoActionBar" /> in values-v14: <resources> <style name="Theme.NoBar" parent="@android:style/Theme.DeviceDefault.Light.NoActionBar" /> <style name="Theme.NoBarBlack" parent="@android:style/Theme.DeviceDefault.NoActionBar" /> manifest file: <application android:theme="@style/Theme.NoBar" > Everything is working excellent on android 4.0 but when I use 2.2 it doesn't change theme - just font is getting white as it should be but there is no dark background. I tried checking if it at least works and changed Theme.NoBarBlack in values (for android <3.0) and its value the same as Theme.NoBar and then when I pressed button font wasn't changed -as it should do.

    Read the article

  • Grayscale image with colored spotlight in JavaFX

    - by DaUltimateTrooper
    I need a way to have a gray scale image in an ImageView and on mouse moved if the cursor position is in the ImageView bounds to show a colored spotlight on the mouse position. I have created a sample to help you understand what I need. This sample negates the colors of a colored image on the onMouseMoved event. package javafxapplication3; import javafx.scene.effect.BlendMode; import javafx.scene.Group; import javafx.scene.image.Image; import javafx.scene.image.ImageView; import javafx.scene.input.MouseEvent; import javafx.scene.paint.Color; import javafx.scene.paint.RadialGradient; import javafx.scene.paint.Stop; import javafx.scene.Scene; import javafx.scene.shape.Circle; import javafx.stage.Stage; var spotlightX = 0.0; var spotlightY = 0.0; var visible = false; var anImage = Image { url: "{__DIR__}picture1.jpg" } Stage { title: "Spotlighting" scene: Scene { fill: Color.WHITE content: [ Group { blendMode: BlendMode.EXCLUSION content: [ ImageView { image: anImage onMouseMoved: function (me: MouseEvent) { if (me.x > anImage.width - 10 or me.x < 10 or me.y > anImage.height - 10 or me.y < 10) { visible = false; } else { visible = true; } spotlightX = me.x; spotlightY = me.y; } }, Group { id: "spotlight" content: [ Circle { visible: bind visible translateX: bind spotlightX translateY: bind spotlightY radius: 60 fill: RadialGradient { centerX: 0.5 centerY: 0.5 stops: [ Stop { offset: 0.1, color: Color.WHITE }, Stop { offset: 0.5, color: Color.BLACK }, ] } } ] } ] }, ] }, } I am a total newbie what can I say...

    Read the article

  • IE bug with TD's tables and whitespace?

    - by mark smith
    Hi there, I have a page that is using tables, in FF etc it works perfect, but in IE7 it causes issues, its basically where the four corners have a td and and img (its a rounded corner form) .. if i remove the whitespace from the document it fixes the issue.. What actually happens is that it messes up the tables.. it puts a thin white line between the upper tr that holds the 2 corners and the next tr I need to remove the the whitespace between the img and the TD, is there a better work around, as i have lots and not only that if i reformat the document the problem returns.. here is a simple example.. <table width="100%" height="418" border="0" cellpadding="0" cellspacing="0" bgcolor="#F04A23" style="margin: 0px; padding: 0px"> <tr> <td width="12" align="left" valign="top"> <img src="content/images/corner_left.gif" width="12" height="12" /> </td> as you can see there is white space between img and td... and i remove it so it looks like this <img src="content/images/corner_left.gif" width="12" height="12" /></td> the problem is gone, (notice the td and image are right next to each other) Any ideas, i tried setting all sorts of css, padding 0px, margins 0px etc ... Any ideas really appreciated

    Read the article

  • Internet Explorer table 1 pixel spacing problem

    - by Dennis G.
    I've found a strange problem with Internet Explorer related to table spacing and cannot find a way to work around it. An empty table results in a single pixel white space with Internet Explorer (6 and 7, 8 not yet tested), while all other browsers ignore the empty table. Here's a picture of the problem: And here is the minimum HTML code to reproduce the issue (please note that there are more margin/padding css attributes and table attributes specified than really needed, I just tested if this fixes IE's behavior): <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <body> <div style="width: 200px; border: 1px black solid"> <table border="0" cellspacing="0" cellpadding="0" style="margin: 0pt; padding: 0pt; border-collapse: collapse;"> <tr> <td style="padding: 0; margin: 0"> </td> </tr> </table> <div style="background: red"> Test </div> </div> </body> </html> I'm not using an empty table as specified in the example above, but this was the minimum code that displays this behavior. Any ideas on how to fix this and remove the white space with IE?

    Read the article

  • Generating dynamic css using php and javascript

    - by Onkar Deshpande
    I want to generate tooltip based on a dynamically changing background image in css. This is my my_css.php file. <?php header('content-type: text/css'); $i = $_GET['index']; if($i == 0) $bg_image_path = "../bg_red.jpg"; elseif ($i == 1) $bg_image_path = "../bg_yellow.jpg"; elseif ($i == 2) $bg_image_path = "../bg_green.jpg"; elseif ($i == 3) $bg_image_path = "../bg_blue.jpg"; ?> .tooltip { white-space: nowrap; color:green; font-weight:bold; border:1px solid black;; font-size:14px; background-color: white; margin: 0; padding: 7px 4px; border: 1px solid black; background-image: url(<?php echo $bg_image_path; ?>); background-repeat:repeat-x; font-family: Helvetica,Arial,Sans-Serif; font-family: Times New Roman,Georgia,Serif; filter:alpha(opacity=85); opacity:0.85; zoom: 1; } In order to use this css I added <link rel="stylesheet" href="css/my_css.php" type="text/css" media="screen" /> in my html <head> tag of javascript code. I am thinking of passing different values of 'index' so that it would generate the background image dynamically. Can anyone tell me how should I pass such values from a javascript ? I am creating the tooltip using var tooltip = document.createElement("div"); document.getElementById("map").appendChild(tooltip); tooltip.style.visibility="hidden"; and I think before calling this createElement, I should set background image.

    Read the article

  • Modal view becomes partly transparent when dismissing?

    - by Jaanus
    A completely ordinary setup: UIViewController where I push another UIVC: BlahVc *blah = [[BlahVc alloc] initWithNibName:@"Blah" bundle:nil]; UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:blah]; blah.delegate = self; [self presentModalViewController:nav animated:YES]; [nav release]; [blah release]; Details about Blah: to support both landscape and portrait with least effort, I built Blah.xib so that inside Blah's main view, call it view A, there is another view B, with width fixed to 320px, that positions itself in the centre of the screen. With portrait iPhone it fills up the whole screen, with landscape there are margins on the side. So far, so good. Autorotate etc works well. Now, to dismiss blah, I use the recommended setup: inside Blah, I do: [self.delegate blahDidCancel:self]; And in the parent VC, I have: - (void)blahDidCancel:(Blah *)blah { [self dismissModalViewControllerAnimated:YES]; } Both view A's and B's backgrounds are opaque white. Problem: as soon as it hits the dismissModalViewControllerAnimated line, view A seems to become transparent, while view B remains white. This is not a problem in portrait since view B still fills up the screen. But in landscape, the result is that view B is still opaque, but has see-through transparent margins on the side (where view A used to be that has now mysteriously become transparent), from where the parent view contents comes through during the dismissing animation. Why does it seem like view A becomes transparent upon dismissing the modal VC?

    Read the article

  • Improving Performance on this Image Creation function

    - by Abs
    Hello all, I am making use of GD2 and the image functions to take in a string and then convert that into an image using different fonts at different sizes. The function I use is below. Currently, its pretty quick but not quick enough. The function gets called about 20 times per user and the images generated are always new ones (different) so caching isn't going to help! I was hoping to get some ideas on how to make this function faster. Maybe supply more RAM to the script running? Anything else that is specific to this PHP function? Anything else that I can do to tweak performance of this function? function generate_image($save_path, $text, $font_path, $font_size){ $font = $font_path; /* * I have simplifed the line below, its actually a function that works out the size of the box * that is need for each image as the image size is different based on font type, font size etc */ $measure = array('width' => 300, 'height'=> 120); if($measure['width'] > 900){ $measure['width'] = 900; } $im = imagecreatetruecolor($measure['width'], $measure['height']); $white = imagecolorallocate($im, 255, 255, 255); $black = imagecolorallocate($im, 0, 0, 0); imagefilledrectangle($im, 0, 0, $measure['width'], $measure['height'], $white); imagettftext($im, $font_size, 0, $measure['left'], $measure['top'], $black, $font, ' '.$text); if(imagepng($im, $save_path)){ $status = true; }else{ $status = false; } imagedestroy($im); return $status; } Thanks all for any help

    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

  • How can I overlay images over one another in Java?

    - by Sam
    So I have been posting all over and have yet to get a solid answer: I have created an image resizing class, with a crop method. The cropping works great. The issue that I am having is the background color that I specify in the drawImage function of Graphics is not working correctly. It defaults to black as the background regardless of what I supply (in this case Color.WHITE). Also, the overlaying image or top most image (comes from a file) is being inverted (I think it is) or otherwise discolored. Just so you can conceptualize this a little bit better, I am taking a jpeg and overlaying it on top of a new BufferedImage, the new buffered image's background is not being set. Here is the code below that I am working with: public void Crop(int Height, int Width, int SourceX, int SourceY) throws Exception { //output height and width int OutputWidth = this.OutputImage.getWidth(); int OutputHeight = this.OutputImage.getHeight(); //create output streams ByteArrayOutputStream MyByteArrayOutputStream = new ByteArrayOutputStream(); MemoryCacheImageOutputStream MyMemoryCacheImageOutputStream = new MemoryCacheImageOutputStream(MyByteArrayOutputStream); //Create a new BufferedImage BufferedImage NewImage = new BufferedImage(Width, Height, BufferedImage.TYPE_INT_RGB); Graphics MyGraphics = NewImage.createGraphics(); MyGraphics.drawImage(this.OutputImage, -SourceX, -SourceY, OutputWidth, OutputHeight, Color.WHITE, null); // Get Writer and set compression Iterator MyIterator = ImageIO.getImageWritersByFormatName("png"); if (MyIterator.hasNext()) { //get image writer ImageWriter MyImageWriter = (ImageWriter)MyIterator.next(); //get params ImageWriteParam MyImageWriteParam = MyImageWriter.getDefaultWriteParam(); //set outputstream MyImageWriter.setOutput(MyMemoryCacheImageOutputStream); //create new ioimage IIOImage MyIIOImage = new IIOImage(NewImage, null, null); //write new image MyImageWriter.write(null, MyIIOImage, MyImageWriteParam); } //convert output stream back to inputstream ByteArrayInputStream MyByteArrayInputStream = new ByteArrayInputStream(MyByteArrayOutputStream.toByteArray()); MemoryCacheImageInputStream MyMemoryCacheImageInputStream = new MemoryCacheImageInputStream(MyByteArrayInputStream); //resassign as a buffered image this.OutputImage = ImageIO.read(MyMemoryCacheImageInputStream); }

    Read the article

  • Google Script / Spreadsheet -- Shared permissions with Installed Trigger onEdit

    - by user1761852
    Using an installed trigger inside spreadsheet to call onUpdateBilling(). Purpose of this script is on edit, based on content of column "billed" (i.e. "d") will highlight the entire column the predetermined color. Page running script is shared with collaborators and they have been given edit access. My expectation at this point is the script should be run with owner permissions. My shared users are unable to run the script with the given error "You don't have permission for this action." Reached my limited knowledge and googlefu for this workaround. Any help to allow operation to my collaborators is appreciated. Script: function onUpdateBilling(e) { var statusCol = 16; // replace with the column index of Status column A=1,B=2,etc var sheetName = "Temple Log"; // replace with actual name of sheet containing Status var cell = SpreadsheetApp.getActiveSheet().getActiveCell(); var sheet = cell.getSheet(); if(cell.getColumnIndex() != statusCol || sheet.getName() != sheetName) return; var row = cell.getRowIndex(); var status = cell.getValue(); // change colors to meet your needs var color; if (status == "D" || status == "d") { color = "red";} else if (status >= 1) { color = "yellow";} else if (status == "X" || status == "x") { color = "black";} else if (status == "") { color = "white";} else { color = "white"; } sheet.getRange(row + ":" + row ).setBackgroundColor(color); }

    Read the article

  • Should a Trim method generally in the Data Access Layer or with in the Domain Layer?

    - by jpierson
    I'm dealing with a database that contains data with inconsistencies such as white leading and trailing white space. In general I see a lot of developers practice defensive coding by trimming almost all strings that come from the database that may have been entered by a user at some point. In my oppinoin it is better to do such formating before data is persisted so that it is done only once and then the data can be in a consistent and reliable state. Unfortunatley this is not the case however which leads me to the next best solution, using a Trim method. If I trim all data as part of my data access layer then I don't have to concern myself with defensive trimming within the business objects of my domain layer. If I instead put the trimming responsibility in my business objects, such as with set accessors of my C# properties, I should get the same net results however the trim will be operating on all values assigned to my business objects properties not just the ones that come from the inconsistent database. I guess as a somewhat philisophical question that may determine the answer I could ask "Should the domain later be responsible for defensive/coercive formatting of data?" Would it make sense to have a set accessor for a PhoneNumber property on a business object accept a unformatted or formatted string and then attempt to format it as required or should this responsibility be pushed to the presentation and data access layers leaving the domain layer more strict in the type of data that it will accept? I think this may be the more fundamental question. Update: Below are a few links that I thought I should share about the topic of data cleansing. Information service patterns, Part 3: Data cleansing pattern LINQ to SQL - Format a string before saving? How to trim values using Linq to Sql?

    Read the article

  • [PERL Tk] printing Line number in Text widget

    - by ungalnanban
    I use the following code for printing the line number in Text widget. my $c=0; my $r=0; $txt = $mw-Text( -background ='white', -width=>400, -height=>300, -selectbackground => 'skyblue', -insertwidth => 5, -borderwidth =>3, -highlightcolor => 'blue', ### after visit -highlightbackground => 'red' , ### default before visit -xscrollcommand => sub { print"CHAT NO :",$c++; }, # Determines the callback used when the Text widget is scrolled horizontally. -yscrollcommand = sub { print"LINR NO:",$r++; }, # Determines the callback used when the Text widget is scrolled vertically. -padx = 5, -pady = 5, )- pack (); the above code is printing the line number and character no is ok. but I used in Scrolled widget that output is not printing. what is the problem in the following code how can I solve this? $txt = $mw-Scrolled('Text', -scrollbars = 'se', -background ='white', -width=>400, -height=>300, -insertwidth => 5, -borderwidth =>3, -highlightcolor => 'blue', ### after visit -highlightbackground => 'red' , ### default before visit -padx => 5, -pady => 5, -xscrollcommand => sub { print"CHAT NO :",$c++; }, # Determines the callback used when the Text widget is scrolled horizontally. -yscrollcommand => sub { print"LINR NO :",$r++; }, # Determines the callback used when the Text widget is scrolled vertically. )->pack();

    Read the article

  • Why hovering in this menu is not working in IE?

    - by janoChen
    When a anchor is hovered in this menu it should turn its background white. It works in Firefox and Chrome but in IE the words just disappear and the background doesn't turn white. CSS: #lang { float: right; padding: 0 0 0 0; margin: 50px 25px 0 0; width: 285px; } #lang li { font-size: 10px; float: right; } #lang li a#english, #spanish, #chinese { color: #FFF; float: right; padding-right: 20px; padding-top: 2px; padding-bottom: 2px; width: 200px; /* ie fix */ } #lang li a#english { padding-left: 231px; } #lang li a#spanish { padding-left: 228px; } #lang li a#chinese { padding-left: 219px; } #lang li a:hover { background: #FFF; color: #444; } #lang li.current a { background: #FFF !important; color: #444 !important; cursor: default; } HTML: <ul id="lang"> <li <?php if($lang_file=='lang.en.php') {echo 'class="current"';} ?>><a id="english" href="index.php?lang=en">english</a></li> <li <?php if($lang_file=='lang.es.php') {echo 'class="current"';} ?>><a id="spanish" href="index.php?lang=es">español</a></li> <li <?php if($lang_file=='lang.zh-tw.php') {echo 'class="current"';} ?>><a id="chinese" href="index.php?lang=zh-tw">??(??)</a></li> <li <?php if($lang_file=='lang.zh-cn.php') {echo 'class="current"';} ?>><a id="chinese" href="index.php?lang=zh-cn">??(??)</a></li> </ul>

    Read the article

< Previous Page | 53 54 55 56 57 58 59 60 61 62 63 64  | Next Page >