rgb

How to store Hex string in an Integer variable in android???

懵懂的女人 提交于 2019-12-11 03:12:17
问题 In the following code intArray[i] stores RGB values of pixels in hex format(eg:0xffff0000) .... The method hsvToRgb() gives bak an integer value of RGB (eg:15777252) but i need back the rgb value in the original hex format after changes. The second line gives me that but its a string ....What do i do to store this string value back into the array? ... please help me. int disco = hsvToRgb(hsv); hexColor = String.format("0x%06X", (0xffffff & disco)); intArray[i] = Integer.valueOf(String.valueOf

Powerpoint VBA - Passing RGB colors as a variable

夙愿已清 提交于 2019-12-11 03:04:49
问题 I want to allow users to enter in a RGB color via a text box and pass that variable to change the colors of all shapes. I wrote a loop that would look at the last 2 characters of the shape name to determine if it should be changed to the primary or secondary color. This is for powerpoint from the latest office 365. I've tried the following codes. I am getting either an type mismatch or invalid argument error: Dim osld As Slide Dim oshp As Shape Dim strMainColor As String, strSecondColor As

DirectShow RGB-YUV filter

帅比萌擦擦* 提交于 2019-12-11 02:53:11
问题 I would like to encode video in my app with VP8. I use RGB24 format in my app but VP8 DirectShow filter accepts only YUV format (http://www.webmproject.org/tools/#directshow_filters). I've googled the "RGB to YUV directshow filter" but no success. I don't want to write this filter myself from scratch, so I would appreciate if you help me with the information on where to find such filter. Thanks! 回答1: You could try Geraint Davies' YUV transform filter to see if it supports the conversion. 回答2:

How to reset value of captured pixel

馋奶兔 提交于 2019-12-11 02:07:33
问题 I'm trying to make a C# function that returns the R, G and B values of every fourth pixel from a screenshot bitmap. This is part of my code. for (int ix = 4; ix < 1366; ix = ix + 4) { x = x + 4; for (int iy = 3; iy < 768; iy = iy + 4) { y = y + 4; System.Drawing.Color pixelcolor = screenshot.GetPixel(x,y); red = kolorpiksela.R; green = kolorpiksela.G; blue = kolorpiksela.B; sumR = sumR + red; sumG = sumG + green; sumB = sumB + blue; } } Where screenshot is a bitmap. At the end the "sums"

C# setHue (or alternatively, convert HSL to RGB and set RGB)

我们两清 提交于 2019-12-11 01:55:40
问题 C# has a very convenient getHue method, but I can't find a set Hue method. Is there one? If not, I think the best way to define a color after changing the hue would be to convert the HSL value to RGB, and then set the RGB value. I know there are formulas on the internet for doing this, but how would I best go about performing this conversion from HSL to RGB using C#? Thank You 回答1: To set the Hue you create a new Color , maybe from a given one by using GetHue and GetSaturation . See below for

Matlab restoring the image to its original colors

梦想与她 提交于 2019-12-11 01:24:21
问题 I asked it in the past, someone suggested me to use MACBETH but I don't have enough money for having it :/ So before I photographed, I've added 3 circles to the image to be places in the image: the first circle is red with RGB of [255 0 0], the second is green circle with RGB of [0 255 0] and the third is blue [0 0 255]. Thus I can see the change about the pixels average of each of them and fix the whole image by this change. I have all the pixels of each circle. I made average of the pixels

How to get Pixel data \ Pixel buffer from a window and extract RGB?

可紊 提交于 2019-12-11 01:17:02
问题 I'm drawing text (textOut) and Rectangles on my window... and I would like to get the RGB buffer from it... How can I do it? 回答1: There are 2 options: First, you can use GetPixel(). I used it a lot. It works fine: COLORREF GetPixel( HDC hdc, int nXPos, int nYPos ); With our days processors picking up even a rect using this function may work in certain cases. Second, you can copy contents of the screen into a bitmap. After that you can place it in clipboard, process with your code, etc. The

Java - toString to Colour

无人久伴 提交于 2019-12-10 22:55:59
问题 I have been trying to work this out all day. Basically I have made a for loop which adds entries into an arraylist. One of the entries is a "Colour" varible. I have used the random.nextInt to create new values for the red, green and blue parts of the colour constructor. I have also set a toString method so I can see the values going into the arraylist. Problem is: When printing out I get : java.awt.Color[r=248,g=103,b=53] and I understand why that is so, I'm just wondering how I can change

How to write PNG files in java using pixel RGB values 0 to 1?

梦想与她 提交于 2019-12-10 22:06:26
问题 I am writing a ray tracer in java and I am trying to figure out how to write my generated image to a PNG file. So far, all the examples I have found demonstrate the use of BufferedImage to create a PNG, but they all use RGB values 0 to 255. In my code I represent each pixel colour value between 0 and 1, so for example magenta is (1, 0, 1). How can I go about writing a PNG with such values? Thanks 回答1: If you multiply your value between 0 and 1 with 255, you'll get a number between 0 and 255.

Detailed Calculation of RGB to Graylevel by Mathematica

青春壹個敷衍的年華 提交于 2019-12-10 19:59:01
问题 I tried ColorConvert[img, "Grayscale"] to convert the RGB to Graylevel . I am wondering the detailed calculation by mathematica.. Gray level= square(R^2+G^2+B^2)? or something else? 回答1: We can obtain the exact values used by mathematica by making up a 3 pixel image with pure red,green,blue and converting it: lvec = First@ ImageData[ ColorConvert[Image[{{{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}}], "GrayScale"]] {0.299, 0.587, 0.114} Note these are the "Rec. 601 luna coefficients" per http://en