Search Results

Search found 603 results on 25 pages for 'rgb'.

Page 18/25 | < Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >

  • Evaluation of jQuery function variable value during definition of that function

    - by thesnail
    I have a large number of rows in a table within which I wish to attach a unique colorpicker (jQuery plugin) to each cell in a particular column identified by unique ids. Given this, I want to automate the generation of instances of the colorpicker as follows: var myrows={"a","b","c",.....} var mycolours={"ffffff","fcdfcd","123123"...} for (var i=0;i<myrows.length;i++) { $("#"+myrows[i]+"colour").ColorPicker({flat: false, color: mycolours[i], onChange: function (hsb, hex, rgb) { $("#"+myrows[i]+"currentcolour").css('backgroundColor', '#' + hex); } }); Now this doesn't work because the evaluation of the $("#"+myrows[i]+"currentcolour") component occurs at the time the function is called, not when it is defined (which is want I need). Given that this plugin javascript appends its code to the level and not to the underlying DOM component that I am accessing above so can't derive what id this pertains to, how can I evaluate the variable during function declaration/definition? Thanks for any help/insight anyone can give. Brian.

    Read the article

  • CreatePatternBrush and screen color depth

    - by Carlos Alloatti
    I am creating a brush using CreatePatternBrush with a bitmap created with CreateBitmap. The bitmap is 1 pixel wide and 24 pixels tall, I have the RGB value for each pixel, so I create an array of rgbquads and pass that to CreateBitmap. This works fine when the screen color depth is 32bpp, since the bitmap I create is also 32bpp. When the screen color depth is not 32bpp, this fails, and I understand why it does, since I should be creating a compatible bitmap instead. It seems I should use CreateCompatibleBitmap instead, but how do I put the pixel data I have into that bitmap? I have also read about CreateDIBPatternBrushPt, CreateDIBitmap, CreateDIBSection, etc. I don´t understand what is a DIBSection, and find the subject generally confusing. I do understand that I need a bitmap with the same color depth as the screen, but how do I create it having only the 32bpp pixel data?

    Read the article

  • How to create Bitmap object from a Graphics object ?

    - by vi.su.
    How to create Bitmap object from a Graphics object ? I would like to read pixels from my Graphics object. for example, like, System.Drawing.BitMap.GetPixel(). I am trying to find out empty area (all white, or of any colour) inside a pdf document, to write some graphics / image. I have tried like this, but it is not working. why the following code is not working as expected ? // // System.Drawing.Bitmap // System.Drawing.Graphics // Bitmap b = new Bitmap(width, height, graphics); // // In this case, for any (i, j) values, Bitmap.GetPixel returns 0 // int rgb = b.GetPixel(i, j).ToArgb(); ( posting this question again in .net-only context, removing other library dependencies )

    Read the article

  • Magick++ Read Image with ICC colorspace

    - by FlashFan
    Hi guys I need to know how I can read an image which uses a separate ICC Color Profile. The image consists of 26'099'520 Bytes which is the result of 2480 width* 3508 height * 3 components per pixel. I tried it with the following code: Image * image = new Image(); Blob * blob = new Blob(imagedata.c_str(),imagedata.length()); image->read(*blob,Geometry(2480,3508),8,"RGB"); Blob * iccblob = new Blob(iccdata.c_str(),iccdata.length()); image->iccColorProfile(*iccblob); image->write("result.jpg"); But the colors are the same as when I don´t set the Icc-profile to the image. And the colors are wrong in both cases. Thanks for your help!

    Read the article

  • Hidden Features of Visual Studio (2005-2008)?

    - by shoosh
    VS is such a massively big product that even after years of working with it I sometimes stumble upon a new/better way to do things or things I didn't even know were possible. For instance- Crtl-R,Ctrl-W - show white spaces. essential for editing python build scripts. Under "HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\8.0\Text Editor" Create a String called Guides with the value "RGB(255,0,0), 80" to have a red line at column 80 in the text editor. What other hidden features have you stumbled upon?

    Read the article

  • Where can I find a jQuery color animation plugin?

    - by George Edison
    I need an up-to-date jQuery color animation plugin that works in IE 8. I tried using the one at http://plugins.jquery.com/project/color but it causes errors like "Invalid property value." in the following line of code from color.js: fx.elem.style[attr] = "rgb(" + [ Math.max(Math.min( parseInt((fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0]), 255), 0), Math.max(Math.min( parseInt((fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1]), 255), 0), Math.max(Math.min( parseInt((fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2]), 255), 0) ].join(",") + ")"; Where can I get something that works? By the way, I really hate IE, if that helps.

    Read the article

  • MATLAB: draw centroids

    - by Myx
    Hello - my main question is given a feature centroid, how can I draw it in MATLAB? In more detail, I have an NxNx3 image (an rgb image) of which I take 4x4 blocks and compute a 6-dimensional feature vector for each block. I store these feature vectors in an Mx6 matrix on which I run kmeans function and obtain the centroids in a kx6 matrix, where k is the number of clusters and 6 is the number of features for each block. How can I draw these center clusters in my image in order to visualize if the algorithm is performing the way I wish it to perform? Or if anyone has any other way/suggestions on how I can visualize the centroids on my image, I'd greatly appreciate it. Thank you.

    Read the article

  • WPF: How to efficiently update an Image 30 times per second

    - by John
    Hello, I'm writing a WPF application that uses a component, and this component returns a pointer (IntPtr) to pixels of a bitmap (stride * height). I know in advance that the bitmap is a 24bits rgb, its width and height. Updating the Image control with these bitmaps makes up a video to the user, but I'm not sure what's the most efficient way to do that, most of the time the CPU usage goes to 75%+ and memory changing from 40mb to 500mb and the nI think GC starts to work and then it drops again to 40mm. The app starts to not be responsive. What shoud I do? thanks!

    Read the article

  • How to change font size using the Python ImageDraw Library

    - by Eldila
    I am trying to change the font size using python's ImageDraw library. You can do something like this: fontPath = "/usr/share/fonts/dejavu-lgc/DejaVuLGCSansCondensed-Bold.ttf" sans16 = ImageFont.truetype ( fontPath, 16 ) im = Image.new ( "RGB", (200,50), "#ddd" ) draw = ImageDraw.Draw ( im ) draw.text ( (10,10), "Run awayyyy!", font=sans16, fill="red" ) The problem is that I don't want to specify a font. I want to use the default font and just change the size of the font. This seems to me that it should be simple, but I can't find documentation on how to do this.

    Read the article

  • border highlighting loop with jquery

    - by Tek
    I'm having trouble coming up with a loop that changes the border color of an image from black to yellow and yellow to black over x seconds. Then applying an interrupt to the loop when the image gets clicked on. I don't know where to start, can someone point me in the right direction? I think I may be using the wrong tools to properly write this. Here's what I've come up so far, though if there's a better way to write this, do share! for( i = 100; i >= 0; i--) { $("#imgid").css("border-color", 'rgb(' + i + '%,' + i + '%,0)'); } I'm having trouble picturing how I could combine two loops so that I can also count upwards as well so that it will turn into yellow and back to black. I also don't know how to go about controlling the amount of time it takes for that loop to execute and creating an interrupt when #imigid is clicked. Which is where I'm not sure how to write.

    Read the article

  • HOw to Extract image pixels and perform computation on it

    - by gavishna
    What i want to do is extract the pixels into array A(i,j).Let A(i,j) represent the pixel in the ith row & jth colm of the image. Let B(i,j) be the transformed array containing bits such that B(i,j) = 1 if (A(i,j)/2^t) mod 2 =1, where t=0,1,2,3,4,5,6,7 = 0 otherwise Then the array B(i,j) will be mutliplied by another array say C(i,j) representing another image. Then i want to plot the result of B*C as an image. How do i take in the pixels for the above conditions for both gray and RGB color format.Also how do i solve the above problem.Any helo will be usefull because i am not an expert in image processing.

    Read the article

  • Is there any method in Cocoa that helps iterating through all NSColor values(R,G,B only, alpha not t

    - by krasnyk
    You may ask why do I need it? I have to detect all white objects at the B/W image. I'm coloring each object and taking its rect. In order fill each object with different color I would be very happy to use a function that can for a given color gimme a next one or so. In Qt there is a nice one that is called nextColor or so, returns the integer representing the next color(which can be easily translated to RGB). Does Cocoa have sth like that?

    Read the article

  • embedding a slideshow photo gallery with Picasa that autorepeats?

    - by user248237
    how can I modify the embedded photo gallery slideshow from Google's Picasa to auto repeat the pictures, i.e. play them over and over again? This is the code Picasa gives me for embedding in a website: <embed type="application/x-shockwave-flash" src="http://picasaweb.google.com/s/c/bin/slideshow.swf" width="400" height="267" flashvars="host=picasaweb.google.com&hl=en_US&feat=flashalbum&RGB=0x000000&feed=http%3A%2F%2Fpicasaweb.google.com%2Fdata%2Ffeed%2Fapi%2Fuser%2F102341124641778821128%2Falbumid%2F5469290618448219537%3Falt%3Drss%26kind%3Dphoto%26hl%3Den_US" pluginspage="http://www.macromedia.com/go/getflashplayer"> Related to this, are there free tools that take as input a Picasa username or a set of photos and automatically create a thumbnailed gallery, which is embeddable using Flash in any website? thanks.

    Read the article

  • WebGL transparent black.

    - by Catalin Dumitru
    I have a strange problem that I can't figure out when trying to do blending in WebGL. Black is rendered fully transparent , and everything with shades of grey in it is rendered also semi transparent. I have set it to use the alpha channel as the source for transparency, and in some respect it works, every thing that isn't black/grey is rendered differently when changing the alpha value. but even when I set the alpha to 1, black is still displayed transparent. This is how I enable transparency: this.gl.blendFunc(this.gl.SRC_ALPHA, this.gl.ONE); this.gl.enable(this.gl.BLEND); this.gl.disable(this.gl.DEPTH_TEST); And the part of the shader that does transparency: gl_FragColor = vec4(texColor.rgb * vLightWeight, texColor.a * uAlpha); where texColor is the texture color that is being sampled, vLightWeight is the shadowing that is being calculated in the vertex shader, and uAlpha the uniform which I use for transparency.

    Read the article

  • Problems encountered in changing a CRichEditCtrl selection color.

    - by dev ray
    I have written the following code after creating the CRichEditCtrl // 06112010 : The following code was added to highlight the textselection in black color instead of the default blue color of CRichEditCtrl. - 1311 { m_EditControl.SetSel(0,100); CHARFORMAT2 cf1; cf1.cbSize = sizeof(CHARFORMAT2); m_EditControl.GetSelectionCharFormat(cf1); cf1.dwMask = CFM_BACKCOLOR ; cf1.dwEffects &= ~CFE_AUTOBACKCOLOR; cf1.crBackColor = RGB(0,0,0); m_EditControl.SetSelectionCharFormat(cf1); m_EditControl.Invalidate(); } After this I am adding text, but the selection still comes in blue color instead of Black. Could someone please tell me what I am doing wrong?? Thanks, DeV

    Read the article

  • Getting normal information from OpenGL render output

    - by okamiueru
    I'll try to keep this simple. I want a way to access the normal information of the scene, from the Frame Buffer output (or similar). The same way one is able to access the Depth Buffer using glGetTexImage and GL_DEPTH_COMPONENT. I know I could set up a fragment shader which outputs the normal information in RGB color space, which could in turn be read from the rendered image. I'm wondering however if there is a way to do this within the openGL API. I'll clarify anything upon request as best as I can, Thank you

    Read the article

  • How to make this jpeg compression faster

    - by Richard Knop
    I am using OpenCV to compress binary images from a camera: vector<int> p; p.push_back(CV_IMWRITE_JPEG_QUALITY); p.push_back(75); // JPG quality vector<unsigned char> jpegBuf; cv::imencode(".jpg", fIplImageHeader, jpegBuf, p); The code above compresses a binary RGB image stored in fIplImageHeader to a JPEG image. For a 640*480 image it takes about 0.25 seconds to execute the five lines above. Is there any way I could make it faster? I really need to repeat the compression more than 4 times a second.

    Read the article

  • Color generation based on random number

    - by Mikulas Dite
    I would like to create a color generator based on random numbers, which might differ just slightly, but I need colors to be easily recognizable from each other. I was thinking about generation then in a rgb format which would be probably easiest. I'm afraid simply multiplying given arguments wouldn't do very well. What algorithm do you suggest using? Also, second generated color should not be the same as previous one, but I don't want to store them - nor multiplying with (micro)time would do well since the scripts' parts are usually faster.

    Read the article

  • Bind event to shape on canvas

    - by Ben Shelock
    How can I bind an event to a shape drawn on a canvas? I presumed this would work but I get an error. <html> <head> <script type="application/javascript"> function draw() { var canvas = document.getElementById("canvas"); var ctx = canvas.getContext("2d"); ctx.fillStyle = "rgb(200,0,0)"; var rec = ctx.fillRect (0, 0, 55, 50); rec.onclick = function(){ alert('something'); } } </script> </head> <body onLoad="draw()"> <canvas id="canvas" width="300" height="300"></canvas> </body> </html>

    Read the article

  • glBlendFunc() with 32-bit RGBA textures

    - by oldSkool
    I have a texture that is semi-transparent with varying opacity at different locations. I have the main texture bitmap, and a mask bitmap. When the program executes, the alpha values from the mask bitmap are loaded into the alpha values of the main texture bitmap. The areas that I want to be transparent have a value of 255 alpha, and the areas that I want to remain totally opaque have values of 0 alpha. There are in-between values also for mid-transparency. I have tried all manner of glBlendFunc() settings, but it is either completely invisible or it acts on the RGB colors of the source texture. Any help out there?

    Read the article

  • Array::ConvertAll in managed C++

    - by danny.lesnik
    This is a continuation from this post. I'm trying to parse this string in managed C++: String ^ rgba = "[0.09019608,0.5176471,0.9058824,1]"; cli::array<System::Double> ^ RGB = System::Array::ConvertAll<String,cli::array<System::Double> >((rgba->Substring(1,rgba->Length-2)->Split(',')),double::Parse); Compiler throws me the following error: Error 15 error C2770: invalid explicit generic argument(s) for 'cli::array<Type,dimension> ^System::Array::ConvertAll(cli::array<TInput,1> ^,System::Converter<TInput,TOutput> ^)' What am I doing wrong?

    Read the article

  • How do I determine darker or lighter color variant of a given color?

    - by Nidonocu
    Given a source color of any hue by the system or user, I'd like a simple algorithm I can use to work out a lighter or darker variants of the selected color. Similar to effects used on Windows Live Messenger for styling the user interface. Language is C# with .net 3.5. Responding to comment: Color format is (Alpha)RGB. With values as bytes or floats. Marking answer: For the context of my use (a few simple UI effects), the answer I'm marking as accepted is actually the most simple for this context. However, I've given up votes to the more complex and accurate answers too. Anyone doing more advanced color operations and finding this thread in future should definitely check those out. Thanks SO. :)

    Read the article

  • How to create an ARGB_8888 pixel value?

    - by vidstige
    Say I want to create an array of pixel values to pass into the createBitmap method described here. I have three int values r, g, b in the range 0 - 0xff. How do I transform those into a opaque pixel p? Does the alpha channel go in the high byte or the low byte? I googled up the documentation but it only states that: Each pixel is stored on 4 bytes. Each channel (RGB and alpha for translucency) is stored with 8 bits of precision (256 possible values.) This configuration is very flexible and offers the best quality. It should be used whenever possible. So, how to write this method? int createPixel(int r, int g, int b) { retrurn ? }

    Read the article

  • How do I create a text image with a transparent value for the text with image magick

    - by kareed
    I am using the following command to create an image of text with a shadow. What I would like to do is to create the text with a transparent opacity. system('convert -background transparent ' . '-fill rgb(127, 127, 127) ' . '-pointsize 30 ' . 'label:"This is a test" ' . '-background transparent -flatten -trim +repage ' . $fileName); how would I go about modifying this to accomplish getting transparent text?

    Read the article

  • Calculating color shades

    - by matejv
    I have the next problem. I have a base color with couple of different shades of that color. Example: Base color: #4085c5 Shade: #005cb1 Now, I have a different color (let's say #d60620), but no shades of it. From the color I would like to calculate shades, that have similar difference as colors mentioned in first paragraph. First I tried calculating difference of RGB elements and applying them to second color, but the result was not like I expected to be. Than I tried with converting color to HSV, reading saturation value and applying the difference to second color, but again the resulting color was still weird. The formula was something like: (HSV(BaseColor)[S] - HSV(Shade)[S]) + HSV(SecondColor)[H] Does anyone know how this problem could be solved? I know I am doing something wrong, but I don't know what. :)

    Read the article

< Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >