How to display different parts of an image

hi,
I need to display different parts of an image at specific situations.
for example, a dice. there is only one image which includes different sides of the dice. and I wanna add
to my panel one side if one comes, two side if two comes... I mean if one comes then we will display
from 10 px to 80 px width and from 10 px to 80 px height of the dice image.
is there any way to obtain this in java?
thanks...

import java.awt.*;
import java.awt.font.*;
import java.awt.geom.*;
import java.awt.image.BufferedImage;
import java.util.Random;
import javax.swing.*;
public class ImageClipping extends JPanel {
    BufferedImage image;
    Rectangle clip;
    final int ROWS = 3;
    final int COLS = 3;
    public ImageClipping() {
        // Make an image we can clip.
        Dimension d = getPreferredSize();
        int type = BufferedImage.TYPE_INT_RGB;
        image = new BufferedImage(d.width, d.height, type);
        Graphics2D g2 = image.createGraphics();
        g2.setBackground(getBackground());
        g2.clearRect(0, 0, d.width, d.height);
        Font font = g2.getFont().deriveFont(36f);
        g2.setFont(font);
        FontRenderContext frc = g2.getFontRenderContext();
        LineMetrics lm = font.getLineMetrics("0", frc);
        float sh = lm.getAscent() + lm.getDescent();
        int xInc = d.width/COLS;
        int yInc = d.height/ROWS;
        for(int j = 0; j < ROWS; j++) {
            for(int k = 0; k < COLS; k++) {
                String s = String.valueOf(j*COLS + k+1);
                float sw = (float)font.getStringBounds(s, frc).getWidth();
                float sx = k*xInc + (xInc - sw)/2;
                float sy = j*yInc + (yInc + sh)/2 - lm.getDescent();
                g2.setPaint(Color.red);
                g2.drawString(s, sx, sy);
                g2.setPaint(Color.blue);
                g2.drawRect(k*xInc, j*yInc, xInc-1, yInc-1);
        g2.dispose();
        clip = new Rectangle(xInc, yInc);
        // Inspect image.
        ImageIcon icon = new ImageIcon(image);
        JOptionPane.showMessageDialog(null, icon, "", -1);
    protected void paintComponent(Graphics g) {
        super.paintComponent(g);
        Graphics2D g2 = (Graphics2D)g;
        g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                            RenderingHints.VALUE_ANTIALIAS_ON);
        Shape origClip = g2.getClip();
        //g2.setPaint(Color.red);
        //g2.draw(clip);
        // Draw clipped image at:
        int x = 100;
        int y = 100;
        // Mark location.
        g2.setPaint(Color.red);
        g2.fill(new Ellipse2D.Double(x-2,y-2,4,4));
        // Position the image.
        g2.translate(x-clip.x, y-clip.y);
        // Clip it and draw.
        g2.setClip(clip);
        g2.drawImage(image,0,0,this);
        // Reverse the changes to the graphics context.
        g2.setClip(origClip);
        g2.translate(clip.x-x, clip.y-y);
    public Dimension getPreferredSize() {
        return new Dimension(400,400);
    public static void main(String[] args) {
        ImageClipping test = new ImageClipping();
        JFrame f = new JFrame();
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.add(test);
        f.pack();
        f.setLocation(50,50);
        f.setVisible(true);
        test.start();
    private void start() {
        Thread thread = new Thread(runner);
        thread.setPriority(Thread.NORM_PRIORITY);
        thread.start();
    private Runnable runner = new Runnable() {
        Random seed = new Random();
        Dimension d = getPreferredSize();
        int xInc = d.width/COLS;
        int yInc = d.height/ROWS;
        public void run() {
            do {
                try {
                    Thread.sleep(3000);
                } catch(InterruptedException e) {
                    break;
                int row = seed.nextInt(ROWS);
                int col = seed.nextInt(COLS);
                int x = col*xInc;
                int y = row*yInc;
                int n = row*COLS + col+1;
                System.out.printf("row = %d  col = %d  n = %d%n",
                                   row, col, n);
                clip.setLocation(x,y);
                repaint();
            } while(isVisible());
}

Similar Messages

  • How to display two different parts of one image in two windows?

    hi everyone:) i need to display two different parts of one image in two windows. i have problem with displaying :/ because after creating windows there aren't any images :( i supose my initialization code of creating windows is incomplete, maybe i miss something or maybe there is some inconistency. graphics in java is not my strong position. complete code is below. can anybody help me?
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.*;
    import java.io.*;
    import javax.imageio.*;
    import javax.swing.*;
    import java.util.*;
    class ImgFrame extends JFrame
           private BufferedImage img;
           ImgFrame(BufferedImage B_Img, int x, int y, int w, int h)
                   super("d");
                   img=new BufferedImage(w,h,BufferedImage.TYPE_INT_RGB);
                   img=B_Img.getSubimage(x, y, w, h);
           }//end ImgFrame construction
           public void paint(Graphics g)
                   Graphics2D g2D = (Graphics2D)g;
                   g.drawImage(img, 8, 8, null);
           }//end paint method
           public Dimension getPrefferedSize()
                   if(img==null)
                           return(new Dimension(100,100));
                   else
                           return(new Dimension(img.getWidth(null),img.getHeight(null)));
           }//end of GetPrefferedSize method
    }//end ImgFrame class
    public class TestGraph2D_03 extends Component
           static BufferedImage IMG;
           public static void Load()
                   try
                           IMG=ImageIO.read(new File("c:/test.bmp"));
                   catch(IOException ioe)
                           System.out.println("an exception: "+ioe);
                   }//end try catch
           }//end TestGraph2D_03 construction
           public static void main(String[] args)
                   Load();
                   ImgFrame F1 = new ImgFrame(IMG, 0, 0, 8, 8);
                   ImgFrame F2 = new ImgFrame(IMG, 8, 8, 8, 8);
                   F1.addWindowListener(new WindowAdapter()
                           public void windowClosing(WindowEvent e)
                                   System.exit(0);
                   F1.pack();
                   F1.setVisible(true);
                   F2.addWindowListener(new WindowAdapter()
                           public void windowClosing(WindowEvent e)
                                   System.exit(0);
                   F2.pack();
                   F2.setVisible(true);
           }//end of main method in TestGraph2D_01 class
    }//end of TestGraph2D_03 class

    Never override the paint(...) method of a Swing component.
    If you have a sub image then add the image to a JLabel and add the label to the GUI. No need for custom painting.

  • How to display different icon, for different node of jtree

    Hi All,
    How to display different icon, for different node of jtree

    you haven't responded to my last post here: [http://forums.sun.com/thread.jspa?threadID=5323190&messageID=10382676#10382676|http://forums.sun.com/thread.jspa?threadID=5323190&messageID=10382676#10382676]

  • How to display different fonts in same indicator in labVIEW

    hi 
       i want to know how to display different fonts in same string indicator at run time in labVIEW 8.2
    Regards
    Abhishek Verma

    Hi ABHI VERMA,
    see this http://digital.ni.com/public.nsf/allkb/6BD344ACA4DEE20A8625692700737E16 
    Mike

  • How do i display different tooltip for different parts of an image

    I have a .jpg image that i would like to display different tooltips for depending in where the mouse pointer is in the image.
    Any help is appreciated.

    I edited the button template in the app.xaml so all my buttons have transparent properties for all the trigger properties and the setter properties since in this instance i have no other use for the button.
    <Application x:Class="Application"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    StartupUri="MainWindow.xaml">
    <Application.Resources>
    <Style TargetType="{x:Type Button}">
    <Setter Property="FocusVisualStyle">
    <Setter.Value>
    <Style>
    <Setter Property="Control.Template">
    <Setter.Value>
    <ControlTemplate>
    <Rectangle Margin="2" SnapsToDevicePixels="True" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2"/>
    </ControlTemplate>
    </Setter.Value>
    </Setter>
    </Style>
    </Setter.Value>
    </Setter>
    <Setter Property="Background" Value="Transparent"/>
    <Setter Property="BorderBrush" Value="Transparent"/>
    <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
    <Setter Property="BorderThickness" Value="1"/>
    <Setter Property="HorizontalContentAlignment" Value="Center"/>
    <Setter Property="VerticalContentAlignment" Value="Center"/>
    <Setter Property="Padding" Value="1"/>
    <Setter Property="Template">
    <Setter.Value>
    <ControlTemplate TargetType="{x:Type Button}">
    <Border x:Name="border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
    <ContentPresenter x:Name="contentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
    </Border>
    <ControlTemplate.Triggers>
    <Trigger Property="IsDefaulted" Value="True">
    <Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
    </Trigger>
    <Trigger Property="IsMouseOver" Value="True">
    <Setter Property="Background" TargetName="border" Value="Transparent"/>
    <Setter Property="BorderBrush" TargetName="border" Value="Transparent"/>
    </Trigger>
    <Trigger Property="IsPressed" Value="True">
    <Setter Property="Background" TargetName="border" Value="Transparent"/>
    <Setter Property="BorderBrush" TargetName="border" Value="Transparent"/>
    </Trigger>
    <Trigger Property="ToggleButton.IsChecked" Value="True">
    <Setter Property="Background" TargetName="border" Value="Transparent"/>
    <Setter Property="BorderBrush" TargetName="border" Value="Transparent"/>
    </Trigger>
    <Trigger Property="IsEnabled" Value="False">
    <Setter Property="Background" TargetName="border" Value="Transparent"/>
    <Setter Property="BorderBrush" TargetName="border" Value="Transparent"/>
    <Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="#FF838383"/>
    </Trigger>
    </ControlTemplate.Triggers>
    </ControlTemplate>
    </Setter.Value>
    </Setter>
    </Style>
    </Application.Resources>
    </Application>

  • How to display different Splash Screen depending on the Locale?

    Hi,
    I have a splash screen which is working fine.
    I want to display different spalsh screen depending on the locale the user has.
    Is this possible.
    I can display different Title,Description and the text of the short-cut icon on desktop and startup Menu based on the locale by mentioning it in the JNLP and altering my browser settings. I am not able to use the icon and splash screen corresponding to the specified locale. How to do this?
    EX:
    <information>
    <title> In english</title>
    <description> In english</description>
    <shortcut online="true">
    <!-- create desktop shortcut -->
    <desktop/>
    <menu submenu="My Project in English language"/>
    </shortcut>
    *<icon kind="shortcut" href="images/icon_english.gif"/>
    <icon kind="splash" href="images/splash_english.jpg"/>*
    <!-- locale="nl-NL" specifies dutch -->
    </information>
    <information locale="nl-NL">
    <title> In Dutch</title>
    <description>In Dutch</description>
    <shortcut online="true">
    <!-- create desktop shortcut -->
    <desktop/>
    <menu submenu="My Project in Dutch language"/>
    </shortcut>
    *<icon kind="shortcut" href="images/icon_dutch.gif"/>
    <icon kind="splash" href="images/splash_dutch.jpg"/>*
    </information>
    *Now here i am not getting the splash_dutch screen for the locale "nl-NL"(Dutch) and i am getting splash_english screen.
    Can we acheive this?*

    Hi anjali...
    I have problem with splash screen..
    here is my jnlp file
    <?xml version="1.0" encoding="UTF-8"?>
    <jnlp spec="1.0+" codebase="http://localhost:8080/MyProject">
         <information>
              <title>MyProject1.0</title>
              <vendor>none</vendor>
              <description>Application Launcher For MyProject1.0</description>
              <description kind="short"></description>
              <offline-allowed />
              <icon kind="splash" href="images/Splash_MyProject.jpg" width="560" height="300"/>
         </information>
         <resources>
              <jar href="SwingApplication/mysql-connector-java-5.0.6-bin.jar" />
              <jar href="SwingApplication/MyProject1.0.jar" main="true"/>
              <jar href="SwingApplication/liquidlnf.jar" />
              <j2se version="1.6+" java-vm-args="-Xms32M -Xmx256M " />
         </resources>
         <security>
              <all-permissions/>
         </security>
         <application-desc main-class="com.mobius.ui.MainWindow">
              <argument>production%0%3#com.mysql.jdbc.Driver#MyProject4%jdbc:mysql://10.100.1.89:3306/MyProject4%MyProject%info123#MyProject2%jdbc:mysql://10.100.1.89:3306/MyProject2%MyProject%info123</argument>
         </application-desc>
    </jnlp>my post is in
    http://forum.java.sun.com/thread.jspa?threadID=5298381
    http://forum.java.sun.com/thread.jspa?threadID=5298466
    I am in big problem Help me...
    Edited by: arunnprakash on May 22, 2008 1:28 PM
    Edited by: arunnprakash on May 22, 2008 1:28 PM

  • How to display different headings in list form using "hide content" in SPD 2010

    I built a custom list form in SPD, and applied conditional formatting in some rows
    Now I like to display different headings (above the 1st row of the form), based on the same condition:
    e.g. when Status=available, display the heading "SIGN OUT"  (as the item is available for sign-out)
    when Status=on-loan, display the heading "SIGN IN" (as the item can be signed in)
    right now I put the two different heading in two lines in the heading space: 
    SIGN OUT
    SIGN IN
    I tried following and it works for this part:
    select the text SIGN IN
    select "create' in "Conditional formatting" pane
    select Hide Content
    Set: Status=available
    click OK
    Then the "SIGN IN" text disappeard.
    But how can I set another conditional formatting to show only "SIGN IN" when Status=on loan?

    Hi,
    If you like to show "sign out" when status=available and show "sign in" when status=on-loan.
    Please try modify the Conditional Formating rule as below:
    Select the text SIGN IN, show content, status not equals available
    Select the text SIGN OUT, show content, status not equals on-loan
    Regards,
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected] .
    Rebecca Tu
    TechNet Community Support

