How to select a sub image in run time

Hi ,
how can i select sub image from an image on panel in run time ?
OR
how to draw a rectangle(with dashed lines) on the panel and from its dimension i'll get the sub image ?
THANKS

BufferedImage.getSubImage(....);

Similar Messages

  • How to create transparent image at run-time?

    How to create transparent image at run-time? I mean I want to create a (new) transparent image1, then show other (loaded) transparent image2 to image1, then show image1 to a DC. The problem is - image1 has non-transparent background...

    i'm not sure, but you can set the alpha value to 0 in all pixels which are 'in' the background..
    greetz
    chris

  • Create LinkToAction with Image by run time

    Hi,
    I want to create linkToAction UI's with different images by run time. But if I try the code below I get always the same image for every linkToAction UI. What is my mistake? And how can I solve this problem?
         for (int i = 0; i < wdContext.nodeGlob_Struc().size(); i++){
              IWDLinkToAction linkToAction = (IWDLinkToAction)
                   view.createElement(IWDLinkToAction.class, "linkToAction"+i);
              IPrivateDocPreAppView.ILinkToActionElement nodeLink =
                      wdContext.createLinkToActionElement();                    
              wdContext.nodeLinkToAction().bind(nodeLink);     
              wdContext.currentLinkToActionElement().setImageSource(
                      wdContext.nodeGlob_Struc().getGlob_StrucElementAt(i).
                           getUrl_Thumbnail() );
              linkToAction.bindImageSource( wdContext.nodeGlob_Struc().
                       getNodeInfo().getAttribute(IGlob_StrucElement.URL__THUMBNAIL) );     
                theGroupBox.addChild(linkToAction);
    regards,
    Sharam

    Hallo Sharam,
    The Web Dynro binding model does not support "index binding". This means binding multiple image UI elments to the same attribute in a multiple context node (cardinaltiy 1..n) means, that all images are bound to the node's lead selection. That's what you implement with
    linkToAction.bindImageSource( wdContext.nodeGlob_Struc(). getNodeInfo().getAttribute(IGlob_StrucElement.URL__THUMBNAIL) );
    Armin's solution is based on the fact, that he breaks the data binding principle by directly setting the imageSource property values.
    Sharam, when reviewing your code I find several "problems":
    1. Never ever store UI elements in the context. I assume you do this in order to access UI elements outside wdDoModifyView() as it is static. There is no need to do this.
    2. Then you break databinding by setting the imageSource property in the linkToAction object (stored in the context) directly, breaking databinding.
    3.)  Finally you "un-do" this hard property setting by binding it to the context again. This has the effect you described.
    Breaking the data binding principle for UI elements has an important drawback. It also breaks the generic Web Dynpro caching mechanisms. Read my article on
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/301d715e-0b01-0010-1a8b-f1f83d175972">Best Practices for Building Client-Independent Web Dynpro UIs</a>, section Coding Rules, rule <i>Implement Fine-Grain UI Manipulations on Context but Not on UI Element Level</i>:
    To maximize the rendering performance of your Web Dynpro application, implement all fine-grain UI manipulations on context instead of UI element level. This means do not call the setter-methods of UI element objects inside wdDoModifyView()directly but bind the related properties to the context and call the corresponding setter methods outside wdDoModifyView():
    <b>Not:</b> wdDoModifyView(){ … theField.setEnabled(true) … }
    <b>But:</b> wdDoInit(){ … wdContext.currentFieldNode.setEnabled(true) … }.
    Otherwise Web Dynpro’s caching mechanisms cannot speed up the rendering of view layouts.
    The view controller’s wdDoModifyView() method is designed for a special purpose: the creation of a UI tree or UI sub-tree at runtime in case it is not possible to declare the UI at design time. The method is neither intended for fine-grain UI manipulations nor for context manipulations. Fine-grain UI manipulations are achieved via means of data binding. Context manipulations are done in wdDoInit(), action event handlers or event handlers.
    Unfortunately, the name wdDoModifyView() is somewhat misleading since the purpose of it is to create (and not to modify) a UI tree dynamically. While the usage of wdDoModifyView() in order to create a UI tree initially (firstTime == true) is not performance critical, modifying an existing UI tree (firstTime == false) is: Changing only one single attribute of a single UI element within wdDoModifyView() flags the complete view containing the control as dirty and the complete view must be completely re-rendered again – depending on the size and complexity of the view this can result in significant performance hits.
    But in your case databinding cannot be applied, as index binding is not supported. The only databinding solution must use multiple/n nodes of cardinatliy 1..1 instead of 1 node of cardinality 1..n with no node elements. And this would require further coding for dynamic context node creation, copy logic based on value semantic.
    Best Regards, Bertram

  • Can you set an image at run time?  Does it really work?

    I have read that others have been able to set an image at run time, but I cannot seem to get it to work (the image I set does not load).
    What I do is have a page, call it page2, that has two image components on it. In the constructor for page2 I do this:
    // Additional user provided initialization code
    image1.setValue("bike1.JPG");
    image2.setValue("bike2.JPG");
    The jpg files are in the build directory:
    C:\Documents and Settings\Darrin\My Documents\Creator\Projects\ImageTest\build\images
    The odd thing is that for the first image component(image1), I set a default jpg file (nogo.JPG that is in the same directory as the other two), and that does load.
    In fact, when I I check the value of image1 in afterRenderResponse by calling image1.getValue() it still has the default image (nogo.JPG) instead of the one I set it to (bike1.JPG) in the constructor by calling image1.setValue("bike1.JPG");
    So, either the image1.setValue() has no effect, or something is overwriting it.
    What is the trick to getting an image to load at run time like this?
    THANKS!

    Well after several more hours of banging myh ead against the wall, I still cannot get this to work.<br><br>
    I read in the constructor comments that whatever is in the jsp file will override the backing bean's constructor, so that might be part of the problem, but others I thought got this to work using a similar method.<br><br>
    Here is what I tried last which still does not work, but mimics what others have said did work for them:<br><br>
    //See if the default jpg file can even be copied over
    <br> image3.setHeight(image1.getHeight());
    <br> image3.setUrl(image1.getUrl());
    <br> image3.setValue(image1.getValue());
    <br>
    <br> Integer aiw = new Integer("1");
    <br> float aar = 0;
    <br> float ar = 0;
    <br>
    <br> ImageIcon ii = new ImageIcon("C:/Documents and Settings/Darrin/My Documents/Creator/Projects/ImageTest/build/images/bike1.JPG");
    <br> ar = (float)ii.getIconHeight()/(float)ii.getIconWidth();
    <br> aiw = new Integer(ii.getIconHeight());
    <br> aar = ar*aiw.intValue();
    <br> image1.setHeight(""+(int)aar);
    <br> image1.setUrl("images/bike1.JPG");
    <br> image2.setValue("C:/Documents and Settings/Darrin/My Documents/Creator/Projects/ImageTest/build/images\\bike2.JPG");
    <br> image2.setUrl("C:/Documents and Settings/Darrin/My Documents/Creator/Projects/ImageTest/build/images\\bike2.JPG");
    <br><br>Note that when I run this and look at the log that I write out to in afterRenderRepsponse, it shows that image1 (which shows up as the default image I set at design time) and image3 (which does not show up which I set at run time using image1's value) both show the nogo.JPG image from the <b>resource</b> directory while image2 (that I set at run time to be bike2.JPG) is showing up as <b>empty</b>
    <br><br>
    This is really getting frustrating, and I would greatly appreciate a small tutorial from the JSC staff on just how you need to go about doing this. given that this is so common a need, a tutorial is warranted. Heck, just clue me in on how it is done and I will write one!
    <br><br>
    THANKS!

  • How to Hide the Parameter field at run time....

    Hi,
    I have a parameter field which behaves differently depending on the User logged in.
    It has the LOV coming from following SQL.
    SELECT customer_name FROM Cust_mast;
    If the user = 'INTERNAL' then the Where clause will be
    WHERE cust_id in('DELL', 'SBC', 'BANK')
    Else there will be no WHERE clause or the parameter field
    should be hidden in the parameter form.
    So my questions are:
    1) How to hide the Parameter field during Run time?
    OR OR OR
    2) How to change the LOV select statement during Run time?
    Thanks.
    Ram.

    Hi Ram,
    Is there any way to play with the sql query SELECT using DECODE ?I'm not sure of this part, maybe someone else can suggest a way.
    However, what you want can be done in 2 other ways:
    1. Build 2 reports. Both reports will just be duplicates of each other, only difference being that the 'LoV where clause' will be different. Now you can fire the appropriate report in many ways. For example, if the customer is alreay logged inside your custom application, and therefore you already know whether the user is internal of external, you can design your button or link which launches the report to contain logic such that one of the 2 reports is fired depending on who the user is.
    1. Use a JSP parameter form, not a paper parameter form In this case, just build an HTML parameter form in the web source of your report. Use Java logic to populate the LoV drop-down list. When you have to launch the final report, just launch the paper-layout of the report. For example (you will have to modify this):
    <form action="http://machine:port/reports/rwservlet?report=ParamForm.jsp+..." name="First" method="post">
    <select name="selected_customer" onChange="First.submit()" >
    <option value="">Choose a Customer Name
    <rw:foreach id="G_cust_id" src="G_cust_id">
         <rw:getValue id="myCustId" src="CUSTOMER_ID"/>
    <rw:getValue id="myCustName" src="CUSTOMER_NAME"/>
    <option value="<%=myCustId%>"><%=myCustName%>
    </rw:foreach>
    </select>
    </form>
    In the code above, you will have to make sure that your report's data model defines 2 CUSTOMER_ID's (like CUSTOMER_ID_INT and CUSTOMER_ID_EXT). These 2 will be internal and external Cust ID's. Use Java logic to show one of them.
    Navneet.

  • How can i set print mode at run time in smartforms???

    Hi expert,
    In smartforms how can I  set print mode at run time.
    I have one screen.In this screen one check box is there.If user select that check box then print should be come double side otherwise it is coming single side.
    If it is possible then plz give me answer asap.

    Hi,
    Set These settings
    While calling smartform, paas control_parameters and output_options as mentioned below and set
    user_settings = ' '.
    It will send the smartform output to spool.
    DATA: wa_output_options TYPE ssfcompop,
    wa_ctrl TYPE ssfctrlop.
    wa_output_options-tdimmed = 'X'.
    wa_output_options-tddelete = 'X'.
    wa_output_options-tdimmed = ' '.
    wa_output_options-tddest = 'LOCL'.
    wa_ctrl-no_dialog = 'X'.
    CALL FUNCTION lv_fm_name
    EXPORTING
    ARCHIVE_INDEX =
    ARCHIVE_INDEX_TAB =
    ARCHIVE_PARAMETERS =
    control_parameters = wa_ctrl
    MAIL_APPL_OBJ =
    MAIL_RECIPIENT =
    MAIL_SENDER =
    output_options = wa_output_options
    user_settings = ' '
    x_adrp = x_adrp
    IMPORTING
    DOCUMENT_OUTPUT_INFO =
    JOB_OUTPUT_INFO =
    JOB_OUTPUT_OPTIONS =
    EXCEPTIONS
    FORMATTING_ERROR = 1
    INTERNAL_ERROR = 2
    SEND_ERROR = 3
    USER_CANCELED = 4
    OTHERS = 5
    IF sy-subrc 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Regards,
    Kumar(Reward if helpful).

  • [CS4 Mac] Change PictureWidget image at running time.

    Hello,
    I have a PictureWidget on a panel - by default it displays a PNG file loaded from resources.
    It can also display error icons when a query fails - etc: these icons are loaded from plugin's 'PICT' resources.
    So far so good.
    Now - when a query doesn't fail it would need to display an image stored as a 'PICT' file on a server: the query result is telling me which 'PICT' file is to be displayed in the PictureWidget.
    For QXP I was using DrawPicture() to draw the PicHandle directly in the item rectangle.
    Switching it to InDesign - I am looking for a recipe to achieve same result but following InDesign SDK means and spirit.
    In other words - how do we change a PictureWidget image at running time in order to display a PICT files from server instead of built-in default PNG or 'PICT' resources.
    Any pointer or direction to achieve this would be very much appreciated indeed.
    Best regards
    Patrick Perroud

    Hi,
    I have to add a image on a dialog, I am able to add a image on Windows by associating a image resource ID with image path in .rc file. But not able to do the same on mac. How can we associate image resource ID with image path on MAC?
    Thanks in advance.

  • How do I substract an image at the time t with an image at t-1 to detect move in a grab acquisition

    After the VI acquire in a grab acquisition, how do I substract an image at the time t with an image at t-1 to detect the movement in the scene?

    Hello,
    One way of doing that is to do a ring acquisition with two buffers. At anytime one of your buffers will be the most current frame and the other will be one before the most current. Having both buffers available at anytime in your code you can call IMAQ Subtract.
    Hope this helps!
    Yusuf C.
    Applications Engineering
    National Instruments

  • How to select the all object at a time while installing business content

    Hi All,
    how to select the all object at a time while installing business content Please let me know if nay document is there
    Thanks Ahmed Pasha

    Hi,
    Please check out the below links
    [Business content Installation|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/102906a4-f13d-2e10-7199-ce316ff254b8?QuickLink=index&overridelayout=true ]
    [BI Content|http://wiki.sdn.sap.com/wiki/display/BI/InstallingBusinessContent]
    Hope it helps.
    Regards,
    AL

  • How to call the Application configuration in run time.

    hi guru,
    i have created two  Application configuraton   and it working fine.
    my question how to call the application configuration in run time.
    Example :
    Based on the user i want to change the Application Configuration.like Super user and Normal user.
    Advance thank's
    Regard's
    Vivekanathan.S

    Hi,
    Please try out this way-
    Have a look at this table -
    WDY_CONF_APPLU - (Customizing Data for Web Dynpro Applications).
    after you are done with the configuration--
    Ge the config id for the given application from this table. And depending on the user get an entry from this table and display accordingly.
    Please refer to these links -
    different default layouts for different CONFIG_IDs
    Get WDCONFIGURATIONID
    Regards
    Lekha

  • How to hide the Parameter field during Run time?

    Hi,
    How to hide the Parameter field during Run time?
    I have a parameter field which behaves differently depending on the User logged in.
    I am using reports 10G
    For ex: I have 3 field created in JSP
    CUSTOMER
    PROVIDER
    FROM DATE
    END DATE
    If the user = 'SUPER show all the parameter
    CUSTOMER
    PROVIDER
    FROM DATE
    END DATE
    If the user is 'GATEKEEPER" Just show
    PROVIDER
    FROM DATE
    END DATE
    Can I do that?
    Please help
    Thanks.
    KK

    hi, i'm not familiar much with JSP. but i think workaround is to create two window one which have 4 fields and the other which have 3. if user is SUPER then call the first screen otherwise if user is GATEKEEPER then call the second screen.

  • Dynamic Images at run-time

    I have a report that I would like to display a different
    image/logo depending on the user who is generating the report. Is
    there a method to display a different image at run-time? Or, does
    anyone have a better way rather than cloning 10 versions of the
    report will a different image on each?
    Thanks for any help in advance,
    Kevin

    Here is a sample that shows changing an image at runtime. If you are using a different version of Crystal Reports than XI R2, let me know.
    https://boc.sdn.sap.com/node/6174
    Cheers,
    Jonathan

  • Select serial comm port in sub vi during run-time

    Hi, would like to be able to select the comm port (serial RS232) in sub vi to use in main vi during run time. How can I do this? Have tried and failed, for on startup an error occurs because I have not selected a port yet. An example would be invaluable! Thanks alot, Madri

    Hi Madri !
    What you could do is to intercept the com errors, and open a configuration vi either if there is an init error or if the user has pressed a "Change port" boollean (or menu...). Do not forget to close the previously opened serial port, and to open/init the new one. I have attached a small example of this idea.
    Of course com errors can have various origins, and do not require always to change the serial port. So, you have some additional work to do.
    Hope this helps
    CC
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        
    Attachments:
    Select_port.vi.zip ‏12 KB
    Com_with_serial_init_vi.vi.zip ‏13 KB

  • How to find which sub-vi is running in highlight execution mode?

    Hi there,
    It sometimes happens that while debugging you program you open a lot of sub-vis put probes in many places turn on highlight execution in dirrerent sub-vis and then forget to turn it off.
    You close all sub-vis and run software and it runs SLOOOOW. Then you need to go and find that sub-vi that runs in highlight execution mode.
    I was just wondering if there is an easy/automatic way find which vi has highlight execution mode turned on?
    Solved!
    Go to Solution.

    Here is a small utility to switch off Execution Highlight mode off all opened subvis. Drop it into the Project subfolder in the LabVIEW application folder, then restart LabVIEW. A new item "Stop Highlight mode..." will appear in the Tools menu. Enjoy !
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        
    Attachments:
    Stop Highlight Execution.vi ‏16 KB

  • How to prevent prompt to install CVI Run-Time Engine?

    The LabVIEW laptop for my client got messed up, so I spent several hours making it forget everything it ever knew about NI software.  I started by uninstalling all NI applications, then manually deleted all the folders that the uninstaller leaves behind, then ran a couple of registry cleaners to sweep out as much NI as possible, and finally ran regedit to see what was left.  In the end there were only some legacy drivers that regedit would not let me delete.
    Then I installed 8.6.1 from DVD, carefully selecting only the options we needed; LabVIEW core, cRIO, FPGA, PID, and the minimum set of drivers the installer would let me get away with.  Note that no Labwindows/CVI option boxes were checked.  When the installation was complete, I rebooted the machine and launched LabVIEW, which immediately prompted me to install the LabWindows/CVI 8.5.1 (not 8.6.1) Run-Time Engine.  I dutifully fed it my 8.6.1 DVD, which caused LabVIEW to crash.  After 3 reboot/retry cycles with the same result, I decided to appeal to the forum for help.
    What is causing LabVIEW to think I need the CVI Run-Time Engine (and a down-rev version, at that), and how do I convince LabVIEW that I do not?
    Jeff

    Thanks for the reply!  OK, so LabVIEW needs the CVI RTE even though I'm not using any CVI features.  I can live with that.  I downloaded LabWindows/CVI Run-Time Engine 8.5 from the NI web site and tried to install it.  After I confirmed that I accepted whatever that license agreement says, the installer told me that "No software will be installed or removed."
    Then I opened LabVIEW, and it went through the same "The feature you are trying to use..." popup and tried to install the CVI RTE.  The installation failed as usual, and LabVIEW crashed.
    A few minutes ago I found and ran CVTRTE.msi on the 8.6.1 distribution DVD.  I selected the "repair" option, which completed successfully.  After rebooting, I launched LabVIEW only to be greeted with the now-hated NI LabWindows/CVI 8.5.1 Run-Time Engine installer.
    The part of this that is so infuriating is that there appears to be no way for anyone to make a computer forget everything NI so you can start with a clean slate.
    Jeff
    Attachments:
    NoCanDo.jpg ‏28 KB

Maybe you are looking for

  • Trouble Copying and pasting a movie clip from another flash scene

    Hello, I have been trying to copy a movie clip from the library of one flash and paste it into the library of another.  But when I do this, it always gives me, "One or more library items already exist in the document. I have tried finding and renamin

  • Collection of Assets in Flash

    Is there any way to collect all external assets (images, videos, etc) and put them in one selected folder? Something like After Effects does with it's footage.

  • Easily identify Exchange Invites?

    I have switched over to using Mail in Snow Leopard with my companies Exchange 2007 server from Entourage. Overall I am MUCH happier, but there are a few things I am still trying to work out. One of them is how to easily identify meeting invites. When

  • C 3-01, heated while charging

    I bought Nokia C3-01 few days ago. It is good combination touch and type. But I am facing problem that when I plugin charger, it start heating.  Please, Nokia, keep in note this problem for next software update. Nokia C3-01 S/W V5.65 RM-640 MEA-7

  • TCP/IP issues with OS v. 4.6

    Greetings, all. Just got my 8900 last night, and so far I'm very impressed indeed. Most of the applications that I've needed have been immediately and easily available, the handset itself is intuitive and easy to use - a great n00b experience all 'ro