How to retain the picture drawn by my mouse?

i have a label which i would use my mouse to draw on it.. however the screen would refresh after 1 minute or when i move the window, the image that i have drawn would also disappear.
how can i retain my picture so that it would always stays there?
are there anything to do with mouse events?
thank you!

You need to keep track of the shapes you draw then override the paint method and draw them.

Similar Messages

  • How to print the picture in PDF ?

    I developed a plug-in(Annot) that dynamically display a picture according some condition in PDF,but the picture cannot be printed. How to print the picture ?

    In the print dialog, make sure that Print: Comments (which means
    annotations) is on.
    Aandi Inston

  • How to retain the same resolution while croping a tiff image using jai api

    Hi all,
    I have designed a program to crop a tiff image.But after croping the tiff,the resultant file resolution is not the same as the original source file.
    In the program,the source file Nadeshiko_v1_02.tif has the resolution(X) of 1200 DPI and resolution(Y) has 1200 DPI pixels.
    But after croping the resolution of output file is 100 DPI.
    Please give me some idea on how to retain the same resolution.
    <code>
    package jai;
    import java.awt.Frame;
    import java.awt.image.RenderedImage;
    import java.awt.image.renderable.ParameterBlock;
    import java.awt.image.renderable.RenderableImage;
    import java.io.FileNotFoundException;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import javax.imageio.*;
    import javax.imageio.stream.ImageOutputStream;
    import javax.media.jai.Interpolation;
    import javax.media.*;
    import javax.media.jai.JAI;
    import javax.media.jai.PlanarImage;
    import javax.media.jai.RenderedOp;
    import javax.media.jai.widget.ScrollingImagePanel;
    import com.sun.media.jai.codec.FileSeekableStream;
    import com.sun.media.jai.codec.SeekableStream;
    import com.sun.media.jai.codec.TIFFEncodeParam;
    import javax.media.jai.OperationDescriptorImpl;
    import java.io.*;
    import java.util.Iterator;
    import javax.media.jai.operator.*;
    // import javax.media.jai.widget.ScrollingImagePanel;
    public class crop {
              /** The main method. */
    public static void main(String[] args) {
    /* Validate input. */
    /* if (args.length != 1) {
    System.out.println("Usage: java JAISampleProgram " +
    "input_image_filename");
    // System.exit(-1);
    float a=(float) 70.3;
    float b=(float) 70.4;
    float c=(float) 3100.3;
    float d=(float) 5522.4;
    * Create an input stream from the specified file name
    * to be used with the file decoding operator.
    String TIFF="TIFF";
    FileSeekableStream stream = null;
    try {
         stream = new FileSeekableStream("D:\\tif images\\Nadeshiko_v1_02.tif");
    // stream = new FileSeekableStream("D:\\tif images\\Nadeshiko_v1_01.jpg");
    } catch (IOException e) {
    e.printStackTrace();
    System.exit(0);
    // Load the source image from a Stream.
    RenderedImage im = JAI.create("stream", stream);
    RenderedImage image2= CropDescriptor.create(im, a, b, c, d, null);
    ScrollingImagePanel panel = new ScrollingImagePanel(image2, 100, 100);
    // Create a frame to contain the panel.
    Frame window = new Frame("JAI Image Cropping");
    window.add(panel);
    window.pack();
    // window.show();
    // Define the source and destination file names.
    // String inputFile = "D:\\tif images\\Nadeshiko_v1_05.tif";
    String outputFile = "D:\\tif images\\Nadeshiko_v1_04.tif";
    // Save the image on a file. We cannot just store it, we must set the image encoding parameters
    // to ensure that it will be stored as a tiled image.
    TIFFEncodeParam tep = new TIFFEncodeParam();
    tep.setWriteTiled(true);
    tep.setTileSize(80,80);
    JAI.create("filestore",image2,outputFile,"TIFF",null);
    try {
                   stream.close();
              } catch (IOException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
    </code>
    Thanks,
    Sanat Meher

    Try the following,
    TIFFEncodeParam tep = new TIFFEncodeParam();
    // Create {X,Y}Resolution fields.
    TIFFField fieldXRes = new TIFFField(0x11A, TIFFField.TIFF_RATIONAL,
                                        1, new long[][] {{DPI_X, 1}});
    TIFFField fieldYRes = new TIFFField(0x11B, TIFFField.TIFF_RATIONAL,
                                        1, new long[][] {{DPI_Y, 1}});
    tep.setExtraFields(new TIFFField[] {fieldXRes, fieldYRes});

  • How to change the picture frame size in Lightroom 5 Book

    I would like to control the actual picture frame size when making a Book in Lightroom 5. Or else know the sizes of the different picture frames provided by choosing the different page layouts. That way I can either change the picture frame dimensions to accomodate each photo or change the image size to fit in the offered picture frame. I find that using the software as is winds up cropping the images in unwanted ways. Modifying the picture frame would be my preferred alternative. Appreciate any ideas

    Hi again Tony,
                I have been using Adobe Photoshop 7, Photoshop Elements, Perfect Photo Suite, Photo Studio, etc., changing Image size, placing a picture on a page and then, do a simple last minute size adjustment by using the arrows to stretch or shrink it in place. Things would be a lot simpler if I could do the same thing with the cells in Lightroom 5. Cell pad adjustments do not fill the bill.
    I think we’ve pretty much concluded this exchange. Thanks again for your effort.
        david
    ay [email protected]
    Sent: Wednesday, March 12, 2014 11:27 PM
    To: dgbrow
    Subject: How to change the picture frame size in Lightroom 5 Book
    Re: How to change the picture frame size in Lightroom 5 Book
    created by Tony Jay <http://forums.adobe.com/people/Tony+Jay>  in Photoshop Lightroom - View the full discussion <http://forums.adobe.com/message/6205206#6205206

  • How to retain the work item in inbox of user if user press the icon cancel?

    HI,
    we  are using a text editor in approval section of workflow where the user needs to enter the reason for apporval or rejection.
    the requirement is how to retain the work item in inbox of user if user press the icon cancel? there are two icons in editor,one is ok(tick marg) and cancel(cross mark).
    so when user dont enter any text in the editor and press on cancel icon,then approval/rejection should not authorize and work item will remain in the user's inbox .unless and untill he enters the text.
    i have tried   LEAVE TO TRANSACTION 'SBWP'.leave program etc but nothing is working.
    please guide me.
    thanks
    prsahu

    Hi,
    Go with Sangvir Singh suggestion.
    It also looks neater from a Business Process Modeling perspective. You continue the process flow only when a change has occurred.
    Kind regards, Rob Dielemans

  • How to enlarge the picture at the same scale(proportion) of what

    the fontpanel enlarged when you dbclick the title bar to enlarge the fontpanel to entire screen,but the other objects (for example,the button,the string,and so on)on the fontpanel not enlarged with the varity of the fontpanel, only keep the original size.Can anyone help me! my first question is :
    how to enlarge the picture at the same scale(proportion) of what the fontpanel enlarged when you dbclick the title bar to enlarge the fontpanel to entire screen,but the other objects (for example,the button,the string,and so on)on the fontpanel not enlarged with the varity of the fontpanel, only keep the original size. i thank it is a representional question although it may be very simple,in
    my around ,no one can solve it !
    i have offered the vi and a jpeg file underside,who can help me amend the vi? greatly thanks!!! noticed that what i use is lv6.1,if you can solve the problem but need some other vi or lib files ,please offered all together!!!
    thanks!
    the second question is :whether there are some free package can application for image process! i have download some vi at the code library,but when some vi run,it need to open a "vision" folder ,then open display.lib,management.lib, pixel manipulation.lib ,files.lib of the "vision" older,finally to invoke vi named "imaq draw.vi","imaq winddraw.vi" "imaq readfile.vi" and so on ,i can not understand these! why my lv 6.1 did not have the lib files! is the edition not same?
    Attachments:
    how_to_enlarge_the_picture_at_the__same__scale_of_what_the_fontpanel__enlarged_when_you_dbclick_the_title_bar_to_enlarge_the_fontpanel_to_entire_screen.vi ‏30 KB
    Test.jpg ‏21 KB

    the fontpanel enlarged when you dbclick the title bar to enlarge the fontpanel to entire screen,but the other objects (for example,the button,the string,and so on)on the fontpanel not enlarged with the varity of the fontpanel, only keep the original size.To answer your first question:
    To change the size of only the Picture you can use the Draw Area Size like you already have. However if you want to move the other controls around the picture, you may need to use their Position Properties.
    On to question 2:
    All of the VIs you are discussing come with the NI-IMAQ driver and NI�s Vision package. To use those VIs you will need to have the IMAQ driver and have purchased our Vision software. Machine Vision and then you can click on the Machine Vision Software link to learn more about the package.
    Evan
    National Instruments

  • HT2478 how to edit the picture you put on the desktop, center it etc.

    how to edit the picture you put on the desktop, center it etc.

    On what Mac running what version of OS X?

  • How to print the picture ?

    I developed a plug-in(Annot) that dynamically display a picture according some condition,but the picture cannot be printed. How to print the picture ?

    In the print dialog, make sure that Print: Comments (which means
    annotations) is on.
    Aandi Inston

  • Can u tell how to send the pictures using datagrams sockets in java

    hi to all, i am making chat application , i am datagrams socket(packets) for sending and receiving messages . datagrams only send and receive messages in bytes . can u tell me how to send the picture to other person using datagrams.
    Thankyou.

    look her
    http://forum.java.sun.com/thread.jsp?forum=31&thread=330989&tstart=0&trange=15
    and look up Serialisation

  • How to adjust the picture on videos

    How to adjust the picture on videos

    Thanks for the reply, but, unfortunately, it did not fix my problem...
    Here is what happens if i click "v":
    - The symbol with a "walking man" on (in the upper right corner of the screen) is illuminated (turns blue).
    I don´t understand how track automation works. The only place i can find it is options menu, and track automation. There i get several choises, but what should i choose?
    I tried to enter the track automation settings, but i don't understand how it works...
    Can you describe it more detailed?
    Thanks anyway

  • HT4236 How can get the pictures from my iPod to my iPad without a computer?

    How can get the pictures from my iPod to my ipad without a computer?

    Then there is absolutely no way to get the pictures from the iPod to the iPad unless you import them to your computer and then import them inor iTunes and sync them to the iPad.
    Where did the pictures come from? Which iPod version do you have?

  • How to enlarge the picture in the picture control at the same scale(proportion) with what

    the fontpanel enlarged when you dbclick the title bar to enlarge the fontpanel to entire screen,but the other objects (for example,the button,the string,and so on)on the fontpanel not enlarged with the varity of the fontpanel, only keep the original size.how to enlarge the picture in the picture control at the same scale(proportion) of what the fontpanel enlarged when you dbclick the title bar to enlarge the fontpanel to entire screen,but the other objects (for example,the button,the string,and so on)on the fontpanel not enlarged with the varity of the fontpanel, only keep the original size. i have alter the vi properties and select "window size" there is a "s
    cale all objects" tick box ,but failed,the picture ang the picture control (container)did not enlarge ,but the other control have enlarged,just opposite to my purpose .i thank it is a representional question although it may be very simple,in my around ,no one can solve it !
    i have offered the vi and a jpeg file underside,who can help me amend the vi? greatly thanks!!! noticed that what i use is lv6.1,if you can solve the problem but need some other vi or lib files ,please offered all together!!!
    Attachments:
    how_to_enlarge_the_picture_at_the__same__scale_of_what_the_fontpanel__enlarged_when_you_dbclick_the_title_bar_to_enlarge_the_fontpanel_to_entire_screen.vi ‏30 KB
    Test.jpg ‏21 KB

    the fontpanel enlarged when you dbclick the title bar to enlarge the fontpanel to entire screen,but the other objects (for example,the button,the string,and so on)on the fontpanel not enlarged with the varity of the fontpanel, only keep the original size.Hi,
    I am not quite sure if I understand what you are trying to do.
    Sounds like you are trying to implement the zoom feature (increasing/decreasing the size of the picture inside a picture control, but not the size of the picture control itself). If this is what you are trying to do, then there is a property node in LabVIEW 7.0 that supports this feature (This property did not exist in LabVIEW 6.1). Please download the LabVIEW 7.0 evaluation version and run the attached VI.
    Please let me know if this is not what you are trying to do.
    Sincerely,
    Feroz

  • How to sync the pictures saved in my ipod touch to my new itunes library on my new computer?

    How to sync the pictures saved in my ipod touch to my new itunes library on my new computer?

    iOS: Importing personal photos and videos from iOS devices to your computer
    If the photos were synced to the iPod from another computer you will need a third-party program like PhoneView or TouchCopy.

  • How to clear the picture from custom container

    Hi All
    I am uploading the employee image into custom container . for that i have used the below fn modules
    CALL FUNCTION 'HR_IMAGE_EXISTS'
    EXPORTING
    p_pernr = pernr
    * P_TCLAS = 'A'
    * P_BEGDA = '18000101'
    * P_ENDDA = '99991231'
    IMPORTING
    * P_EXISTS =
    p_connect_info = g_connect_info
    EXCEPTIONS
    error_connectiontable = 1
    OTHERS = 2
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    else.
    CALL FUNCTION 'SCMS_DOC_URL_READ'
    EXPORTING
    * MANDT = SY-MANDT
    stor_cat = space
    crep_id = g_connect_info-archiv_id
    doc_id = g_connect_info-arc_doc_id
    * PHIO_ID =
    comp_id = 'DATA'
    * SIGNATURE = 'X'
    * SECURITY = ' '
    * USE_LOCATION = 'A'
    * LOCATION = ' '
    * HTTP_URL_ONLY = ' '
    dp_url_only = 'X'
    * LIFETIME = ' '
    * NO_CACHE = ' '
    * EXPIRATION =
    * PDF_MODE = ' '
    * URL_EXTENTION = ' '
    * FORCE_GET = ' '
    IMPORTING
    url = g_url
    EXCEPTIONS
    error_config = 1
    error_parameter = 2
    error_signature = 3
    http_not_supported = 4
    docget_not_supported = 5
    not_accessable = 6
    data_provider_error = 7
    tree_not_supported = 8
    not_supported = 9
    OTHERS = 10
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    after getting the url for uploading the picture
    I used load_picture_from_url
    the image is uploaded, but when i try to clear the image from control using picture->clear_picture
    it is not clearing the image
    Please help me how to clear the image.
    Thanks
    Rama

    Hi,
    " Request an URL from the data provider by exporting the pic_data.
    CLEAR url.
    PERFORM load_pic_from_db CHANGING url.
    " load picture
    CALL METHOD cl_gui_picture_1->load_picture_from_url
      EXPORTING
        url = url.
    CLEAR url.
    url = 'file://C:\sap-logo.gif'.
    CALL METHOD cl_gui_picture_2->load_picture_from_url
      EXPORTING
        url = url.
    CLEAR url.
    url = 'http://www.sap-press.com/images/logo_books_online_162_50.gif'.
    CALL METHOD cl_gui_picture_3->load_picture_from_url
      EXPORTING
        url = url.
    init = 'X'.
    CALL METHOD cl_gui_cfw=>flush
      EXCEPTIONS
        cntl_system_error = 1
        cntl_error = 2.
    ENDIF.
    Its helpful.
    Regards,
    Raj.

  • IK Bone Tool - How to change the picture of a bodypart in animation?

    I don't know how to word this any better. I have a puppet and all ready for animation. Now the question is how can I change the picture of a body part? Example on how I thought it would work: I have a walking puppet, and I can change the picture of the foot for example, when it steps on the ground. Or I can change the picture of the hand, by adding another keyframe and select that one. I could for example change the weapon the character has in his hand while walking, or the picture of the eyes from open to closed, for just 2 frames of the animation. How do I do that? I can't find a way. Simply adding another keyframe to the hand-movieclip doesn't work, it just plays both of these back all the time then.

    But swapping it through the properties windows swaps it for the whole animation. That is good for getting animations with different objects in the characters hands, but its not exactly how I want it. I only want it to be swapped for the frames in which I set it to something else, and then it goes back to normal.
    Like the character runs and closes his eyes while running, so I wanna switch the picture of the eyes for those few frames. I don't exactly understand how you mean that.
    I'm not sure how you mean that with the adding frames in the timeline, maybe that is exactly what I mean but I dont understand it. Do you mean in the main timeline? I don't get it. If I put another frame in one of the movie clips (for the hand for example) it plays the whole time, so it changes between the two hand versions all the time while he is walking.
    And to the video link above, that only seems to explain the basic bone thing, not my question. I already have a skeleton set up.

Maybe you are looking for