Meter's scale color

Hi anyone who can programtically change the property of the meter, Scale.MarkerVals? 
I could not find ways to pass the values to control the colour range properly..  I have attached it for you.
That's how it works. After the colour ranges for the meter has been set. The again the colour range
has to adjusted with the new numbers, using the replace array subset function, on these index elements 2 and 3.
Clement
Attachments:
merter's scalecolor_val.vi ‏52 KB

Ok - let's try..
Each color range has a left and a right border. So you have to specify these - for each color range two elements in an array.
I modified your vi and activated the "Interpolate colors" flag.
Just have a look at it.
Hope it helps.
Thomas
Using LV8.0
Don't be afraid to rate a good answer...
Attachments:
merter's scalecolor_val.vi ‏31 KB

Similar Messages

  • Gray scale color table

    I want to make a picture out of an 8-bit unsigned integer 2D matrix of data. I can successfully do that using the "draw unflattened pixmap" function. However, it requires a color map. If you don't wire the color map, it uses the default labview color map. I want to use a gray scale color map (numbers between 0 and 255 corresponding to colors ranging from white to black). I am not sure how to make this color map and implement it. I appreciate any help.
    Solved!
    Go to Solution.

    Jahan wrote:
    The problem seems to be solved this way. Although it seemed to work (I got a gray scale image), I am not sure if what I have done is technically correct (if there is a better way of doing it). If someone wants to comment on it, I would appreciate.
    Yes, this is technically correct (top). (Typically you can do it once, then right-click the indicator and "change to constant" and delete the loop code.)
    You might also flatten the rgb tool code to the diagram (bottom). This has the advantage that the entirel loop will be calculated once at compile time and internally folded into a constant so the loop actually never spins during execution of the program (See also). (Of course this particular loop is trivial and nothing to worry about, performance wise. ) 
    Message Edited by altenbach on 03-14-2009 09:57 AM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    greyscale.png ‏6 KB

  • DigitalColor Meter show other colors as created in application.

    Hi community.
    I'm not an expert in color and maybe I make a mistake or don't understand the workflow.
    I create different colored boxes in TextEdit and other application. Both use the same OS X color tool to define the color.
    I define the color RGB. R in one box, G in second box and B in third box.
    See attachement with example for red, it means R=255 / G=0 / B=0.
    Green box is R=0 / G=255 / B=0
    Blue box is R=0 / G=0 / B=255
    When I use DigitalColor Meter from OS X 10.6 it show other color when I move over the different boxes.
    Result of DigitalColor Meter is:
    Red R = 255, G = 19, B = 20
    Green R = 0, G = 251, B = 52
    Blue R = 45, G = 44, B = 250
    What is wrong ?
    What is my mistake ?
    Do I don't make the right workflow ?
    Regards
    Jochen

    @Roger
    Thanks. Now clear Help of DigitalColor Meter.
    which gives you a read-out in different formats used by different programs.
    In Help is following workflow.
    Gehen Sie wie folgt vor, um Farben mit dem Programm "DigitalColor-Farbmesser" anzupassen:
    Öffnen Sie das Programm "DigitalColor-Farbmesser". Sie finden dieses Programm unter "Programme" > "Dienstprogramme". Programm "DigitalColor-Farbmesser"
      2.   Wählen Sie aus dem Einblendmenü einen Farbraum aus.
      3.    Bewegen Sie den Zeiger über die Pixel, die Sie anpassen möchten.Beim Bewegen des Zeigers werden die          entsprechenden Farbwerte angezeigt.
    My simple translation is:
    Do you do following to adapt colors with DigitalColor Meter
    1. Open application DigitalColor Meter ... and so on. OK
    2. Select from menü the color system. OK
    3. Move the mouse about pixel which do you will change. By moving the mouse the color of pixels will show.
    I cannot see in which way I can change the color in original. I can only make a copy of actual values of color in different color systems.
    Jochen

  • How to I maintain a meter's scale position when resizing the meter?

    I'd like to be able to programmatically resize a meter and have its scale's size and position be predicitable. This is not the case. I've attached a VI that illustrates the problem.
    I thought that keeping the meter's aspect ration of 4:3 would suffice, as in my attached example, but even that doesn't help.
    Attachments:
    meter_resizing_problem.vi ‏19 KB

    I don't know the solution yet but this is what i found.
    wiring the scale position will make it even worse. see attachment.
    Scale bounds will change after every run, but you aren't able to make it write so it has no use.
    The amount of distortion is a bit variable to the amount of samples the for loop creates.
    The scale bound is random after each run.
    I guess this a buf of labview, but  I don't know for sure
    UnCertified LabVIEW Student
    Mistakes are for learning, that's why suggestions are always welcome!
    Attachments:
    1.PNG ‏55 KB
    Position.PNG ‏65 KB
    many.PNG ‏59 KB

  • Auto-range meter w Scale.MarkerVals[]

    Hi. I am building a simple program but cannot figure it out.
    I have a meter with auto-range that can be adjusted automatically as I adjusted the knob.
    Also I have a colour limits that can be seen on the meter. The reason I used colour limits is because the operator 
    can adjust the knob without eye strains. 
    Here's an attached.
    Note:- Auto range and scale.markervals[] cannot used together otherwise the meter cannot be read.
    Pls save it as version 7 so that I can open it without delay.
    Cheers
    Clement 
    Attachments:
    autorange_markcolours.vi ‏37 KB

    With one property, you're setting scale.maximum and with the other, you're setting what the markers should be. Setting the last marker to 50 is the same as setting the scale.maximum and since they are two different values, you see the dial bouncing around. Instead of wiring a constant to the last marker, wire it to the same point where you calculate the scale max.

  • How to convert color image(24 bit) YUV 4:2:2 to gray scale 8 bit image

    I am using sony DFW-X700 color camera for one of vision applications.Does NI Compact Vision System(CVS) support YUV 4:2:2 format(8 bit each).I want to do gray scale processing, so i need to convert the YUV color into gray scale (8-bit) in the software(like Labview). Please suggest us how to do this conversion for better gray scale image clarity from color.

    In YUV color space, Y represents the gray scale; in RGB color space, R=G=B represents gray scale. You can simply set R=G=B=Y, to convert YUV to RGB. If the original color depth is 24 bit, then the result is 24 bit too.
    You can create gray scale color table like this:
    array size = 256;
    [0] = 0x000000;
    [1] = 0x010101;
    [2] = 0x020202;
    [255] = 0xFFFFFF;
    To convert 24 bit gray scale to 8 bit, check every pixel in 24 bit image to find the array index according to the color table, and replace the pixel with array index.
    George Zou
    http://gtoolbox.yeah.net
    George Zou
    http://webspace.webring.com/people/og/gtoolbox

  • Color correction

    there was a thread on cs5 about this that interested me, so I started new thing here cause Im using cs3..
    Shooternz, your help in the cs5 thread was great...and this is what I did....in my particular circumstances...
    ( I have to say that this is really the first time I'm sorta getting serious about CC and using the scopes etc...to try to learn this better )
    I know the basics and the monitor stuff and the way people shoot properly exposed grayscale, color etc on set for calibration ( using film mostly in my experience, but done with digital too as I've seen )...
    Sooo, here's the thing... I shot this clip as a test to see how long the music had to be to get a mssg across later on ( an insert shot that I will shoot on the day in the right location etc )... so this was a timing test sorta....didnt care about the lighting.
    However, since I shot it I've tried to make it as good as I can ( why not ? )
    I had a flourescent unit ( drop down ceiling 32K flourescents ) above...but it read about 36k on color meter and needed color correction at that ( LB and CC correction ..know what I mean ? )...so OK...who cares, its a test and timing only sooooo I dont put gels on the light and just shoot.
    Soooo, I DID IN FACT put a grayscale down to fix it later if possible....even though it wasn't lit right....
    This is what it looks like basically...
    pretty terrible...very yellow and compressed tones etc...not good...
    Soo, following your suggestions in thread in cs5, using waveform and vectorgraph, I come up with this instead..
    WAYY BETTER !  ( thank you ! )....but...not perfect...thats OK, I didnt light it right...but better ....
    Now, though, when I paste attributes of this to the clip in question I end up with this pixelation or "splotchy " stuff..as shown here
    Now, my experience using psd tells me that if you try to correct too much, there's a sorta " limit" to what you can do, and things start just plain getting screwed up..."splotchy" like this...  but if I had some way to just pick on the "yellow" gamma or something maybe I could get rid of it ....OR do a color replacement ( change ??? )... like pick out that particular color and change it to something closer to the white???  Have you ever dealt with this type thing ???  I know I started out all wrong to begin with but am wondering what you think ??
    Thanks !
    Rod
    ps...this was a dumb test so please dont , you know, put much into this...I know I shot it all screwed up to begin with..

    Hey Rod
    Your CC looks fine and if the intention was to correct the col temp and exposure issue..you did fine.  I see you have a full scale of tones in the greys.
    Obviously you should start off with a correct  exposure  and that doesn ot necessarily mean a "technically correct" exposure.
    You do not have to shoot and CC / grade to display the full range from Balck to white.
    Its important to rember that the CC and grade (and the composition) are part of "the story"  At times you will want crushed blacks and other times you may want a high key look or compressed tones in the mid.  Then afetr the "tones" you think about what color tells the story.
    Always..... Levels before Color correction!
    BTW - the eye rules but ensure technically that the scopes confirm what you think you see.
    Heres someof my images reflecting different CC for a "fit with the story"
    Flat , clean,compressed mid tones, clinical ( a green screen BTW)
    Dark , compressed toward blacks with detail in mids, juicy highlightsdramatic ( slo mo)
    Full tonal range,hi color, "summer on xmas day"
    full range color and tone, texture "yummy"
    Clean and clinical mid ranges with slight color de-saturation of BG
    FG grade to match bg (key) and fit time of day look.
    Keep in mind...the above shots started in the photography and the cc / grade is enhancement.
    Good luck mate.

  • Color management policies

    If color management policies are turned off in Photoshop's Color Settings dialogue panel what happens when a file is pasted into a document that has a different working space? Does the pasted file get converted to the working space or are the numbers assigned to the working space?
    EG: Working space is Adobe RGB 1998 and the file being pasted into that document has an Adobe sRGB space. Will the color numbers in the pasted document be converted to Adobe RGB 1998 or will they be assigned?
    Thanks

    There is no “No Color Management” behavior in Photoshop despite the silly OFF policy. The RGB numbers are untagged and thus undefined but under the hood, Photoshop is still using its color management and Display Using Monitor Compensation architecture. The RGB working space you set in the Color Settings is what is used for the assumption of the scale ( color space) of the untagged data. Same with CMYK etc. All you have to do is open an untagged RGB doc, go into Color Settings and alter the RGB working space popup and the color appearance changes (not the numbers) because now PS is making a new assumption about this untagged RGB mystery meat. The OFF policy and untagged docs are bad, bad, bad!

  • Changing colors in templates

    Hello.
    I am sure this is soooo easy and soooo obvious, but I am not seeing it. When using the Special Occasion template, there are some light blue boxes in the design. How can I change the color?
    Thanks.

    well suuuuuuuuuure it's easy! I mean, this is an Apple product, right?!?
    Okay, sarcasm induced from my own frustration at trying to change what SHOULD be simple, aside, this is what you need to do. Using a text editor (BBedit is my fav) navigtate to:
    /Applications/Aperture.app/Contents/Resources/Book Themes/Special Occasion/Hardcover/Graphics/BlueRect.plist
    change line 5 which says: <string>{242, 255, 244, 100}</string> to whatever you want. They are (in order) Red, Green, Blue, Value and you will need some tool like the Digital Color Meter or Apple Color picker to help you translate your pref'd color into the necessary values. I'd recommend saving a copy of the file in case things go sideways.
    Good luck, and in general anything you want to change can be done this way in the plist and other files in the packages.

  • Basket element's color in listing

    Hello, professionals,
    OrgChart 3.0 SP2
    I've met following problem:
    color for employees selected elements in basket is default, not like in OrgChart structure.
    I am using in OrgChart structure OrgUnits and Positions, Orgunits selected elements has same custom color in structure's basket and in lisiting basket. And employees elements has default grey color. How can I customize this color?
    Thanks
    Best regards,
    Alexander.

    The basket detail uses presentation "BasketItemXSL", so try looking at:
            ...\Templates_SAP\BasketItemXSL.xsl
    But my feeling is that this is not your root cause.
    I think the object colour should be controlled by the extrainfo item in the orgchartconfiguration file (e.g. "SAPOrgUnitOrgChart.xml") for the hierarchy in question.
    e.g. for position hierarchy:
    <item name="objectcolor">FFE76B</item>
    OSS could be the route to go ...
    Regards,
    Stephen

  • Color Management-Where is my error?

    30" Apple Cinema Display recently calibrated with Eye-One Display 2. Photoshop CS3 color space is North America General Purpose 2. I open Digital Color Meter, take a color (#5e90ba) from a web page in Safari. I make a new Photoshop document, fill it with aforesaid color, save it and set it as my desktop. Digital Color Meter says my Desktop is displaying #5e8cb7, not #5e90ba, and visually, there is a very slight difference between the color on the web page & my desktop. I just can't wrap my mind around this. What is going on here?

    I think it's the OS as Ann has stated. If I take an image, for example, and save converting the image from working Adobe RGB profile to sRGB while embedding the icc profile and use a web browser like Safari, the image will look exactly like it does in Photoshop. But that is because I assigned the profile to go with the sRGB image. But when I put the image as a wallpaper on the desktop, the image is all of a sudden less saturated. I can instantly see the colors shifted or toned down a tad. Now, add to that I do not think the monitor, no matter how well I have tried to calibrate using Monaco XR Pro with Color Eyes software - I cannot say the gamma available with my Apple Cinema Display of 23" is accurate even at this point. But the fact that the image will match in PS and Safari but not the desk top shows that yes, the desktop does not see the profile along with the image.
    Have you tried to go to Photoshop and under Edit menu, use Monitor Space as your color space and see if that now matches the desktop? They should now match. Meaning there will always be a difference between the two even locally on one machine.
    The fact that it wasn't a JPG doesn't mean anything. It is only the way the color (an arbitrary number in this case) is displayed to your eyes on the monitor. Again, your monitor space will not match your working space unless you change the two spaces to match in PS or what ever app you are using with color management because you created a working space using calibration.
    The working space is created by the hardware/software calibrating tools as you know. And for me, coming from the PC side recently to the Mac side, I can say that Color Eyes makes more corrections to an Apple Cinema Display than any monitor of any price I used on the PC side. Granted, once calibrated, it looks incredible. The Macbook Pro laptop is the biggest disappointment due to the fact that it is not true 32 or 24 bit but some say really bad, like 6 bit.
    Anyway, I think Ann has stated what you need to grasp and to show the extent of it, just go to PS and change your Color Profile to Monitor Space instead of a working space and see what happens.

  • How to get right color output whit export.

    Hello,
    Does anyone know how to get the same color/gamma output with export as in the original footage ?
    I noticed that when exporting a clip in h.264 or mp4 or quicktime h.264 or mp4, the colors get messed up, or the gamma I don't know really. You can try it yourself.
    Here's a link to a testscreen image in png format:
    http://joeljohnson.com/wp-content/uploads/2009/08/bbc-hd-test-card.png
    I use the standard "digital color measurement tool" app, provided with mac OS X to check what happens with the colors.
    The white, grey and black boxes in the left of the picture should be, Black 0%, Grey 20%, grey 40%, Grey 60%, Grey 80% and whie(100%). The red colorblocks inthe picture contain about 2,7% blue and 85% red.
    Whenever I import this file in Imovie, the grey scale colors are already a bit changed. About 2% or 4%.
    But what bothers me most is that the red blocks contain about 7% blue, 3 times as much as it supposed to contain.
    On export the color difference maintain when viewed in quicktime. When viewed in VLC, the grey boxes are displayed as meant to be, 0%, 20%, 40%, 60%, 80% and 100%. So this is probably the well known and discussed gamma shift. BUT the red boxes contain about 7% blue, even when viewed in VLC, why!!!! I can't live with that, I have a red car, but when viewed on video on my computer...it has a blue cast, it's not red, it gets slightly purple. Does anyone know how to solve this problem, and by the way, the other colors in the testscreen image are also shifted on import and export. It keeps me awake at night...Help me please.

    Hi,
    It is same for template.Double Click on the template.
    Then Go to Template TAB.
    Click to select the line type. If it showing a pencil type icon then click the pencil icon above .
    Other thing is given above.
    regards
    Sandipan
    Edited by: Sandipan Ghosh on Apr 2, 2008 4:16 PM

  • I'm working with directx and it does working only on some of the Bitmaps. Why it's not working on the others ?

    The question is not so clear i will try to explain here.
    I have a trackBar scroll event:
    private void trackBar1_Scroll(object sender, EventArgs e)
    LoadPictureAt(trackBar1.Value, sender);
    ConvertedBmp = ConvertTo24(trackBar1FileInfo[trackBar1.Value].FullName);
    ConvertedBmp.Save(ConvertedBmpDir + "\\ConvertedBmp.bmp");
    mymem = ToStream(ConvertedBmp, ImageFormat.Bmp);
    backTexture = TextureLoader.FromStream(D3Ddev, mymem);
    scannedCloudsTexture = new Texture(D3Ddev, 512, 512, 1, Usage.Dynamic, Format.A8R8G8B8, Pool.Default);
    timer1.Stop();
    Button1Code();
    timer1.Start();
    b1 = ConvertedBmp;
    b1.Save(ConvertedBmpDir + "\\b1.bmp");
    trackBar2.Enabled = false;
    if (!this.backgroundWorker1.IsBusy)
    label2.Text = "מעבד נתונים";
    this.backgroundWorker1.RunWorkerAsync();
    else
    this.backgroundWorker1.CancelAsync();
    First LoadPictureAt method:
    private bool LoadPictureAt(int nIndex, object c)
    bool bRet = false;
    if (nIndex >= 0 && nIndex < trackBar1FileInfo.Length)
    if (c.Equals(trackBar1))
    pictureBox1.Load(trackBar1FileInfo[nIndex].FullName);
    bRet = true;
    if (bitmaps != null)
    if (nIndex >= 0 && nIndex < bitmaps.Length)
    if (c.Equals(trackBar2))
    pictureBox1.Image = bitmaps[nIndex];
    bRet = true;
    return bRet;
    Then the ConvertTo24 method:
    private Bitmap ConvertTo24(string inputFileName)
    sw = Stopwatch.StartNew();
    Bitmap bmpIn = (Bitmap)Bitmap.FromFile(inputFileName);
    Bitmap converted = new Bitmap(bmpIn.Width, bmpIn.Height, PixelFormat.Format24bppRgb);
    using (Graphics g = Graphics.FromImage(converted))
    // Prevent DPI conversion
    g.PageUnit = GraphicsUnit.Pixel;
    // Draw the image
    g.DrawImageUnscaled(bmpIn, 0, 0);
    //converted.Save(outputFileName, ImageFormat.Bmp);
    sw.Stop();
    return converted;
    Then ToStream method:
    public static Stream ToStream(Image image, ImageFormat formaw)
    var stream = new System.IO.MemoryStream();
    image.Save(stream, formaw);
    stream.Position = 0;
    return stream;
    What it does is taking a Bitmap image and make a doppler radar effect on it and detect color only places that there are pixels(clouds) in it.
    Here is a screenshot:
    You can see the doppler shape and it's moving around and highlight the places with clouds.
    So when i move the trackBar1 to the left each time on another Bitmap image it's showing the doppler effect and the clouds.
    The problem is with the trackBar2 scroll event:
    First when i'm running my program and enteric to this new form that scan the clouds and show the doppler radar effect a backgroundworker1 is working:
    private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
    BackgroundWorker bgw = (BackgroundWorker)sender;
    if (bgw.CancellationPending == true)
    return;
    else
    while (true)
    bitmaps = ImagesComparison.get_images_with_clouds(b1);
    for (int i = 0; i < bitmaps.Length; i++)
    bitmaps[i] = ConvertTo1or8Bit.ColorToGrayscale(bitmaps[i]);
    break;
    What it does is getting into bitmaps(Bitmap[])  15 new bitmaps from one given bitmap. The given bitmap is b1.
    b1 i'm using it in trackBar1 scroll event.
    All the new Bitmaps in bitmaps variable array are Format32bppArgb.
    While i checked on my hard disk the images(GIF type) i'm using with trackBar1 are all Bit Depth 8.
    The images i'm using with trackBar1 scroll event are GIF types and Bit Depth 8 on the properties.
    The images i'm using in trackBar2 are Bitmaps and they are Format32bppArgb.
    So first thing i thought to convert all the 15 Bitmaps in bitmaps to 8bit:
    for (int i = 0; i < bitmaps.Length; i++)
    bitmaps[i] = ConvertTo1or8Bit.ColorToGrayscale(bitmaps[i]);
    But it didn't work it's just turning them to black gray scale colors not what i was thinking about.
    In the backgroundworker completed event i'm converting the bitmaps to 24 like i'm doing with the Gifs in trackBar1 scroll event:
    private void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
    trackBar2.Enabled = true;
    trackBar2.Maximum = bitmaps.Length -1;
    bitmaps[0].Save(ConvertedBmpDir + "\\bitmapsfirstimage.bmp");
    for (int i = 0; i < bitmaps.Length; i++)
    ConvertedBitmaps.Add(ConvertTo24(bitmaps[i]));
    ConvertedBitmaps[0].Save(ConvertedBmpDir + "\\ConvertedBitmapsFirstImage.bmp");
    label2.Text = "עיבוד הנתונים הסתיים";
    b1.Dispose();
    Then in the trackBar2 scroll event:
    private void trackBar2_Scroll(object sender, EventArgs e)
    LoadPictureAt(trackBar2.Value, sender);
    ConvertedBmp = ConvertedBitmaps[trackBar2.Value - 1];
    ConvertedBmp.Save(ConvertedBmpDir + "\\ConvertedBmp.bmp");
    mymem = ToStream(ConvertedBmp, ImageFormat.Bmp);
    backTexture = TextureLoader.FromStream(D3Ddev, mymem);
    scannedCloudsTexture = new Texture(D3Ddev, 512, 512, 1, Usage.Dynamic, Format.A8R8G8B8, Pool.Default);
    timer1.Stop();
    Button1Code();
    timer1.Start();
    The same i did with the trackBar1 scroll event.
    But the result in trackBar2 i'm getting without using the grayscale convertion is this:
    You can see that the color that make the scan now is more yellow or green/yellow and not the same like it is when i'm using the trackBar1.
    I can't figure out where the problem is:
    1. Maybe since the Bitmaps in the variable array bitmaps are all Format32bppArgb ?
    2. Maybe they are Bitmaps and not Gif types like the images in trackBar1 ?
    If it does working good with the gifs in trackBar1 scroll event then the whole code in the new form ScanningClouds is working fine so i will not add to here the whole ScanningClouds form code since it's long.
    The problem is somewhere with the Bitmaps formas or bits in the variable bitmaps.
    Maybe they are not the same or the right Bit Depth or maybe they are Bitmaps and should be Gifs.
    bitmaps = ImagesComparison.get_images_with_clouds(b1);
    This is the get_images_with_clouds method where i'm getting the new 15 Bitmaps.
    public static Bitmap[] get_images_with_clouds(Bitmap radar_image)
    int e = 0;
    int f = 0;
    int image_clock_area_x = 0;
    int image_clock_area_y = 0;
    int image_clock_area_x1 = 140;
    int image_clock_area_y1 = 21;
    Bitmap[] localImages;
    localImages = new Bitmap[15];
    Bitmap image;
    image = new Bitmap(Properties.Resources.radar_without_clouds);
    BitmapData bmD = null;
    BitmapData bmD2 = null;
    try
    bmD = image.LockBits(new Rectangle(0, 0, image.Width, image.Height), ImageLockMode.ReadWrite,
    PixelFormat.Format32bppArgb);
    bmD2 = radar_image.LockBits(new Rectangle(0, 0, radar_image.Width, radar_image.Height), ImageLockMode.ReadOnly,
    PixelFormat.Format32bppArgb);
    IntPtr sc0 = bmD.Scan0;
    unsafe
    int* p = (int*)sc0.ToPointer();
    int* p2 = (int*)bmD2.Scan0.ToPointer();
    for (e = image_clock_area_x; e < image_clock_area_x + image_clock_area_x1; e++)
    for (f = image_clock_area_y; f < image_clock_area_y + image_clock_area_y1; f++)
    Color clock_color = Color.FromArgb(p2[e + f * bmD2.Width]);
    p[e + f * bmD.Width] = clock_color.ToArgb();
    image.UnlockBits(bmD);
    radar_image.UnlockBits(bmD2);
    catch
    try
    image.UnlockBits(bmD);
    catch
    try
    radar_image.UnlockBits(bmD2);
    catch
    int c;
    for (c = 0; c < localImages.Length; c++)
    localImages[c] = new Bitmap(image);
    Bitmap new_image = new Bitmap(Properties.Resources.radar_without_clouds);
    Bitmap new_image1 = new Bitmap(Properties.Resources.radar_without_clouds);
    Bitmap localbmptest = black_and_white(new_image, radar_image);
    Image image1 = black_and_white(new_image, radar_image);
    image1.Save(@"c:\temp\testclouds666.jpg");
    Bitmap clouds = new Bitmap(image1);
    int x;
    int y;
    int a;
    int b;
    int d = 0;
    Bitmap redImage;
    redImage = new Bitmap(512, 512);
    using (Graphics g = Graphics.FromImage(redImage))
    g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor;
    g.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.Half;
    g.Clear(Color.Red);
    BitmapData bmData = null;
    BitmapData bmData2 = null;
    BitmapData bmDataArray = null;
    try
    bmData = clouds.LockBits(new Rectangle(0, 0, clouds.Width, clouds.Height), ImageLockMode.ReadOnly,
    PixelFormat.Format32bppArgb);
    bmData2 = radar_image.LockBits(new Rectangle(0, 0, radar_image.Width, radar_image.Height), ImageLockMode.ReadOnly,
    PixelFormat.Format32bppArgb);
    IntPtr scan0 = bmData.Scan0;
    IntPtr scan02 = bmData2.Scan0;
    unsafe
    int* p = (int*)scan0.ToPointer();
    int* p2 = (int*)scan02.ToPointer();
    double h, mm;
    for (d = 0; d < localImages.Length; d++)
    bmDataArray = localImages[d].LockBits(new Rectangle(0, 0, localImages[d].Width, localImages[d].Height), ImageLockMode.ReadWrite,
    PixelFormat.Format32bppArgb);
    IntPtr scan0Array = bmDataArray.Scan0;
    int* pArray = (int*)scan0Array.ToPointer();
    for (a = 0; a < new_image.Width; a++)
    for (b = 0; b < new_image.Height; b++)
    Color color1 = Color.FromArgb(p[a + b * bmData.Width]);
    Color color2 = Color.FromArgb(p2[a + b * bmData2.Width]);
    if (color1.R != 0 || color1.G != 0 || color1.B != 0)
    h = color2.GetHue();
    mm = RadarAnalysis.Hue2MMPerHour(h);
    if (mm >= treshhold_array[14 - d])
    pArray[a + b * bmDataArray.Width] = color2.ToArgb();
    localImages[d].UnlockBits(bmDataArray);
    clouds.UnlockBits(bmData);
    radar_image.UnlockBits(bmData2);
    catch (Exception error)
    try
    clouds.UnlockBits(bmData);
    catch
    try
    radar_image.UnlockBits(bmData2);
    catch
    try
    localImages[d].UnlockBits(bmDataArray);
    catch
    Logger.Write("Error Exception ==> " + error);
    MessageBox.Show("Error Exception ==> " + error);
    return localImages;
    I think not sure but i think the problem is that the images on my hard disk i'm using with the trackBar1 scroll event are Gif type and the images i'm using with the trackBar2 scroll event are 15 Bitmaps.

    Hi,
    "But it didn't work it's just turning them to black gray scale colors not what i was thinking about."
    If you want it to be colored, you'll need to create a color-palette for the 8bppIndexed bitmaps. The keyword for this process is "Color-Quantization".
    The whole yellow-green pie you get is from the wrong format. If you convert the 32bpp bitmaps to 24 bpp bitmaps, you loose the alpha channel ("transparency"). You can manually set one color to "transparent" with the mMakeTransparent-method
    of the Bitmap class, or simply use gif-images (they are 8bpp with a transparent "key"-color)
    Regards,
      Thorsten

  • Pass entire list of XY graph properties from Main vi to Subvi XY Graph

    Hello Everyone,
    I have an XY graph in my main vi that allows users to review data.  They have control over how they want to display the data on this graph(scale,color,line style, etc).  I have a subvi that excepts and array of XY graph plots (multi-plot) and prints the graph as the user has set it up.  As of right now I am passing only certain properties from the main XY graph to the subvi XY graph using property nodes.  Using this method only the important items are being passed (scale, flipped, xy scale name label) mainly because I have been to lazy to sit down and make a cluster containing all the property values.  I have to beleive that there is a way for me to pass a reference from the main XY graph to the subvi XY graph that will set all the properties in the Subvi graph to the same settings that the Main XY graph has.
    Thank you in advance,
    Steve

    Passing a reference to the subvi seems to be half of the solution that I am looking for.  This allows me full access to all propertys of the main graph.  The problem is that once I am inside the subvi I still have to select what properties I want to pass to the subvi graph. (see attached image).  My goal is to pass the reference to the subvi and then have every property of the main graph be assinged to every property of the subvi graph.  This way no matter what the user changes on the main graph (line style, width, color, scales, precision, etc) the subvi graph will reflect this.  With the method displayed in the image I have to manually select the properties that I think will most likely be edited.  And if I miss one the user will not get an exact match of the main graph.  I am hoping there is a way to do this, if not then I will just have to sit down and pass all the property values from the reference to the subvi graph but this seems like the hard way of doing it. 
    Attachments:
    Refnum.JPG ‏19 KB

  • Oversize A2 Paper Size value(stri​ng) for HP Designjet 500 Plus 24 (Paper Roll).

    Greetings.
    I am working at constructor’s bureau. Recently we decided to automate drawing printing from SolidWorks program (it’s a CAD software). I have written a code. SolidWorks API allows to choose for printing such settings as paper tray, scale, color, orientation and paper size. I am having an issue with the last option. Paper size gets set by passing value (string). Here are some of them: http://msdn.microsoft.com/en-us/library/windows/de​sktop/dd319099(v=vs.85).aspx. I can get the needed value by “Recording macro” and selecting the size I need in SolidWorks
    Such paper sizes as A4, ISO A4, Oversize A4 have different numbers. Same goes for A3, A2 and etc. In addition, the values are not universal. They can alter depending on printer.
    We have 5 printers for various paper sizes (from A0 to A4) and I set correct value for 4 of them, but I have a trouble with – “HP Designjet 500 Plus 24”. This printer can print both A1 and A2. I managed to make A1 printing work (I just pass value 621 that means “Overize A1”, without changing paper tray), as for A2 the value must be 620 that is "Oversize A2", but it does not work. Only part of the drawing gets printed and it gets placed somewhere in the middle. I guess it just prints according to printer default settings. Maybe the value is not 620? If it is so, can you tell me the real one?
    I can try to change default settings to match the A2 printing. However, the printer itself is a network printer. So changing some settings there might get someone in the office angry. So getting the right values is a perfect solution.
    I am slowly getting desperate, because all printers work perfectly, except for one. Which makes the code unusable. I can post the code, but it will not help much, because I only need to set one or two values correctly.
    One more thing, we are using roll of paper, so maybe I have to also set the paper tray, even if it is still the same as for A1?
    Thank you in advance.

    This forum is focused on consumer level products.  For the Designjet you may have better results posting in the HP Designjet forum here.  There are a number of very knowledgable Designjet folks there.
    Bob Headrick,  HP Expert
    I am not an employee of HP, I am a volunteer posting here on my own time.
    If your problem is solved please click the "Accept as Solution" button ------------V
    If my answer was helpful please click the "Thumbs Up" to say "Thank You"--V

Maybe you are looking for