RGBImage filter, how to use?

I found this piece of code on an old forum post.. supposively I can use it to filter an image in any color
I choose..
I just dont know how to use it.. Could someone whos more experienced with Image filtering, show me
how this code was intended to be used by another class? I have the image I just dont know how to apply this to it..
Thanks (sorry I'm new to filters).
THANKYOU!!
* Creates a RGBImageFilter  that change
* the image to the desired color.
class ColorFilter extends RGBImageFilter {
     * The hue to which the image should changed.
    private float hue;
     * Creates a new ColorFilter that change the
     * image to the Color c.
     * @param c the Color to which
     * the image should be changed
    public ColorFilter(Color c)
        float[] hsb = Color.RGBtoHSB(c.getRed(), c.getGreen(), c.getBlue(), null);
        hue = hsb[0];
        canFilterIndexColorModel = true;
    public int filterRGB(int x, int y, int rgb)
        float[] hsb = Color.RGBtoHSB((rgb >> 16) & 0xff, (rgb >> 8) & 0xff,
            rgb & 0xff, null);
//change the pixel to the new color
        hsb[0] = hue;
//add the transparency of the pixel and return it
        return(Color.HSBtoRGB(hsb[0], hsb[1],
            hsb[2]) & 0xffffff) | (rgb & 0xff000000);
}

Image src = getImage("doc:///demo/images/duke/T1.gif");
ColorFilter colorfilter = new ColorFilter(Color.color);//whatever color
Image img = createImage(new FilteredImageSource(src.getSource(),     colorfilter));
Is that what you mean?? I'll try it when I get a chance.. THANKS!!

Similar Messages

  • Quartz Filter  - How to use to lighten prinouts

    My new color laser printer is printing a little dark. I looked at color sync and the quartz filters. I have read the instruction and moved the sliders around but I see no difference in the printng.
    There is no other thing that I can change to make the print lighter.
    Does anyone know how to use the quartz filter in coor sync to lighten the picture?
    G-5 , 2.3   Mac OS X (10.4.9)  

    Image src = getImage("doc:///demo/images/duke/T1.gif");
    ColorFilter colorfilter = new ColorFilter(Color.color);//whatever color
    Image img = createImage(new FilteredImageSource(src.getSource(),     colorfilter));
    Is that what you mean?? I'll try it when I get a chance.. THANKS!!

  • How to use the prompted value in the filter expression

    Hi
    Is it possible to use the prompted value in the filter expression?
    My requirement is that user will be prompted for a date field and I need to filter the records such that the records are displayed for the last 5 weeks from the date entered by the user.
    If somehow I know how to use the prompted value in the filter expression then this requirement is easy to be done. If this is possible, please guide me?
    If there are other ways to acheive the desired results then please suggest.
    Thanks
    -Jaz

    Edit: example added
    SQL> create table tb_test
      2  ( id number(5)
      3  , tot number(5)
      4  , mon_tot number generated always as (tot*15) virtual
      5  );
    Table created.
    SQL> insert into tb_test (id, tot) values (1, 5);
    1 row created.
    SQL> select * from tb_test;
            ID        TOT    MON_TOT
             1          5         75
    1 row selected.
    SQL> update tb_test
      2  set    tot = 15
      3  where  id = 1;
    1 row updated.
    SQL> select * from tb_test;
            ID        TOT    MON_TOT
             1         15        225
    1 row selected.

  • Windows NDIS filter - how to check if port is used by operating system

    Hi,
    I am writing a windows NDIS filter driver (for versions 6.0,6.2.6.3) and would like to be able to query from inside the kernel about the status of a tcp port (is it in use?).
    The function: FilterReceiveNetBufferLists is called when I receive a packet. Afterwards the tcp header of the packet is  extracted. I want to check if the destination port which I've extracted from the header is being used on the local machine. 
    Can I use WSK Network API, WFP or some other API to check if a port is being used by the operating system? and if so how do I do it?
    Thanks in advance!

    This won't be easy, but you can get the address table by sending IOCTL_TCP_QUERY_INFORMATION_EX to \Device\TCP as documented
    here. You'll need to spend some time looking at TCPIOCTL.H in the SDK, too. If you search the Internet for IOCTL_TCP_QUERY_INFORMATION_EX, you'll find some hints on how to use it.
     -Brian
    Azius Developer Training www.azius.com Windows device driver, internals, security, & forensics training and consulting. Blog at www.azius.com/blog

  • Sharepoint 2013 :Content Search Web part Property Filter By Query String - How to use ?

    Hi,
    I would like to filter data that is displayed in content search web part  by using  URL.
    I tried to use Value of a parameter from a URL - Query String.Parameter1
    But have no idea how to use it.
    Can someone help me pleas ?

    duplicate thread
    http://social.msdn.microsoft.com/Forums/en-US/f9fef155-1aa3-43b5-b285-5eae5d036b8d/content-search-webpart-property-filter-by-query-string-how-to-use-?forum=sharepointgeneral
    My Blog- http://www.sharepoint-journey.com|
    If a post answers your question, please click Mark As Answer on that post and Vote as Helpful

  • Where to locate and how to use the filter thershould to binarized image

    Good morning friends. I am using
    Labview with VDM and let me know where to locate and how to use the
    filter thershould. Also that parameters used to binarized image captured
    via webcam and display it in black and white.
    Thank you very
    much.

    Is the image that you are getting a RGB one? Use color plane extraction and then use a binary threshold to convert it into a binary image. You can also directly use a color threshold and convert a rgb (color) image to a binary image.

  • How to use combobox to filter datagrid in Flash Builder 4?

    Hi,
    I've been working through the TestDrive application with Flash Builder 4 and I would like to learn how to filter a datagrid using a combobox.  I've googled the subject and results for many different versions of Flash, some which look like they will take a considerable amount of time to implement.  I'm hoping with Flash Builder 4 there is a straight-forward way to do this without writing pages of code.
    I think I may be close to getting this working by passing the combobox value into a PHP script which queries the database with a WHERE clause.
    Thakns,
    David

    I was able to get the data returned from a PHP call into an array by placing the following in the service result handler:
       public var myEmployeesArray : Array;
       [Bindable]
       public var myEmployeesDataProvider : ArrayCollection;
        myEmployeesArray = mx.utils.ArrayUtil.toArray(event.result);
        myEmployeesDataProvider = myEmployeesArray[0];   //data provider for the datagrid
    Not certain how to use filterfunction yet though.  I started to read this page but need to work on it more: http://cookbooks.adobe.com/post_Using_the_to_ArrayCollection_s_filterFunction-5441.html
    I'd like to filter only one field in the ArrayCollection.
    Also, for anyone else who may be learning while reading this, I found the following page helpful in figuring out how to load the PHP service return data into an array:
    http://www.cflex.net/showFileDetails.cfm?ObjectID=415
    David

  • How to use Hierarchy Filter Selection?

    Hi, experts !
    Could anyone give me a detail for how to use hierarchy filter selection ?
    When i locate a Hier filter selection in the template and execute it, a false info
    accured while filtering data,and the IE inferred the hier node object was missing.
    Then i add another hier filter in the same template, and the secend runs well, however the first one didn't.
    At last, i hide the first one, but the second one can't either.
    Help me !!!
    Thx in advance!

    Thanks Toja !
    Sorry to reply so late !
    The error is line: 51. error:'document.HIERARCHY_MENU_1.NODEID' is null or is not the object.
    The code on line of 51 says:document.HIERARCHY_MENU_1.NODEID.value = i_node;
    Could you please give me some documents on the topic of Hierarchy Filter Selection ?

  • How to use event structure of event data nodes event filter nodes in programming

    hi,
    I need manual of how to use 'event structure' events of 'event data nodes' and 'event data filters'...please help me....
    Regards
    Ravindranath

    I'm not really sure what you are looking for here.  Did you do a search in the LabVIEW help for Event Structure?
    The Event Data Node just returns information about the event, like control data, control reference, what caused the event, etc.
    The Event Data Filters are just used in Filter Events.  This allows you to discard an event or change the data that the event will recieve.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How to use rowid in filter for datawindow?

    I try to use filter to filter data in datawindow, like
    dw_1.SetFilter("column = value")
    dw_1.Filter()
    then I can get data from this datawindow like:
    GetItemNumber(row, column_name)
    GetItemString(row, column_name)
    but I want to filter expression like
    "column = value and rownumber>10"
    How to use datawindow row number for filter?

    What about GetRowIdFromRow and GetRowFromRowId methods for DataWindow control ?
    AUS Julián Tagarro
    NeoSistemas SRL

  • How to Use and Filter Table contents after execution of Bapi

    Can anybody guide me how to Use and Filter the table Contents which i got after successful execution of a Bapi
    I used Component Controller in my Project
    Ex: My table contains Redundant data for a single column but i want to display the column contents with out Redundancy
    Name
    Raghu
    Raghu
    Raghu
    Debasish
    Debasish
    I want to filter the table contents and i want to display the table with out Redundancy
    and Even when i am using a Dropdown i selected a Column  from a Table as the values for that Dropdown  but that table is having redundant data and the same data is getting displayed in that Dropdown i want the Dropdown to display data with out redundancy
    Thanks

    I also got that problem recently and after debuging for a while I figured out, that it was resulting from an error in my table's model: When the model received new items to display I
    1.) Fired an delete event for the old items
    2.) Fired an insert event for the new items
    Problem was that when firing the delete event I didn't already assigned the new items to the model. Therefore it had still the old row count.
    Maybe you have also a faulty table model?...

  • I downloaded Adobe filter but I don't know how to use it

    I requested information about a web blocker and was led to Adobe Filter. I downloaded it but it gave no directions on how to use it for my kids. Where do I learn to use it? I use operating system Windows XP. I downloaded adobefilter.com

    Doesnt look like an actual adobe product, uninstall that program.
    See: http://www.mywot.com/en/scorecard/adobefilter.com?utm_source=addon&utm_content=contextmenu
    A real good web filter is OpenDNS's Parental Controls.
    * http://www.opendns.com/parental-controls
    There is also NetNanny.
    * www.netnanny.com/‎

  • How to use isotope to filter web apps?

    Hi,
    I just want to ask on how to use isotopes jquery plugin to filter the web app entries by categories?
    Thanks.
    Hernan

    Hi sb00349044,
    I am locking this question since it's a duplicate from your other post:
    * [https://support.mozilla.org/en-US/questions/1025653]
    Development related questions are not in the scope of the SUMO forums. Although it's possible that some contributors may be knowledgeable about developing for Firefox OS, and may offer some suggestions, these forums are aimed at assisting users with assisting end-users of Firefox OS.
    As I mentioned in your other post, por developer-related questions, you may have better luck finding help through MDN (Mozilla Developer Network) and StackOverflow. You can find these links below:
    * [https://developer.mozilla.org/en-US/ Mozilla Developer Network]
    * [https://developer.mozilla.org/en-US/docs/Web/API/Web_Bluetooth_API WebBluetooth API on MDN]
    * [http://stackoverflow.com/questions/tagged/firefox-os Firefox OS on StackOverflow]
    You may also send your question to one of Mozilla's Mailing Lists that are related to this topic. Please find the mailing lists on the link below:
    * [https://lists.mozilla.org/listinfo]
    Thanks,
    - Ralph

  • Content Search Webpart Property Filter By Query String - How to use ?

    Hi,
    I would like to filter data that is displayed in content search web part  by using  URL.
    I tried to use Value of a parameter from a URL - Query String.Parameter1
    But have no idea how to use it.
    Can someone help me pleas ?

    Hi,
    I am looking for solution to filter data on content search web part ( SP 2013)  by using  URL.
    For example:
    My URL is: http://SiteCollName/Sitename/Pages/PageName.aspx?MyParameter1=XXXX
    Result : Display results that field "My field" contains XXXX.
    nikita

  • How to use filter for data tables? Important topic but no docs/examples.

    I was looking at the TableRowGroup APIs:
    http://developers.sun.com/prodtech/javatools/jscreator/reference/docs/apis/webui/index.html
    and looks like it has getTableDataFilter and setTableDataFilter methods. Sounds to me, that we can use TableDataFilter to filter rows that are displayed. For example, we can provide users with a drop down list of fields to choose from, and input field to enter the value of the selected field, so that they can narrow down the rows to search for specifics row(s) they are looking for.
    I have not seen any example, or enough documentation, to figure out how to use this filter. Since JSC is new, there are not too many resources out there or on web for such specific issues. Any gurus out there?
    Thanks

    Creator Team: Data filtering tutorial is over due now. This is something that will be useful to most developers. We all want to display users some data and want to provide user ability to filter it down based on some criteria, i.e. display rows within a date range, display all rows that have certain value or a field, etc. If there is a built-in filter in TableRowGroup, why not document it adequately along with some examples and a tutorial?
    This is one of the key elements of Microsoft/VS.NET market share -- provide tons of example/tutorials/advanced code/books/3rd party books, etc. Why can't other companies follow a well-proven success element? In spite of making a better product, the can end up loosing or not gaining enough share, because of this lack of attention.

Maybe you are looking for