How to get the color of a single pixel?
Hi all.
Part of my application is transparent. The other party is not.
But I would like to have 'match' colors (is not very pretty orange to pink, but it's a matter of personal taste, I guess).
That's why I need now to a background color.
That's what I had in mind:
Because we cannot get information about the currently active theme, I can do a screen capture and extract a single pixel of interest and get its color information. If it is green (for example) - I'll tryto use more Brown colors in my application.
So basically, is it possible to get the color of a pixel in a bitmap (or something?)
My last resort would be to save the Bitmap image to a file and then read that file.
Bitmap.getARGB (int [] argbData, int offset, int scanLength, int x, int y, int width, int height)
Gets the raw data ARGB region of this Bitmap and stores it in the table provided.
Tags: BlackBerry Developers
Similar Questions
-
How to get the color of the text information in the text layer?
How to get the color of the text information in the text layer? I mean using scripts Photoshop, Version of Photoshop CS 8.0
The color textItem is readable for me in VBS Note expects the activeLayer be a textLayer and displays the HexValue of the color of the text.
Option Explicit Dim appRef Dim docRef Dim textItemRef Dim artLayerRef Dim textColor Set appRef = CreateObject( "Photoshop.Application" ) appRef.BringToFront Set docRef = appRef.ActiveDocument Set artLayerRef = docRef.ActiveLayer Set textItemRef = artLayerRef.TextItem Set textColor = textItemRef.Color MsgBox textColor.RGB.HexValue
And returns the color of the text if the text is the same color. But if the text is more than a color textItem.color returns only the color of the first text range.
-
How to get the RGB value of a pixel in a psd document using scripting Photoshop
Hi, guys! Does anyone know how to get the RGB value of a pixel in a psd document using scripts in Photoshop? I myself have missed for a long time and could not resolve. I am very happy to hear your voice as soon as possible!
Here is an example...
var originalUnits = app.preferences.rulerUnits; app.preferences.rulerUnits = Units.PIXELS; var doc = activeDocument; var Colour1 = GetHexColour(eyeDropperRGB(1,doc.height-1)); var Colour2 = GetHexColour(eyeDropperRGB(20,doc.height-5)); var Colour3 = GetHexColour(eyeDropperRGB(40,doc.height-14)); alert("Colour 1 = " +Colour1 + "\rColour 2 = " +Colour2 + "\rColour 3 = " +Colour3); var decColour = eyeDropperRGB(40,doc.height-14); alert("Red = " +decColour[0] + "\rGreen = " +decColour[1] + "\rBlue = " +decColour[2]); app.preferences.rulerUnits = originalUnits; function GetHexColour(reqHex){ var out=''; for(No in colours = reqHex){ out = out.concat(zeroPad(d2h(reqHex[No]),2)); } return out; }; function eyeDropperRGB(x,y) { var x2 = x + 1; var y2 = y + 1; var out = new Array(3); activeDocument.selection.select([[x,y], [x2,y], [x2,y2], [x, y2]], SelectionType.REPLACE, 0, false); for(ch in list = ["Red", "Green", "Blue"]) { histogram = activeDocument.channels[list[ch]].histogram; for (i = 0; i <= 255; i++) { if (histogram[i]) { out[ch] = i; break; } } } return out; }; function d2h(d) {return d.toString(16);} function zeroPad(n, s) { n = n.toString(); while (n.length < s) n = '0' + n; return n; };
-
How to get the color and stroke of ComboBox
I would get the selected color and stroke selected ComboBoxes to print these values as strings in an .ini file to save the settings.
Here is my example http://s24.postimg.org/q59kivgxh/Z055.png where I have a scene with ComboBoxes.List
The list of colors is an ObservableList in the classroom
public class ComboBoxColorCellFactory { public static ObservableList<String> colorList = FXCollections.observableArrayList( "White", "WhiteSmoke", "GhostWhite", "Ivory", "MintCream", "Beige", "Transparent", "Seashell", "Snow", "Honeydew", "FloralWhite", "Cornsilk", "BlancheDalmond","Wheat", "AntiqueWhite", "NavajoWhite");
and the list of race
public class ComboBoxLineCellFactory { public static ObservableList<String> linesList = FXCollections.observableArrayList( "-fx-stroke-dash-array: 1;", "-fx-stroke-dash-array: 12 2 4 2;", "-fx-stroke-dash-array: 2 2;", "-fx-stroke-dash-array: 15 5.0 15 5.0;", "-fx-stroke-dash-array: 0.8 8.0;", "-fx-stroke-dash-array: 3 3;", "-fx-stroke-dash-array: 6 3;");
In my previous version of swing, I used to get these values in this way (PriceRetracementIni is the class with the statements of private fields and define and use the get methods).
PriceRetracementIni.setColor1(Integer.toString(((Color)jComboBoxColor1.getSelectedItem()).getRed())+ "|" + Integer.toString(((Color)jComboBoxColor1.getSelectedItem()).getGreen())+ "|" + Integer.toString(((Color)jComboBoxColor1.getSelectedItem()).getBlue()));
PriceRetracementIni.setStyle1(ComboLineTypeConstants.getStrokeArray((BasicStroke)jComboBoxStyle1.getSelectedItem()));
PriceRetracementIni.setFontStyle(jComboBoxFontStyle.getSelectedItem().toString());
How do I make FX 2, assuming that I have comboboxColor, comboboxStyle and comboboxFont?
Thank you.
Post edited by: acepsut missed some info about the color and stroke list
comboBox.getSelectionModel () .getSelectedItem)
See the Javadocs for ComboBox and SelectionModel
-
How to get the ID of a single data centre and the Cluster
Hello
We have a product we need get the detail of data centers, Clusters, the Esx host and all Virtual Machines of a Virtual Center. And keep it in sync with the VCenter. I use a thread that queries the VCenter every 5 minutes and retrieves the data.
We use Java VI SDK 4.0 for this.
At the present time I am able to read all the details using PropertyCollector. But once a data center is renowned for my application, it is similar to a fact that a data center with the old name has been deleted and a data center with the new name has been added. For this reason, when data center is renamed, I remove entities for the former my application Esx host and adding new features to the ESX hosts in new data center. It causes a lot of unwanted things.
So, I want to go get some unique Id of the dataCenter and Cluster, so that when a cluster/datacenter is renamed, uniqueId is always the same and my app will be able to know that it is just a change of name. And entities for ESX/VirtualMachine will be kept.
Please, help me to know the unique id of the cluster/datacenter.
Thank you
Deepak
Yes, there are supposed to be unique UUID generated by vCenter or ESX (i) and if you have not manually mux with values. The UUID is guaranteed to be unique within a given instance of vCenter.
=========================================================================
William Lam
VMware vExpert 2009
Scripts for VMware ESX/ESXi and resources at: http://engineering.ucsb.edu/~duonglt/vmware/
Introduction to the vMA (tips/tricks)
Getting started with vSphere SDK for Perl
VMware Code Central - Scripts/code samples for developers and administrators
If you find this information useful, please give points to "correct" or "useful".
-
Hi all
I have a system of LabVIEW which takes advantage IMAQ tools and features of the Vision Development Module. A useful feature that I put in place is to be able to take a snapshot of the video stream and then subtract this single image among the subsequent images.
What I want to do is to collect a series of images instead of one, and then create a unique image of these frameworks is just the maximum value of pixels in each pixel (a bit like a display persistent).
It would probably be very easy to be implemented by converting the image to a table and then by doing math number on the table and then turning into an image, but I hope that someone here may know how to use the IMAQ/VDM tools to do this in a way more compact.
Thank you very much
MK
How about using Max comparison IMAQ operation?
-
Satellite Pro M40x-115: how to get the color seen on TV?
Hello
I would like to use my laptop (satellite pro M40x-115) as a DVD player. But when I connect my laptop to my TV, I get only a black and white display. I tried to solve this problem by installing the latest driver for my graphics card but it has not changed at all.
How can I solve this?
Greetz El Mariachi
Hello
Have you checked the graphics settings? The settings of the TV must be set to PAL (most of Europe).
In addition, you should check your TV device if it s can receive the S-video signal.Check this: http://forum.digital-digest.com/showthread.php?t=2353&page=1&pp=15
Good bye
-
How to get the list in a single column in a query
Hello.
I wonder if there is a way to get a query (no pl/sql code) a list of columns with a separator between them.
I know I can get that without separators with an expression of cursor:
But the result I want is (by using the separator ';'):SQL> with test_table as ( 2 select 1 col1, 'a' col2 from dual 3 union 4 select 1 col1, 'b' col2 from dual 5 union 6 select 1 col1, 'c' col2 from dual 7 union 8 select 2 col1, 'a' col2 from dual 9 union 10 select 2 col1, 'c' col2 from dual 11 union 12 select 2 col1, 'd' col2 from dual 13 union 14 select 2 col1, 'z' col2 from dual 15 ) 16 select col1, cursor (select b.col2 from test_table b where b.col1 = a.col1 order by b.col2) col2_list from test_table a 17 group by col1 18 / COL1 COL2_LIST ---------- -------------------- 1 CURSOR STATEMENT : 2 CURSOR STATEMENT : 2 C - a b c 2 CURSOR STATEMENT : 2 CURSOR STATEMENT : 2 C - a c d z
I don't know how to manage a cursor expression without using a pl/sql function block. Can it be done using analytical functions?COL1 COL2_LIST ---------- -------------------- 1 a;b;c 2 a;c;d;z
Thanks in advance.Hello
This is called 'aggregation of chain.
This site:http://asktom.Oracle.com/pls/asktom/f?p=100:11:0:P11_QUESTION_ID:2196162600402
shows different ways to do this, including the SYS_CONNECT_BY_PATH solution which gave Blushadow.
I got a lot of use of the first solution on this page, the function defined by the user STRAGG, that you can copy.
Once you have installed STRAGG, your query is simply
SELECT col1 , STRAGG (col2) AS col2_list FROM test_table GROUP BY col1;
The query above do not put items in a particular order.
On Oracle 10 (and more) you can have a similar function, the WM_CONCAT (property WMSYS), already installed.
WM_CONCAT is not documented, so you can't use it in your Production applications. -
How to get the values in a single line, without the help of the union
Hello
I have a table with the structure and the following data
EmpID address phoneno emailid
1001 xyz
1001 1234234
1001 [email protected]
1002 23434
1002 [email protected]
1003 abcd
1003 [email protected]
1004 [email protected]
I need to get a result in this format.
EMP id address phoneno emailid
1001 xyz 1234234 [email protected]
1002 23434 [email protected]
1003 abcd [email protected]
1004 [email protected]
I can do this by using the union, but who gives a performance of questions with a large table. I want to do it using any other way using lead or something, but with the relative to data complexity, I couldn't do it.
Can someone help me please?
Natarajan
Published by: Nikita on December 3, 2009 15:50Select employee_id, max(address), max(phone), max(email) from emp group by employee_id;
Max
-
How to get the result of a single line in several columns
I have a scenario where I asked five different columns in a table and it would still look back one line.
So, for example: the query would be
So, this would mean 1 row with the value of their respective areas.Select user1, user2, user3, user4 from table1 where tblkey= 2
In my code, I have a common function I can call to send an email to the list of people (User1, User2, user3, user4).
So rather than call this function each time for each user, is there a way I can display the output to 4 different rows and use the loop For to call this function only once.
In this way, the loop For running 4 times (if not nulls for all users) and call this function of e-mail.
Really, I'd appreciate if someone could give me an idea of this scenario.
Thank you
ARIf the number of columns is fixed you may be able to use this:
SELECT DECODE ( RN , 1,USER1 , 2,USER2 , 3,USER3 , 4,USER4 ) AS USERS FROM TABLE1 CROSS JOIN (SELECT ROWNUM RN FROM DUAL CONNECT BY ROWNUM <= 4) WHERE TBLKEY = 2
This UN-pivot results.
Here's an example of it in action:
SQL> CREATE TABLE TABLE1 2 ( 3 TBLKEY NUMBER 4 , USER1 VARCHAR2(1) 5 , USER2 VARCHAR2(1) 6 , USER3 VARCHAR2(1) 7 , USER4 VARCHAR2(1) 8 ); Table created. SQL> INSERT INTO TABLE1 2 SELECT ROWNUM 3 , SUBSTR(OBJECT_NAME,1,1) 4 , SUBSTR(OBJECT_NAME,2,1) 5 , SUBSTR(OBJECT_NAME,3,1) 6 , SUBSTR(OBJECT_NAME,4,1) 7 FROM ALL_OBJECTS 8 WHERE ROWNUM <= 10; 10 rows created. SQL> SELECT * FROM TABLE1 WHERE TBLKEY = 2; TBLKEY USER1 USER2 USER3 USER4 -------------------- ---------- ---------- ---------- ---------- 2 I _ U S SQL> SELECT DECODE 2 ( 3 RN 4 , 1,USER1 5 , 2,USER2 6 , 3,USER3 7 , 4,USER4 8 ) AS USERS 9 FROM TABLE1 10 CROSS JOIN (SELECT ROWNUM RN FROM DUAL CONNECT BY ROWNUM <= 4) 11 WHERE TBLKEY = 2 12 / USERS ------------------------- I _ U S
HTH!
Published by: Centinul on February 24, 2010 11:21
-
How to make the color of ScrollBar that are created using the css code is displayed in Windows 8
I wish I could understand how to get the color of ScrollBar that are created using the css code appears on my web design theme games. But I can't see them in Windows 8. Is there something that I need to enable to see colorful scroll bars? I'm used to be able to see them on my Windows XP computer. It is important for me because a lot of people like models with colorful scroll bars.
Open the Tools menu and turn on "Compatibility view" to do. Note that this works only in the desktop version of Microsoft Internet Explorer.
-
I have a single open for Exchange 2007 Standard how license get the product key
I have a single open for Exchange 2007 Standard how license get the product key
For assistance, please contact the administrator of your Open License program.
-
How can I get the color codes for the notebook
How can I get the color codes for the notebook?
Hello
What is the color codes for the notebook?
Perhaps you need a 3rd party utility like GetDiz - Free and others to be
found using BING or Google.GetDiz Notepad - free - replacement
http://www.Outertech.com/en/Notepad-replacementI hope this helps.
-
What the devil? How can I change the color of a single border?
public static Border createSimpleBorder(XYEdges edges, XYEdges colors, int style)
How can I change the color of a single border and why in the world is the setting of colors, a type of XYEdges?
What the devil? How is it used? I threw in random numbers in the hope of a change in color, but I have nothing other than a black border.
b = BorderFactory.createSimpleBorder(new XYEdges(1, 1, 1, 1), new XYEdges(77, 55, 22, 33), Border.STYLE_SOLID);
255 should work much better than 256.
-
The knife tool develops a black line on the objects that I colored using the live paint bucket. How to get the tool knife to stop this and instead of being invisible?
I understand that it is a live paint object you use.
Try this:
Maybe you are looking for
-
M30 display on multiple monitors, the office as it is.
I have a problem with the desktop exactly seen on the desktop on another monitor to display. When I press ctrl + F5, and then select the two crt and laptop lcd, crt screen is totally out of sync. I tried different monitors, LCDs, with different prope
-
HP Probook 4740S: missing drivers
After the upgrade to Windows 10 Device Manager reports inder 'other devices' three drivers (brand, yellow on bottom exp) entilled base peripheral Systom (twice) and missing unknown device. have loaded all the software/drivers for your site for the 47
-
I have canon MP170 100. use 1/2 pro gloss or shine pro 3 paper?
What is the reason to why should I choose paper phot canon pro his 1/2 on the pro 3 photo paper luster when I created the profile of canon paper?
-
invalid license "an unauthorized change was made to windows.
"Getting an error saying: an unauthorized change was made to windows ' ran MGADiag and he says I have an invalid license. This is the copy that came with my asus laptop. will display the result of MGADiag belowAny help would be good. Cannot even run
-
Windows is losing large amounts of storage space without telling me
In recent weeks I've been watching my local disk drive (c) (only the petition on that computer) to see if I was using storage space. I noticed that I am losing a large amount of storage space. AVG disk space analysis, I have 176 GB of files in my loc