Resize cl_gui_dialogbox_container SIZE_CONTROL

Hello,
In most object oriented languages I can catch an event using the signal to execute some process. Typical events like mouse clicks and mouse movements are usually implemented. So are resizing events for windows ...
I a beginner in ABAP OO programming but I see that the  cl_gui_dialogbox_container has a SIZE_CONTROL event which I thought could be handled in the same way as the CLOSE event. But I am unable to use this. Furthermore the other events RIGHT_CLICK LEFT_CLICK_DESIGN MOVE_CONTROL  LEFT_CLICK_RUN I can not catch either.
Can someone give me some indication on the way to use these in a program.
Thanks,
PD

Hi Narin,
I have read this thread before. Its promising but this will not solve the problem I am addressing now. I have created a dialogue box, which in essence is resizable. Inside this box I have output a calander from the SAP calander class, also what I need.
The end user sees the dialogue box and the calander as he expects. However, the dialogue box may be too small.
In such a scenario the user will try to make the dialogue box bigger in order to see the entire calender. But cl_gui_dialogbox_container alows you to stretch the cintainer well beyond the size of its contents and this is what I would like to aqvoid.
I can do this in most OO languages by catching the resize event like this :
on resize
check new width and height.
if new width > fixed value set new width to that value,
if new height > fixed value fix it to that value
otherwise accept new width and new height accordingly.
perhaps this is not possible with this class. I do not know ...
thanks,
PD