  • How to display different icon within WDA alv table base on row data ?

    Hi,
    is that possible to display different icon for every row within ALV table depending on the row data ?
    for instance if the status 'S' display ~Icon/SuccessMessage and 'E' display ~Icon/ErrorMessage ?
    because base on this code below i only can set 1 icon for the whole row data.
    LOOP AT lt_columns ASSIGNING <fs_column>.
        CASE <fs_column>-id.
          WHEN 'ICO'.
            CREATE OBJECT lr_caption.
               lr_caption->set_image_source( value = '~Icon/SuccessMessage').
               <fs_column>-r_column->set_cell_editor( lr_caption ).
        ENDCASE.
      ENDLOOP.
    Thank you in advance.
    Fernand

    Hello,
    Yes it is possible to display different images based on data.
    For that what you can do is create one attribute 'STATUS' of type string in context node which you are mapping to ALV.
    And fill that attribute with the path to image based on your requirement like for status 'S' set the attribute to ~Icon/SuccessMessage and if status is 'E', set it to ~Icon/ErrorMessage at runtime.
    Now in the settings for ALV use the following code:
    * Display icon in column seatsocc
      DATA: lr_column TYPE REF TO cl_salv_wd_column,
            lr_image TYPE REF TO cl_salv_wd_uie_image,
            lv_icon TYPE string.
      lr_column = lv_model->if_salv_wd_column_settings~get_column( 'SEATSOCC' ).
      CREATE OBJECT lr_image.
      lr_image->SET_SOURCE_FIELDNAME( 'STATUS' ).
      lr_column->set_cell_editor( lr_image ).
    in the above code, column 'SEATSOCC' will be displayed as an icon.
    Sample code to fill the attribute 'STATUS'
    LOOP AT lt_flights INTO ls_flight.
        lv_seatsfree = ls_flight-seatsmax - ls_flight-seatsocc.
        IF lv_seatsfree = 0.
          ls_flight-status = 'ICON_RED_LIGHT'.
        ELSEIF lv_seatsfree <= 50.
          ls_flight-status = 'ICON_YELLOW_LIGHT'.
        ELSE.
          ls_flight-status = 'ICON_GREEN_LIGHT'.
        ENDIF.
        MODIFY lt_flights FROM ls_flight.
      ENDLOOP.
    Hope this helps!
    Regards,
    Srilatha
    Edited by: Srilatha M on Jun 25, 2010 12:02 PM

