w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Modify Fill Colour from Outside a Paint Event Handler in C# and Visual Studio 2012
To change the Rectangle color you have to draw it again. You can keep your paint event function but with some changes. First, declare a global boolean First_time (initially set with true) that will check if you you want the greybrush or the Randbrush. boolean First_Time; Then in your Paint event : private void clrRandForm_Paint( object sender, PaintEventArgs e ) { int x = 266; int y = 105; int width = 274; int height = 172; Rectangle clrRect = new Rectangle(x, y, width, height); SolidBrush greyBrush = new SolidBrush(Color.FromArgb(75, 75, 75)); SolidBrush randBrush = new SolidBrush(randColourPicker()); Graphics clrGraphic = mainBox.CreateGraphics(); if(First_time) clrGraphic.FillEllipse(greyBrush, clrRect); else clrGraphic.Fill

Categories : C#

SSRS set font colour base on background colour
You'll need to set the two properties in two expression based on the same condition. Even if the Textbox is displaying a different field in its text, you can still use any fields in the same row in the property expression. e.g. for BackgroundColor use something like: =IIf(Fields!Date.Value < CDate("01-Jan-2013"), "Black", "White") then for the Color property use something like: =IIf(Fields!Date.Value < CDate("01-Jan-2013"), "White", "Black") Here for dates prior to 01-Jan-2013, the Textbox will be black with white text, and for dates from this year, the Textbox will be white with black text. Edit after comments Just to confirm, there is no readily available way to check report items properties (other than Value) in SSRS expressions. I agree this would be nice but for now thi

Categories : Reporting Services

How to give a colour to particular div by selecting a colour in html5
[Revised answer based on changed request] Here’s how to let the child draw anywhere within a bounding box around the letter First, define the area that the drawing will be restricted to. Any drag-draws outside the drawable area won't be visible. // define the drawable area var minX=60; var maxX=250; var minY=140; var maxY=380; Then in mousemove, draw only if the mouse is inside that drawable area: if(mouseX>minX && mouseX<maxX && mouseY>minY && mouseY<maxY){ ctx.beginPath(); ctx.moveTo(startX,startY); ctx.lineTo(mouseX,mouseY); ctx.stroke(); } Here is code and a Fiddle: http://jsfiddle.net/m1erickson/tAkAy/ <!doctype html> <html> <head> <

Categories : Javascript

Spectrum colour picker post id and colour to php
$.post('colour.php', { colour: color.toHex, id: (this.id) } ); I answered my own question this morning, this now posts the colour and id over to php. Thanks to @RandomSeed for making me think about what I was actually trying to achieve!

Categories : PHP

Colour the first marker of a Google Map a different colour
add an icon URL to the end of the first element in your array, something like: ['<b>Customer</b><br>Address', 52.6699927, -0.7274620, 1, 'http://maps.google.com/mapfiles/ms/icons/blue.png'] use that in the definition of your marker (if it isn't there it will be "null" and the default marker will be used). marker = new google.maps.Marker({ position: new google.maps.LatLng(locations[i][1], locations[i][2]), map: map, icon: locations[i][4] }); working example

Categories : Javascript

WinRT replace colour in BitmapImage with another
Use WriteableBitmapEx library. Get the Pixels array of the picture which holds all the pixels as Int32. Get the RGB values for each pixel using var c = inputPixels[i]; var a = (byte)(c >> 24); var r = (byte)(c >> 16); var g = (byte)(c >> 8); var b = (byte)(c); Check if that is the color you want. If it is, change that color to another color using new argb byte values resultPixels[i] = (a << 24) | (r << 16) | (g << 8) | b; Read more about image processing in a great tutorial here PicFx – Windows Phone Picture Effects Application – Part 1 PicFx – Windows Phone Picture Effects Application – Part 2

Categories : C#

Changing the colour of every 5th div
You're not targeting the correct DIV. It should be: .content_tab:nth-child(5n+1) .content_tab_hover{ background: #ce1c5e; } .content_tab:nth-child(5n+2) .content_tab_hover{ background: #009acf; } .content_tab:nth-child(5n+3) .content_tab_hover{ background: #fcc712; } .content_tab:nth-child(5n+4) .content_tab_hover{ background: #742f68; } .content_tab:nth-child(5n+5) .content_tab_hover{ background: #389a28; } .content_tab_hover:nth-child(n) selects the n-th .content_tab_hover element from each .overlay DIV.

Categories : HTML

Tab Indicator colour
Use this library for custom view pager and change the color of the following drawables. tab_selected_holo.9.png tab_unselected_holo.9.png

Categories : Android

Set footer colour in xml
Here is an example for doing that: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res/tn.mkh.example.android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <FrameLayout android:id="@+id/fragmentContainer" android:layout_width="fill_parent" android:layout_height="fill_parent" android:visibility="gone" /> <com.viewpagerindicator.TitlePageIndicator android:id="@+id/indicator" android:layout_width="fill_parent" android:layout_height="wrap_content" android:padding="10dip" app:footerColor="#848484" app:sele

Categories : Android

How to use VBA to colour pie chart
Here's how to set the colors of each slice in a pie chart. Not sure how you want to determine which slice gets what color. Dim clr As Long, x As Long For x = 1 To 30 clr = RGB(0, x * 8, 0) With ActiveSheet.ChartObjects(1).Chart.SeriesCollection(1).Points(x) .Format.Fill.ForeColor.RGB = clr End With Next x

Categories : Vba

Change the colour of the app using alarm
See this: http://justcallmebrian.com/2010/04/27/using-alarmmanager-to-schedule-activities-on-android/ It may be useful for you. Good luck!

Categories : Android

SVG Path Fill Colour with CSS
Changing the fill attribute will never work in this situation, because the image itself already has a fill. It won't be 'replaced' or 'redrawn' using the new attributes. I also don't think this will work even if you took out the color command in the SVG file.

Categories : CSS

set colour for subscript, kCTForegroundColorAttributeName, ios
This may just be a wrong attribute name issue, as I suspect you're not doing anything explicitly CoreText before or after this code. For your attributed string, try using these attributes instead: [attString addAttribute:NSForegroundColorAttributeName value:[UIColor blueColor] range:NSMakeRange(self.superScript.length - 2, self.superScript.length - 2)];

Categories : IOS

Background colour not filling div
The workaround is to put a div inside that div... Like this... <div id="container"> <div id="colordiv"> <div></div> <div></div> <div></div> </div> </div> Where container is an auto margined 'container', and the color div is 100% color fill for that container. This way you can make the main container any width, the rest will follow, and the color continues as far as the content DEMO HERE ANOTHER DEMO - smaller divs As for your overflow question....Im not sure at all why thats the case

Categories : HTML

CSS / HTML Using a counter to set a colour
You could simply add a background-image linear-gradient to the uls: ul { width: 100px; background-image: linear-gradient(bottom, rgb(0,0,0) 0%, rgb(250,250,250) 91%); background-image: -o-linear-gradient(bottom, rgb(0,0,0) 0%, rgb(250,250,250) 91%); background-image: -moz-linear-gradient(bottom, rgb(0,0,0) 0%, rgb(250,250,250) 91%); background-image: -webkit-linear-gradient(bottom, rgb(0,0,0) 0%, rgb(250,250,250) 91%); background-image: -ms-linear-gradient(bottom, rgb(0,0,0) 0%, rgb(250,250,250) 91%);; } Here's a very simple js fiddle example to illustrate. MDN explanation Simple gradient generator

Categories : HTML

OpenGL ES 2.0 colour subtraction
I cannot specifically tell, not gripped up much in OpenGL but, still from what I can help, I'll do. If I understand correctly, you need a value within 0 to 1 inclusive-float to subtract from an already existing colour component's value. For this, visit this link : http://www.andersriggelsen.dk/glblendfunc.php It can help you will live checking of blending between two images. Check for the blend function : GL_FUNC_SUBTRACT

Categories : Android

Changing Row Colour according to condition
When you open a report/form with multiple rows, the code you use will only apply to the first row appearing in the data. So in short, your code will not work. There is however a way to color rows on different criteria using conditional formatting.

Categories : Database

Change the colour of the background with php
You want to create a png not a JPEG. Use imagepng and imagesavealpha. See full example.

Categories : PHP

Colour spiral not working in XNA
Check that you are calling dataadd(). As a precaution, colourchangespeed should be declared as a byte rather than as an int because you're only casting to a byte anyway. When checking you colour values, the current value should be compared as >= 255 in the case that colourchangespeed is not 1. A tip to writing good questions: Remove everything that's unrelated. Everything.

Categories : C#

ttk Entry background colour
I've figured it out, after a lot of digging. As hard as I had to search to figure this out, I suppose others would benefit from this: The standard style applied to ttk.Entry simply doesn't take a fieldbackground option, which would be what changes the colour of the text entry field. The solution is this to create a new element that does respond to the option. from tkinter import * from tkinter import ttk root_window = Tk() estyle = ttk.Style() estyle.element_create("plain.field", "from", "clam") estyle.layout("EntryStyle.TEntry", [('Entry.plain.field', {'children': [( 'Entry.background', {'children': [( 'Entry.padding', {'children': [( 'Entry.textarea', {'sticky': 'nswe'})],

Categories : Python

Changing of colour depending on $sum
You are missing code block brackets {} and I fixed your logic. function getProperColor($sum_total) { if ($sum_total <= 0) return '#00FF00'; else if ($sum_total <= 50) return '#ffd800'; else if ($sum_total <= 120) return '#5e7810'; return '#afe214'; }

Categories : PHP

Set Background colour on NSTableCellView
A NSTableCellView is a NSView, and a NSView has a CALayer, and a CALayer has a backgroundColor. So... myTableCellView.layer.backgroundColor = [NSColor redColor]; // or whatever color you like

Categories : Objective C

Colour on a image changes on different on machines
This is likely to be more to do with your screen rather than a coding issue. You will find that all screens display images slightly differently. In fact, the image you have posted will look different to me now, than it does on either of your machines. Often the difference is slight. This can be to do with different display technologies (LCD, CRT etc) or just the slight differences in manufacture.

Categories : HTML

Matplotlib: assign an ever different colour
You can specify the color as a hex value in a string. color = '#eeefff' Using this you essentially have access to all colors via RGB and can create as many colors as you need

Categories : Python

Getting colour from database to DIV background
You can do it simply by Javascript. document.getElementsByClassName('DivName')[0].style.backgroundColor = "Your Color; or by JQuery $('#element').css('background-color',''); You will need to pull values from DB onto page and find its value and assign it

Categories : Asp Net

Openframeworks Colour Tracking
A complete example of what you are trying to achieve can be found in here: https://github.com/kylemcdonald/ofxCv/tree/master/example-contours-color It uses ofxCv, an add-on that let you integrate openframeworks with openCv in a clean way. Moreover you can use native OpenCV calls, without the need of any kind of wrapper. The internet is full of similar examples that uses pure OpenCV code and with this add ons you can use those snippets as it is, without any kind of problem and it gives some easy way to go from OpenCV data structures to Openframeworks ones and vice-versa. It is great!

Categories : Opencv

error on colour values
You were off a bit on the second check. I think you wanted this: if ((Color.red(pixel) | Color.blue(pixel) | Color.green(pixel)) < 10) { if(TTSInitialized){ mTts.speak("Color is Black", TextToSpeech.QUEUE_FLUSH, null); } textViewCol.setText("Color is Black."); return true; } that way you are OR'ing the values and getting the cumulative amount, instead of the minimum of the three values. For example: 3 | 7 | 255 = 255 but 3 & 7 & 255 = 3 Also, with your all of your checks, I'd probably redo them. & is really checking more of a bitmask than an intensity. With &, you only get the bits that are set in each number. for white, I'd use: if (Color.red(pixel) > 220 && Color.blue(pixel) > 220 &&

Categories : Android

Scatterplot colour based on y-value
You can create the color levels using cut, then using the vector of colors in your plot. set.seed(1104) x = rnorm(100) y = rnorm(100) colors = c("blue", "red", "green") breaks = c(y1=0, y2=1) # first plot (given breaks values) y.col2 = as.character(cut(y, breaks=c(-Inf, breaks, Inf), labels=colors)) plot(x, y, col=y.col2, pch=19) # second plot (given number of breaks) y.col = as.character(cut(y, breaks=3, labels=colors)) plot(x, y, col=y.col, pch=19)

Categories : R

Applying colour over the image
In side the touch listener use the following code // Get the Image container object ImageView imgStatus = (ImageView) findViewById(R.id.imgInfoIcon); // Load the icon as drawable object Drawable d = getResources().getDrawable(R.drawable.ic_menu_info_details); // Get the color of the icon depending on system state int iconColor = android.graphics.Color.BLACK if (systemState == Status.ERROR) iconColor = android.graphics.Color.RED else if (systemState == Status.WARNING) iconColor = android.graphics.Color.YELLOW else if (systemState == Status.OK) iconColor = android.graphics.Color.GREEN // Set the correct new color d.setColorFilter( iconColor, Mode.MULTIPLY ); // Load the updated drawable to the image viewer imgStatus.setImageDrawable(d);

Categories : Android

Canvas - Get position of colour if available
You would need to iterate over the data property and check the RGB values. Basically you would iterate in groups of 4, as each pixel is stored as 4 indices, and compare the values accordingly.

Categories : Javascript

how to specifiy colour theme in VBA
Your function could be improved in this way: Function GetColorSchemeRGB(i As Long) As Long Select Case i Mod 2 Case 0 'for red GetColorSchemeRGB = RGB(255, 0, 0) Case 1 'for green GetColorSchemeRGB = RGB(0, 255, 0) End Select End Function You can't assign your Const in this way: Const thmColor1 As Long = RGB(255, 255, 255) as it's required to assign value to Const. Alternatively you could make check in immediate to find which long represent which RGB value like this: 'for white Debug.Pring RGB(255,255,255) 16777215 '<<result and than you will define your Const in this way: 'for white Const thmColor1 As Long = 16777215 which could be add to your function in the way you want it.

Categories : Excel

Colour of two overlapping circles
If you look at the code of heatmap.js, you'll see that it works like this: Paint circles onto a canvas, using a radial gradient from transparent to some percent opaque (depending on the strength of the point). Color-map that grayscale image (converting each gray value to one of an array of 256 colors). Your problem could be solved in the same way, but painting a circle of constant opacity and variable radius in step 1.

Categories : Javascript

filling a given colour in pygame
Essentially, what you're asking for is the first part of the 'Flood-Fill' algorithm, which is what programs like Microsoft Paint uses to fill in an area with a new color. The algorithm first finds all the connected pixels of the same color, then changes their color. Check out the wikipedia page or this stackoverflow question for a python implementation. As for your code, there are several things that could be improved. I would suggest: Use a set() instead of a list. This way you will not have to deal with duplicate points Use if/elif clauses instead of ifs only. This will cut down on computation time. Your if statements are very complicated but very redundant. You may want to try breaking them up into a nested group of if/elif statements. Look around for Flood-Fill algorithms and try

Categories : Python

Get colour of pixel from CCRenderTexture
Don't malloc your buffer every time, just reuse the same buffer; malloc is slow! Please take a look at Apple's Memory Usage Documentation. I don't know of any algorithms that can do this any faster, but this might help.

Categories : Iphone

Colour percentage in Bitmap
I have found myself, for viewers convenience for re usage, adding the correction(Question is updated with the answer already). To get total pixels use image dimensions, instead of counting the looping pixels in bitlockdata. Image page= new Image(filePath); double nTotal = page.Width * page.Height;

Categories : C#

Change RGB Values of Colour Over Time
Use a swing Timer to set the new background colour perodically. For calculating the new colour you can use Color.HSBtoRGB(), changing the hue component each time the timer is activated.

Categories : Java

Ignore certain colour alpha blending
The proper way to do this is to use alpha blending, with an alpha channel. Your texture is probably 32bits anyway, with a fully opaque alpha channel at 255. Using your favorite picture editor, you can probably convert your picture to copy the red channel to your alpha channel, which will give you exactly what you need. It also will support semi-transparent textures as well. Otherwise, what you're looking for is alpha test which would also require the usage of the alpha channel, unless you're using indexed colors.

Categories : C++

Change colour of div by hovering over the contents?
If only they had enough sense to create, for us, the :parent pseudo class. In the meantime, you'll need to use JavaScript. Would something like this work for you? <script type="text/javascript"> $(document).ready(function(e){ $("div#divID a#anchorID").mouseenter(function(){ var divElement = $(this).parent(); // Style the div to its hover style (hovering over link) }).mouseleave(function(){ var divElement = $(this).parent(); // Style the div to its base style (not hovering over link) }); }); </script>

Categories : CSS

In area chart how to use gradient colour
Please take look at the example http://www.highcharts.com/demo/line-time-series EDIT: http://jsfiddle.net/sbochan/HkeXp/ fillColor: { linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1}, stops: [ [0, '#ff0000'], [1, '#f4f4f4'] ] },

Categories : Highcharts

How can I set cell font colour in a DataGridView?
This kind of Property (ForeColor or BackColor ...) should be changed in a Form Load event handler (or Form Shown)... or in some other event handlers of your DataGridView, I think the reason may be your DataGridView rows are not ready, I guess you placed your code in a Form constructor. private void Form1_Load(object sender, EventArgs e){ //place your code here dgv_Table.Rows[0].Cells[0].Style.ForeColor = Color.Blue; }

Categories : C#



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.