Similar Messages

  • Events move_contol and size_control in class cl_gui_dialogbox_container

    Hello,
    Here's quite a tricky problem, which I could need some help for.
    I have an object of class cl_gui_dialogbox_container with some HTML in it. The users can resize and move the control on the screen. Now position and size shall be kept in a dictionary table for each user.
    I've registered the three events close, move_contol and size_control
      CALL METHOD gc_dialogbox->set_registered_events
        EXPORTING
          events                    = gt_events
    with event_ids 8, 11 and 12 and set the three handlers, e.g.
      SET HANDLER cl_event_receiver_tree=>handle_close
      FOR gc_dialogbox.
    I created three corresponding methods handle_close, handle_move_control and handle_size_control.
    Well, so far for what I've done. Now the results:
    If I close the dialogue box, ABAP correctly jumps into method handle_close. But at that point, the control has already been closed! So I can't read size and position any more.
    If I move or rezise the window, nothing at all happens... Not even the debugger would pop up if I do anything with the box.
    Does anyone here know how to do this?
    Thanks!
    Jan
    Edited by: Jan Krohn on Nov 22, 2008 3:17 PM

    A quick update in case anyone else is looking for a solution:
    I've still not found out how to handle the events move_control and size_control.
    However, when handling close_control, it's possible to catch size and position:
    call the methods to obtain size and/or position
    call a cfw flush
    only then the parameters will be filled with the correct values.
    Important: This must happen after the close button has been pressed, but before the control will be destroyed. So put it in the correct place in your source code.

  • CL_GUI_SPLITTER_CONTAINER and SIZE_CONTROL event not working toghether

    Hello,
    I am trying to react on the fact that my CL_GUI_SPLITTER_CONTAINER is being resized (= the splitter/sash is moved, thus the child container are resized).
    However, no matter what I try, I never get the event to be thrown. I registered both, the splitter control as well as its children to that event, but no luck. Searching here in SDN or via google wasn't turning up anything helpful either...
    So could someone please either confirm that this event should work or the opposite, so that I at least know if I am doing something wrong, or if it isn't working at all.
    Some central pieces of what I am trying to do:
    CALL METHOD gr_splitter->reg_event_size_control
        EXPORTING
          register = 1.
      SET HANDLER gr_splitter_event_receiver->handle_resize FOR gr_splitter.
    CLASS lcl_splitter_event_receiver DEFINITION.
      PUBLIC SECTION.
        METHODS handle_resize
          FOR EVENT size_control OF cl_gui_splitter_container.
    ENDCLASS.               "LCL_SPLITTER_EVENT_RECEIVER
    I would be glad for every hint or comment!
    Cheers
    Philip

    Hello,
    I'm facing the same problem.
    I've tried with method set_registered_events. Unfortunately with the same result. The event wasn't handled by my receiver.
    Do you found a solution meanwhile?
    Thanks,
    Peter

  • Make ALV GRID screen resizable

    Hi All,
    I have created an object V_MAPBOX using reference to class CL_GUI_DIALOGBOX_CONTAINER.
    CREATE OBJECT v_mapbox
          EXPORTING
            width = 300
            height = 130
            style = cl_gui_control=>ws_sysmenu
            repid = 'ZMAP'
            dynnr = '1000'
            top = v_top2
            left = v_left2
            caption = 'Mapping Information'
          EXCEPTIONS
            cntl_error = 1
            cntl_system_error = 2
            create_error = 3
            lifetime_error = 4
            lifetime_dynpro_dynpro_link = 5
            event_already_registered = 6
            error_regist_event = 7
            OTHERS = 8.
    Then created an object V_MAPALV with reference to class CL_GUI_ALV_GRID exporting V_MAPBOX.
    Finally I am calling the method SET_TABLE_FOR_FIRST_DISPLAY of CL_GUI_ALV_GRID to display the screen on my custom container of screen 1000.
        CALL METHOD v_mapalv->set_table_for_first_display
          EXPORTING
            i_save                        = 'A'
            is_layout                     = wa_layout
          CHANGING
            it_outtab                     = i_map
            it_fieldcatalog              = i_fieldcat_map
          EXCEPTIONS
            invalid_parameter_combination = 1
            program_error                 = 2
            too_many_lines                = 3
            OTHERS                        = 4.
        IF sy-subrc <> 0.
        ENDIF.
    The screen is getting displayed as expected. But I require to make this ALV screen to be resizable while it is displayed.
    Have tried calling     CALL METHOD v_mapbox->resize, before calling the V_MAPALV methods but it does not work.
    Need to know how can I make this resizable.

    Hi,
    ABAP objects are used to implement the controls in programs.
    An SAP Container can contain other controls (for example, SAP ALV Grid Control, Tree Control, SAP Picture Control, SAP Splitter Control, and so on). It administers these controls logically in one collection and provides a physical area for the display.
    Every control exists in a container. Since containers are themselves controls, they can be nested within one another. The container becomes the parent of its control. SAP containers are divided into five groups:
    SAP custom container: Displays within an area defined in Screen Painter on screens or sub screens.
    Class: CL_GUI_CUSTOM_CONTAINER
    SAP dialog box container: Displays in a modeless dialog box or as a full screen. Class:
    CL_GUI_DIALOGBOX_CONTAINER
    SAP docking container: Displays as docked, resizable sub-window with the option of displaying it as a modeless dialog box. Class: CL_GUI_DOCKING_CONTAINER
    SAP splitter container: Displays and groups several controls in one area - that is, splits the area into cells Class: CL_GUI_SPLITTER_CONTAINER
    SAP easy splitter container: Displays controls in two cells, which the user can resize using a split bar. Class: CL_GUI_EASY_SPLITTER_CONTAINER.
    In the control, you can adjust the column width by dragging, or use the 'Optimum width' function to adjust the column width to the data currently displayed. You can also change the column sequence by selecting a column and dragging it to a new position.
    Thanks,
    Pradeep.

  • SIZE_CONTROL Event for docking container

    Hi, Everybody
    I'm trying to handle size_control event for a docking container. But the event is not trigged. See the code excerpt below:
    * Create left docking container
      CREATE OBJECT ao_docking_container_left
        EXPORTING
          side = cl_gui_docking_container=>dock_at_left
          extension = 300
          dynnr = cl_co=>ac_main_screen
          repid = cl_co=>ac_main_prog.
    * Register the event
    ls_event-eventid = 12.
      ls_event-appl_event = 'X'.
      APPEND ls_event TO lt_events.
      CALL METHOD ao_docking_container_left->set_registered_events
        EXPORTING
          events                    = lt_events
        EXCEPTIONS
          cntl_error                = 1
          cntl_system_error         = 2
          illegal_event_combination = 3
          OTHERS                    = 4
    * Set handler
    SET HANDLER handle_doclist_resize FOR ao_docking_container_left.
    I have set the handle_doclist_resize method as a handler for the SIZE_CONTROL event of the CL_GUI_DOCKING_CONTAINER class (by Class Builder).

    I have transfered my code just into the one programm. But it still doesn't work I guess the SIZE_CONTROL event is not implemented in CL_GUI_DOCKING_CONTAINER.
    *& Report  ZMMM_DOCK                                                   *
    report  zmmm_dock                               .
    data:   ao_docking_container_left type ref to cl_gui_docking_container,
            lt_events type cntl_simple_events,
            ls_event type cntl_simple_event.
    *&       Class CL_EVENT_HANDLER
    *        Text
    class cl_event_handler definition.
      public section.
        class-methods:
        handle_doclist_resize for event size_control
        of cl_gui_docking_container.
    endclass.               "CL_EVENT_HANDLER
    * Create left docking container
    create object ao_docking_container_left
      exporting
        side = cl_gui_docking_container=>dock_at_left
        extension = 600
        dynnr = '0100'
        repid = sy-repid.
    ls_event-eventid = 12.
    ls_event-appl_event = 'X'.
    append ls_event to lt_events.
    call method ao_docking_container_left->set_registered_events
      exporting
        events                    = lt_events
      exceptions
        cntl_error                = 1
        cntl_system_error         = 2
        illegal_event_combination = 3
        others                    = 4.
    set handler cl_event_handler=>handle_doclist_resize
      for ao_docking_container_left.
    call screen 100.
    *&       Class (Implementation)  cl_event_handler
    *        Text
    class cl_event_handler implementation.
      method handle_doclist_resize.
    *Handles tree resizing
        data: lv_result type sysubrc,
              lv_width type i.
        call method ao_docking_container_left->get_width
          importing
            width      = lv_width
          exceptions
            cntl_error = 1
            others     = 2.
        leave program.
      endmethod.                    "handle_doclist_resize
    endclass.               "cl_event_handler
    include zmmm_dock_status_0100o01.
    include zmmm_dock_user_command_0100i01.

  • Size_control event of container objects

    Hi,
    I have a splitter container. I have derived two A & B containers from it. I have programmed the B container to fire the size_control event when the splitter of the splitter container is moved up and down thereby changing its size. however, it never fires. Is there something specific that needs to be done over here.
    I have registered the EVENT_SIZE event for the derived container B.
    In other words, i want to catch the event when the splitter of the spliter container is moved up/down, left/right.. In my opinion, moving the splitter should result in the change of size of the container B contained within which should ultimately fire the size_control event.
    Am i missing something here or is there any other way to do it.
    Any advice would be highly appreciated.
    Regards,
    Ghufran

    Hi Ravi,
    Thanks for the reply. That's exactly what i want to catch. I want to catch this resizing event whenever and however it happens, since i need to do some processing.
    Could you give me any idea about it.
    Regards,
    Ghufran

  • Resized animated gif ImageIcon not working properly with JButton etc.

    The problem is that when I resize an ImageIcon representing an animated gif and place it on a Jbutton, JToggelButton or JLabel, in some cases the image does not show or does not animate. More precicely, depending on the specific image file, the image shows always, most of the time or sometimes. Images which are susceptible to not showing often do not animate when showing. Moving over or clicking with the mouse on the AbstractButton instance while the frame is supposed to updated causes the image to disappear (even when viewing the non-animating image that sometimes appears). No errors are thrown.
    Here some example code: (compiled with Java 6.0 compliance)
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Test
         public static void main(String[] args)
              new Test();
         static final int  IMAGES        = 3;
         JButton[]           buttons       = new JButton[IMAGES];
         JButton             toggleButton  = new JButton("Toggle scaling");
         boolean            doScale       = true;
         public Test()
              JFrame f = new JFrame();
              f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              JPanel p = new JPanel(new GridLayout(1, IMAGES));
              for (int i = 0; i < IMAGES; i++)
                   p.add(this.buttons[i] = new JButton());
              f.add(p, BorderLayout.CENTER);
              f.add(this.toggleButton, BorderLayout.SOUTH);
              this.toggleButton.addActionListener(new ActionListener() {
                   @Override
                   public void actionPerformed(ActionEvent e)
                        Test.this.refresh();
              f.setSize(600, 300);
              f.setVisible(true);
              this.refresh();
         public void refresh()
              this.doScale = !this.doScale;
              for (int i = 0; i < IMAGES; i++)
                   ImageIcon image = new ImageIcon(i + ".gif");
                   if (this.doScale)
                        image = new ImageIcon(image.getImage().getScaledInstance(180, 180, Image.SCALE_AREA_AVERAGING));
                   image.setImageObserver(this.buttons);
                   this.buttons[i].setIcon(image);
                   this.buttons[i].setSelectedIcon(image);
                   this.buttons[i].setDisabledIcon(image);
                   this.buttons[i].setDisabledSelectedIcon(image);
                   this.buttons[i].setRolloverIcon(image);
                   this.buttons[i].setRolloverSelectedIcon(image);
                   this.buttons[i].setPressedIcon(image);
    Download the gif images here:
    http://djmadz.com/zombie/0.gif
    http://djmadz.com/zombie/1.gif
    http://djmadz.com/zombie/2.gif
    When you press the "Toggle scaling"button it switches between unresized (properly working) and resized instances of three of my gif images. Notice that the left image almost never appears, the middle image always, and the right image most of the time. The right image seems to (almost) never animate. When you click on the left image (when visble) it disappears only when the backend is updating the animation (between those two frames with a long delay)
    Why are the original ImageIcon and the resized ImageIcon behaving differently? Are they differently organized internally?
    Is there any chance my way of resizing might be wrong?

    It does work, however I refuse to use SCALE_REPLICATE for my application because resizing images is butt ugly, whether scaling up or down. Could there be a clue in the rescaling implementations, which I can override?
    Maybe is there a way that I can check if an image is a multi-frame animation and set the scaling algorithm accordingly?
    Message was edited by:
    Zom-B

  • How can I get just the text to resize, rather than the entire web page?

    I used to be able to re-size just text on a webpage by typing Ctrl + +. Today, the entire webpage re-sizes, and when I move to another page it reverts. (I see this mostly in Facebook.). Why did this change, and can I go back to having just the text re-size?

    ''How can I get just the text to resize -- zoom text only''
    steps
    #"Alt" if no menu bar, then
    # View > Zoom > Zoom Text Only
    Zoom text of web pages - MozillaZine Knowledge Base
    :http://kb.mozillazine.org/Zoom_text_of_web_pages
    <br><small>Please mark "Solved" one answer that will best help others with a similar problem -- hope this was it.</small>

  • How can I implement a status bar at the bottom of a resizable application?

    Hello all,
    I am a JavaFx newbie and I am implementing an application (a Sokoban game), with a menu at the top of the frame and a gaming area covering the rest of the frame. To support the game, I have to load images at certain positions in the gaming area.
    The game also includes a level editor with another menubar and where images are set to other positions.
    I implemented this in another view, swiching from the game mode to the level editor mode and vice versa is just done by setting the other view visible. Up to now this works, here the important statements building these details:
    Group root = new Group();
    gameView = new Group(); // for gaming mode
    le_view = new Group()   // for level editor mode
    MenuBar gameMenubar = new MenuBar();
    Menu menuGame = new Menu(bundle.getString("MenuGame"));
    ... building the menu items and menues ...
    gameView.getChildren().add(gameMenubar);
    ImageView buildingView[][] = new ImageView[22][22];
    for (nCol = 0; nCol < 22; nCol++) {
        for (nRow = 0; nRow < 22; nRow++) {
            buildingView[nCol][nRow] = new ImageView();
            buildingView[nCol][nRow].setX(nCol * 26 + 5);
            buildingView[nCol][nRow].setY(nRow * 26 + 40);
            gameView.getChildren().add(buildingView[nCol][nRow]);
    gameView.setVisible(true);
    root.getChildren().add(gameView);
    ... same stuff to build the le_view ...
    le_View.setVisible(false);
    root.getChildren().add(le_View);
    Scene scene = new Scene(root, 800, 600, Color.CORNSILK); Now I want to introduce a status bar at the bottom of the frame, which of course has to follow the bottom of the frame, if it is resized. And of course the menu and the status bar should not grow vertically, if the height of the frame is increased.
    The implementation seems to be easy with StackPane for the frame and one BorderPane for each mode.
    For the first step I only tried implementing the game mode with only one BorderPane (just setting the menu, the gaming area and the status bar each into a HBox and setting these three HBoxes at the top, into the center and at the bottom). I also tried this via GridPane and via VBox; I always get any erroneous behaviour:
    Either the menubar is visible, but the menus do not pop up the menu items, or the anchor point of the menu and of gaming area are set 100 pixels left of the left frame border and move into the frame when the frame width is increased, or the menu is set 20 pixels below the top of the frame, or HBox with the menu grows when the frame height is increased, so that the anchor point of the gaming area moves down.
    Can you describe me a correct construction of such a frame? Thanks in advance.
    Best regards
    Gerhard

    Hello Gerhard,
    Glad the code helped, thanks for a fun layout exercise.
    For the draft code I just pulled an icon off the internet over a http connection.
    If you haven't done so already place any icons and graphics you need local to your project, so that resource lookups like:
    Image img = new Image("http://www.julepstudios.com/images/close-icon.png");become
    Image img = new Image("close-icon.png");then performance may improve.
    Another possible reason for your performance problem could be that when you use a vbox, the vbox content can overflow the area of the borderpane center and might be sitting on top of the menu pane, making you unable to click the menu (which is what happens to me when I try that with the draft program with the vbox wrapping mod, then resize the scene to make it smaller). This was a trick which caught me and the reason that I used a Group originally rather than a vbox. I found a vbox still works but you need to tweak things a bit. The trick I saw was that the order in which you add stuff to the borderpane is important. The borderpane acts like a stack where the last thing added floats over the top of everything else if you size the scene small enough. For your project you want the menu on top always, so it always needs to be the last thing added to the borderpane, but when you swap in the level pane for the game pane, then back out again, the game pane can end up on top of the menu which makes the menu seem like you can't click it (only when the scene is sized small enough). It was quite a subtle bug which took me a little while to work out what was happening. For me the solution was to add just one vbox to the center of the border, and then swap the game pane and the level editor in and out of the vbox, that way the center of the layout always stayed behind the menu bar and the status bar.
    I added some revisions to reflect the comments above and placed some comments in the code to note what was changed and why.
    public class SampleGameLayoutRevised extends Application {
      public static void main(String[] args) { Application.launch(args); }
      public void start(Stage stage) throws Exception {
        final BorderPane gameLayout = new BorderPane();
        final Group gameView = new Group();
        final MenuBar gameMenubar = new MenuBar();
        final Menu gameMenu = new Menu("Mode");
        final VBox centerView = new VBox();
        centerView.setStyle("-fx-background-color: darkgreen");  // we set a background color on the center view to check if it overwrites the game menu.
        MenuItem playGameMenu = new MenuItem("Play Game");
        MenuItem levelEditMenu = new MenuItem("Edit Levels");
        gameMenu.getItems().add(playGameMenu);
        gameMenu.getItems().add(levelEditMenu);
        gameMenubar.getMenus().add(gameMenu);
        final StackPane levelEditView = new StackPane();
        levelEditView.getChildren().add(new Text("Level Editor"));
        ImageView buildingView[][] = new ImageView[22][22];
        Image img = new Image("http://www.julepstudios.com/images/close-icon.png");  // use of http here is just for example, instead use an image resource from your project files.
        for (int nCol = 0; nCol < 22; nCol++) {
          for (int nRow = 0; nRow < 22; nRow++) {
            ImageView imgView = new ImageView(img);
            imgView.setScaleX(0.5);
            imgView.setScaleY(0.5);
            buildingView[nCol][nRow] = imgView;
            buildingView[nCol][nRow].setX(nCol * 20 + 5);
            buildingView[nCol][nRow].setY(nRow * 20 + 40);
            gameView.getChildren().add(buildingView[nCol][nRow]);
        final VBox statusBar = new VBox();
        final Text statusText = new Text("Playing Game");
        statusBar.getChildren().add(statusText);
        statusBar.setStyle("-fx-background-color: cornsilk"); // we set a background color on the status bar,
                                                              // because we can't rely on the scene background color
                                                              // because, if the scene is sized small, the status bar will start to overlay the game view
                                                              // and if we don't explicitly set the statusBar background the center view will start
                                                              // to bleed through the transparent background of the statusBar.
        gameLayout.setCenter(centerView); // we add the centerview first and we never change it, instead we put it's changeable contents in a vbox and change out the vbox content.
        gameLayout.setBottom(statusBar);
        gameLayout.setTop(gameMenubar);   // note the game layout is the last thing added to the borderpane so it will always stay on top if the border pane is resized.
        playGameMenu.setOnAction(new EventHandler<ActionEvent>() {
          public void handle(ActionEvent event) {
            centerView.getChildren().clear();  // here we perform a centerview vbox content swap.
            centerView.getChildren().add(gameView);
            statusText.setText("Playing Game");
        levelEditMenu.setOnAction(new EventHandler<ActionEvent>() {
          public void handle(ActionEvent event) {
            centerView.getChildren().clear();  // here we perform a centerview vbox content swap.
            centerView.getChildren().add(levelEditView);
            statusText.setText("Editing Level");
        playGameMenu.fire();
        Scene scene = new Scene(gameLayout, 800, 600, Color.CORNSILK);
        stage.setScene(scene);
        stage.show();
    }Other than that I am not sure of a reason for the slowdown you are seeing. In my experience JavaFX has been quick and responsive for the tasks I have been using it for. Admittedly, I just use if for a bunch of small trial projects, but I've never seen it unresponsive for a minute.
    - John

  • In Windows 8.1, the Thunderbird window keeps resizing

    I have a new Transformer T100A laptop, running Windows 8.1 Pro. I run Thunderbird in desktop mode. The height of the Thunderbird window keeps getting small, while the width remains the same. I usually have my folder mails in the top pane, and the open message in the bottom pane. When I open Thunderbird, it often, but not always, comes up with such a short window that I can't see any of the open message at all, and only a few lines of the messages in the folder. This happens often even when I haven't closed Thunderbird, but the computer has gone into battery saving mode. This is not a huge problem, but it's annoying to have to resize the window almost every time I use Thunderbird.

    Hi,
    You can try the steps in following article:
    Using Pictures from Active Directory
    http://msitpros.com/?p=1036
    This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore,
    Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you
    completely understand the risk before retrieving any software from the Internet.
    For your reference, here is the similar thread with different method:
    http://social.technet.microsoft.com/Forums/en-US/d6e7b2c3-c343-4900-a01d-24bfb30357b6/is-there-a-solution-to-set-user-account-picture-from-active-directory-thumbnailphoto-attribute-in?forum=w8itproinstall
    Hope these would be helpful.
    Kate Li
    TechNet Community Support

  • How resize pictures in table on PAGES 5.2?

    The new version 5.2 was be optmized for import image in table, but how resize these pictures in table?

    DO NOT use Pages 5.2.    Use Keynote or Numbers.  The latest versions of these apps are stable.  Pages 5.2 nothing but trouble.
    Here is what I do with my art, which must be perfect for commercial printing and other purposes.
    Export the page with your table and art out as a PDF.  Then bring the PDF into Adobe Illustator and make any changes you need to get the art looing exactly like what you want.  Save the art from AI ouit to PDF.  AI creates bullet proof PDF files.  Then drag the clean PDF back into Pages.
    One reason AI is the preferred route is that Adobe comlpliant PDF files  are the standard in the commercial printing industry.  These days, all files going to commercial printers must be in clean PDF format.  As you would expect, there are some excellent apps for pre-flighint PDF files.
    The final reason for using PDF for art is that your illustrations will move cleanly into iBook Author for iBooks and apps for creating international standard ePubs and Amazon MOBI files.

  • Which approach to use for resizing image

    There are two ways of resizing images as I know:
    1. image.getScaledInstance(width,height,hint);
    Using hint like Image.SCALE_AREA_AVERAGING gives somehwat satisfactory resizing.
    2. static BufferedImage resize(GraphicsConfiguration gc, BufferedImage source, int w, int h, Object hintValue) {
    BufferedImage result = gc.createCompatibleImage(w, h, source.getTransparency());
    Graphics2D g2 = result.createGraphics();
    g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION, hintValue);
    double sx = (double) w / source.getWidth(), sy = (double) h / source.getHeight();
    g2.drawRenderedImage(source, AffineTransform.getScaleInstance(sx, sy));
    g2.dispose();
    return result;
    where the hint passed is RenderingHints.VALUE_INTERPOLATION_BILINEAR ;
    Now which of the two method method should I use-using image.getScaledInstance() or using AffineTranform ? opr is there any other way which is faster but provides good result?
    i am creating an image editor, so the GUI dialog will have oprtion to choose the algorithm. I want the method which provides better result yet faster.
    Tanveer

    http://forum.java.sun.com/thread.jsp?forum=20&thread=522483

  • Menu/Toolbar Display Corruption Upon Resizing Window

    We're experiencing an issue with one of our workstations where when the Adobe Reader X (10.1.3) window is resized, the Menu/Toolbar displays become corrupt and garbled on the screen (see the attached picture). The Toolbar appears on the top, the frame around the application disappears, and the menubar has to be hovered across for items to appear.
    I have uninstalled and reinstalled Adobe Reader, updated the video card drivers, and ensured all Adobe/Microsoft updates have been applied to this workstation.
    Dell Precision T3500
    Intel Xeon W3530 (2.80 GHz)
    6.00GB of Memory
    NVIDIA Quadro FX 580
    Windows 7 Ultimate x64

    Was curious to how you were able to change the display resolution - I am unable to even see anything on my desktop... I have connected my power book to another monitor but have the same result.

  • I resize my window image so everything is correct portion but as soon as I change window to next page the image goes back to small size. How can I stop this occuring. This happens when go on facebook or any other area. Help me please.

    size of the general image that I see reduces toby about a third - I resize it by pressing Ctrl key and using my mouse scroll button to expand the whole image so that it fill the screen. As soon as I go to the next page the whole image reverts back to original size and I have to repeat the action again.

    The Firefox Page Zoom feature does a domain by domain level of saving the users preferred zoom level settings, there is no default Page Zoom level setting in Firefox.
    Try the Default FullZoom Level extension: <br />
    https://addons.mozilla.org/en-US/firefox/addon/6965
    Or the NoSquint extension: <br />
    https://addons.mozilla.org/en-US/firefox/addon/2592/

  • Image select, resize and locally store (flex3 air example)

    Hi there,
    After a few days of struggling with images, resize functions
    and file dialog boxes I created a nice example application that
    shows how you can select an image, resize it and save the resized
    image in the application storing directory.
    I hope you can profit from it.
    Greets, jacob
    example code for flex 3 air.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:WindowedApplication xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute">
    <mx:Script>
    <![CDATA[
    import mx.graphics.codec.PNGEncoder;
    public var imageFile:File;
    public var fileresultimage:Object;
    public var fileresultlabel:Object;
    // File.applicationStorageDirectory gets you to the local
    storage dir
    //On Windows, this is the "projectname" directory
    //(for example, C:\Documents and Settings\application
    data\projectname).
    // On Mac OS, it is /Users/userName/Documents.
    public var docsDir:File = File.applicationStorageDirectory;
    public function
    imageFileDialog(image:Object,label:Object):void
    fileresultimage=image;
    fileresultlabel=label;
    var imagesFilter:FileFilter =
    new FileFilter("Foto (*.jpg, *.gif, *.png)",
    "*.jpg;*.gif;*.png");
    if(imageFile==null)
    imageFile = new File();
    imageFile.addEventListener(Event.SELECT, imageSelected);
    imageFile.browseForOpen("Select an Image",[imagesFilter]);
    // if there is a file selected
    public function imageSelected(event:Event):void
    var newFile:File = event.target as File;
    //if there is a file object on the screen
    if(fileresultimage!=null)
    fileresultimage.source=imageFile.url;
    //if there is a label object on the screen
    if(fileresultlabel!=null)
    fileresultlabel.text=imageFile.url;
    if (newFile.exists==true)
    var loader:Loader = new Loader();
    loader.contentLoaderInfo.addEventListener(Event.COMPLETE,
    handleImageComplete);
    loader.load(new URLRequest(imageFile.url));
    // when load of the selected image is complete we save a
    smaller version of it.
    public function handleImageComplete(event:Event):void
    var loader:Loader = Loader(event.target.loader);
    // width and heigt of selected image
    var originalimgwidth:Number=event.target.width;
    var originalimgheight:Number=event.target.height;
    //put original image into bitmapdata
    var bitmapje:BitmapData;
    bitmapje=new BitmapData(originalimgwidth, originalimgheight,
    true, 0x00000000);
    //bitmapje.draw(loaderInfo.loader.content,null,null,null,null,true);//null
    object reference
    bitmapje.draw(loader.content,null,null,null,null,true);
    // call the resize function and give the original
    image,maxx,and maxy with it.
    var thumb:BitmapData=resizeimage(bitmapje,150,150);
    var newimagefile:File=new File();
    // T = Thumbnail
    // 1 = next id in the db
    // for now we use a random number
    var random:Number= Math.random();
    random = Math.ceil(random*100);// to get a positive number
    var filenameForSave:String="T"+random; //new filename;
    newimagefile=docsDir.resolvePath("Thumbs/" + filenameForSave
    + ".png"); //image path
    var stream:FileStream = new FileStream; // create new
    filestream
    stream.open(newimagefile, FileMode.WRITE); // open
    filestream
    var data:ByteArray = encodeToPng(thumb); // convert
    bitmapdata to a png bytearry
    stream.writeBytes(data, 0, data.length); // writing the
    image
    stream.close();
    // show the saved thumb
    savedthumb.source=newimagefile.nativePath;
    bitmapje=null;
    thumb=null;
    // resize function
    private function
    resizeimage(image:BitmapData,maxx:Number,maxy:Number):BitmapData
    var bmp:BitmapData =image;
    var true_width:Number = bmp.width;
    var true_height:Number = bmp.height;
    var resize:Boolean=false;
    if (true_width>maxx) resize=true;
    if (true_height>maxy) resize=true;
    if (resize==true)
    var width:Number=maxx;
    var height:Number = (width / true_width) * true_height;
    true_width=width;
    true_height=height;
    if (true_height>maxy)
    height=maxy;
    width = (height/true_height)*true_width;
    else
    width=true_width;
    height=true_height;
    else
    width=true_width;
    height=true_height;
    //new calculated width and heigt relative to the given maxx
    and maxy.
    width=Math.ceil(width);
    height=Math.ceil(height);
    //create a new image object with the calculated widht and
    height for the smaller image
    var mysmallimage:Image=new Image();
    mysmallimage.width=width;
    mysmallimage.height=height;
    //new matrix for smaller image
    var m : Matrix = new Matrix() ;
    //scale the matrix to the correct sizes.
    m.scale( mysmallimage.width / bmp.width, mysmallimage.height
    / bmp.height ) ;
    //draw the image into the image object
    mysmallimage.graphics.beginBitmapFill( bmp, m, false, true )
    mysmallimage.graphics.drawRect( 0, 0, mysmallimage.width,
    mysmallimage.height ) ;
    mysmallimage.graphics.endFill();
    //put the smaller image into bitmapdata so it can be
    returned.
    var littlebitmapdata:BitmapData=new
    BitmapData(mysmallimage.width,mysmallimage.height,true,0x00000000);
    littlebitmapdata.draw(mysmallimage);
    // set the temporary small image to null so the GC can
    remove it from the memmory.
    mysmallimage=null;
    bmp=null;
    //returning the small image.
    return littlebitmapdata;
    // encoder to png
    private function encodeToPng(bmd:BitmapData):ByteArray
    var png:PNGEncoder= new PNGEncoder();
    return png.encode(bmd);
    ]]>
    </mx:Script>
    <!--<mx:Image id="tempimage" x="404" y="36"
    complete="temploadcomplete()"/>-->
    <mx:Image id="myimg" x="10" y="55" width="314"
    height="227" verticalAlign="middle" horizontalAlign="center"/>
    <mx:TextInput id="imageurl" x="53" y="303" width="160"
    maxWidth="160"/>
    <mx:Button x="221" y="303" label="Bladeren"
    click="imageFileDialog(myimg,imageurl)"/>
    <mx:Image x="346" y="55" id="savedthumb"/>
    <mx:Text x="23" y="0" text="Original image with limit
    width and height to show it on the screen." height="47"
    width="177"/>
    <mx:Text x="346" y="0" text="Local stored thumbnail"/>
    </mx:WindowedApplication>
    To bad the attach code button still isn't fixed :(

    Hi there,
    Will you be able to provide the backend script for saving the
    file data?Will you be able to provide the backend script for saving
    the file data?
    This example is created for a desktop application. Saving the
    file is included in this example, it saves in the application
    storage directory.
    // File.applicationStorageDirectory gets you to the local
    storage dir
    //On Windows, this is the "projectname" directory
    //(for example, C:\Documents and Settings\application
    data\projectname).
    // On Mac OS, it is /Users/userName/Documents.
    If you attempt to use certain functionality in a website, you
    need other functionality for storing the image on the server. There
    are lots of examples on that one.. Perhaps i need it in the future.
    If i do i will post an example on the forum.
    Also, may I post your link to other forums, so that others may
    benefit?
    Sure you may post the example on other websites and forums.
    I found it difficult to find nice examples, so the more the
    better ;)
    Just put underneath the example something like:
    Created By: Jacob Hingst From Holland
    No copyright attached, so free for your use.

Maybe you are looking for

  • LIKE and Type in abap statements

    Hello  All , I have a question regarding the 'Like' and' Type'  I have created a badi XXX , The method has a changing parameter 'A'  which is referenced to a structure . The typing method I have mentioned in the method ( in the parameter list ) is TY

  • Invalid append operation when generating pdf document?

    I am getting the following Log warning when I check the log of my livecycle designer es2 form: Invalid append operation: fill cannot have a child element of color The element[color] has violated its allowable number of occurences. I don't know how to

  • Use LOOP in workflow

    hi experts:     when I create one notice,many leaders will approve or reject the notice one by one.I want to use "loop until" in workflow template,how can it carry out?     thanks a lot!

  • Installing CS2 as a download

    I am installing CS2 as downloaded files, at the end of the first file it asks for CD2. Even though all three downloaded files are in the same folder it is not seeing the next file. My only options are ok or quit, ok only asks again for the cd. Has an

  • Component Availabity Check during production order creation

    Hi All, During production creation, I donu2019t want to include/ check the reserved stock of component (stock which has been assigned for other prod order) Where I required to make the changes in config. Regards, Shailendra