  • How to select different parts of the text? cmd button no longer does that...

    After installing Maverics i can no longer propertly edit my work as I cannot mark different parts of text using cmd button. Shift works as before for highlighting all the text from starting point to selected point but I can no longer use cmd to highlight different areas of the text. Is this an OS bug? Or was the button for selecting different parts of the text changed? I tried everything...

    It's just a small part of what makes Pages 5 so "stunning" (Apple's word). You think stripping out the nifty ability to mark non-contiguous passages of text was neat? Sure that was nice. But Apple has gotten rid of more, so much more. And for free!
    Just wait till you put the product through its paces and you discover other nice features that are missing, such as (but not limited to):
    - no linking of text boxes!  Yes, that's right. Now a newsletter that had a "continued on page 6" or whatever will be broken by Pages 5. Stunning! (Even more stunning, Pages 5 will strip out all sorts of formatting from documents created with Pages 4.3 and it will do ao without warning and will save the document in a NEW unified file format so that it cannot be opened by Pages 4.3, thereby potentially losing users hours and hours of work. Stunning!
    There's more!
    - Pages 5 has no mail merge, no bookmarks, no images in headers/footers! Pages 4.3 has those features, but this stunning new release removes them.
    - Pages 5 features vastly reduced and simplified set of templates (there used to be about 130 Apple-cupplied templates, now there are about 60).
    - Page 5 also boasts NO RTF SUPPORT, so a paper your wrote with Apple's own TextEdit is not natively readable with Pages: Stunning!
    - No detail was too small to omit in this stunning new release: the vertical ruler, so you can easily place text or an obejct at a certain place in a document: gone! Setting the default zoom: gone!  Status bar reproting word count and pagecount (e.g., Page 4 of 48): Gone! View comments in the left side bar: Gone!  Autocapitalization: Gone! Search & Replace: drastically simplified!
    But here's the really good news: Pages 5 is just PERFECT for creating a one page-poster advertising a new concert by Apple employee Eddie Cue. What's more you can collaborate on it with someone else, even if they're using a PC. Now that's "stunning"!

  • How to display non-URL-based thumbnail images in JTable

    I'm trying to display thumbnail images as a tooltip popup for certain cells in a JTable. The thumbnail images are java image objects that have been retrieved dynamically as the result of a separate process--there is no associated URL. For this reason, I can't use the setToolTipText() method of the JTable.
    My attempts to JTable's createToolTip() method also failed as it seems the ToolTipManager never calls this method for a JTable.
    As a workaround, I've added a MouseMotionListener to the JTable that detects when the mouse is over the desired table cells. However, I'm not sure how to display the popup over the JTable. The only component that I can get to display over the JTable is a JPopupMenu, but I don't want to display a menu--just the image. Can anyone suggest a way to display a small popup image over the table?
    Thanks.

    Thank You Rodney. This explains why my createToolTip() method wasn't being called, but unfortunately I'm no closer to my goal of displaying a true custom tooltip using a non-URL image rather than a text string. If I make a call to setToolTipText(), at any point, the text argument becomes the tooltip and everything I have tried in createToolTip() has no effect. However, as you pointed out, if I don't call setToolTipText(), the table is not registered with the tooltip manager and createToolTip() is never even called.
    To help clarify, I have attached an SSCCE below. Please note that I use a URL image only for testing. In my actual application, the images are available only as Java objects--there are no URLs.
    import javax.swing.*;
    import java.awt.*;
    import java.net.URL;
    import java.net.MalformedURLException;
    public class Test {
        static Object[][] data = {
                {"Cell 0,0", "Cell 0,1"},
                {"Cell 1,0", "Cell 1,1"}};
        static String[] columnNames = {"Column 0", "Column 1"};
        static JFrame frame;
        static String testImageURLName = "http://l.yimg.com/k/omg/us/img/7c/0a/4009_4182164952.jpg";
        static JTable testTable = new JTable(data, columnNames) {
            public JToolTip createToolTip() {
                System.out.println("testTable.createToolTip() called");
                Image testImage = getTestImage();
                // this.setToolTipText("Table ToolTip Text");
                JLabel customTipLabel = new JLabel(new ImageIcon(testImage));
                customTipLabel.setToolTipText("Custom ToolTip Text");
                JToolTip parentTip = super.createToolTip();
                parentTip.setComponent(customTipLabel);
                return parentTip;
        // This image is loaded from a URL only for test purposes!!!
        // Ordinarily, the image object would come from the application
        // and no URL would be available.
        public static Image getTestImage() {
            try {
                URL iconURL = new URL(testImageURLName);
                ImageIcon icon = new ImageIcon(iconURL);
                return icon.getImage();
            catch (MalformedURLException ex) {
                JOptionPane.showMessageDialog(frame,
                        "Set variable \"testImageName\" to a valid file name");
                System.exit(1);
            return null;
        public static void main(String[] args) throws Exception {
            frame = new JFrame("Test Table");
            frame.setSize(300, 100);
            // Set tool tip text so that table is registered w/ tool tip manager
            testTable.setToolTipText("main tooltip");
            frame.getContentPane().add(testTable);
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setVisible(true);
    }

  • How to display different Time Statement forms in ITS service PZ04

    Hi all,
    I am working on a underlyinge R/3 4.7 system and are working with standalone ITS and ESS 50.4. I am posting this question to find out if any of you has experience with my problem.
    The business wishes to use the ITS transation PZ04 standard and wish to be able to display different Time Statement forms in the transaction through customized variants for the report(RPTEDT00) that the PZ04 transaction executes. In the IMG it is posted that one variant has to be created called HRESS_TEDT00 and this works, but restricts the PZ04 transaction to always be called with this variant and therebye the same Time Statement form every time.
    I then by debugging found that the underlying ABAP code processed from SAP standard has a variable VARIANT that is hardcode to = HRESS_TEDT00.
    The question is: Is there anyway to setup the PZ04 transaction so that it can be dynamic decided which variant should be used, f.ex. from persons subarea from infotype 0001?
    Looking forward to here if anybody can help.
    Regards,
    Allan Brauer

    hi allan,
    cud u plz help me how to sort out this problem actually in mu company the same scenario is here need to be display pe51 form instead of standard hrforms.....
    plz help me how will i replace this "hrforms with pe51"..

  • How to Show Different set of  Blob images in every page

    Hi i am using Crystal Report Server XI RAS Embedded Edition to built Dynamic Reports.
    Now i  have two datasets
    1. Main query with imageid field
    2. list of image blobs.
    this two datasets are linked with imageid  field and binded to ReportClientDocument.
    i have to show different image fields in every page of the report.  this images are differ in width and heights.
    i am able to show a single constant image field object from blob database field.
    but i could not able to find the solution to show different set of multiple images in different pages of the report.
    is there any formulas can be written or kindy give me a solution to achieve this.
    Regards,
    Padmanaban V
    Edited by: Padmanaban Viswanathan on Mar 15, 2010 11:59 AM

    See RAS samples [here|https://wiki.sdn.sap.com/wiki/display/BOBJ/NETRASSDK+Samples]. Look for "NET-CS2003_RAS-Managed_BE115_Add_Image" or "NET-VB2003_RAS-Managed_BE115_Add_Image-From-File".
    Ludek

  • How to display a horizontal list of images

    Hello everyone,
    I am new to Flash Builder 4 and I am looking to display a horizontal list of images on my Flex Mobile Project (using Burrito Flash Builder). Can anyone recommend me what component that I should use?
    I know the <s:List /> will display a Vertical list of items, but I am not sure what component to display a horizontal list of items.
    Thanks in advance for any help,

    Have you tried using HorizontalList?
    Here is an example:
    http://flex4fun.com/2010/11/30/flex4-horizontallist-example/

  • How to clone one part of an image into another

    Is it possible in Aperture to clone one part of an image into another or as in windows fuse the photos together?
    Thanks

    This points directly to the difference between a digital image conversion and development program, and a graphics program.
    Development programs' tools adjust the color and luminance information in each pixel.  They do not (mostly) add any information to the pixels or to the image.
    Graphics programs are built around adding information to images (or blank canvases).  Rectangles, circles, text, other images -- these are all graphics elements which are combined to make a new image.
    Aperture is the former (and also a superb digital asset manager).
    The generalized workflow is this:
    Capture information using a digital camera
    Optimize that information (make the picture as good as possible) using an image development program
    Combine pictures and graphics elements to make new graphics using a graphics program
    There are many excellent graphics programs.  Photoshop is the best known and most used.

  • How to display a blob as an image

    I am working on an application which stores images in a database as blobs. I need to extract these images and display them from a web page. How do I go about this using JSP or JSF?
    Werner

    Thanks for the quick response, matlas. I should have included more info in my original post. I am familiar with reading/writing blobs from the database. The part I am stuck on is how does the java servlet return the blob (dPhoto below), to the web page?
    i.e. from <img src="employeePhoto.jsp&empId=123">
    ImageIcon dPhoto = null;
    // open connection
    Connection photoConnection = startup.openSQLConnection(SQLDriver, SQLConnectionString);
    // setup select string
    String sqlStatement = "select Binary_Photo from employeephoto where Employee_ID = '"+employeeID+"'";
    try {
    // perform select
    ResultSet rs = photoConnection.createStatement().executeQuery(sqlStatement);
    // if record found process blob
    if (rs.next()) {
    // get blob
    Blob image = rs.getBlob("Binary_Photo");
    // setup the streams to process blob
    InputStream input = image.getBinaryStream();
    ByteArrayOutputStream output = new ByteArrayOutputStream();
    // set read buffer size
    byte[] rb = new byte[1024];
    int ch = 0;
    // process blob
    while ((ch=input.read(rb)) != -1) {
    output.write(rb, 0, ch);
    // transfer to byte buffer
    byte[] b = output.toByteArray();
    input.close();
    output.close();
    // load final buffer to image icon
    dPhoto = new ImageIcon(b);
    catch (Exception exc) {/ do your exception processing}
    // close connection
    startup.closeSQLConnection(photoConnection);
    // dPhoto holds image or is null at this point.

Maybe you are looking for

  • Media player hotkeys doesn't work with Windows Media Player 11

    Hi; I upgraded my windows media player 10 to 11 version. Now my hotkeys doesn't work. I was wondering if there is a way to solve this problem.

  • Monitor settings incorrect and can't get to system prefs to change them

    Hi, I was experimenting with screen resolution settings and somehow came up with one that doesn't allow me to get to any finder controls or to the apple icon. So I can't use my computer. Help!

  • Windows Server - Oracle 9i and Linux Client ?

    Hi all, Is it possible to have Oracle Database working on Windows 2000 Server and its client i.e. forms/application running on Linux environment. If so, then will my Developer6i work for installation of client in Linux. And if it works, then how can

  • Nonscrolling background not working

    I'm trying to update an old help project which used D2HTOOLS.DLL to set the non-scrolling section of the main page to have a particular background (watermark). Most pages work just fine, but one or two will not show the watermark. I can see no differ

  • Circular reference on VPD

    Hi All, I have implemented a VPD and added policies to Table_A and Table_B. The policy function of Table_A returns a predicate like this: EXISTS (SELECT 1 FROM TABLE_B WHERE TABLE_B.COLUMN_1 = TABLE_A.COLUMN_1) And the policy function of Table_B retu