Looping problems for images

Hi to all,
I have a range of pictures (30 pic). I want to do something like, after 5 images in a first row, the nxt 5 images will appear second row. However, I keep on having all the images in the first row, and yet no images in the second row. Codes are provided below!
Could anyone please advise me on this?
Any help will be appreciated! Thank You!
Codes provided
Graphics2D g2 = (Graphics2D)g;
     int w = getWidth();
     int h = getHeight();
     int imageWidth, imageHeight;
     int totalHeight = 84;
     int totalWidth = 600;
     int x = 0;
     int y = 0;
     float alphaVal;
     AlphaComposite ac;
          for(int j = 0; j < images.length; j++)
               imageWidth = images[j].getWidth();
               imageHeight = images[j].getHeight();
               //x and y axis
            /*To be able to display all the small images accordingly, need translate (x,y).
                    *Use for loop.*/
                    AffineTransform aTran = new AffineTransform();
                    aTran.translate(0.5f, 0.5f);
                    g2.transform(aTran);
               x = x + 122;
               if(j == 0)
                    alphaVal = alpha;
               else
                    alphaVal = 1.0f - alpha;
               ac = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, alphaVal);
               g2.setComposite(ac);
               g2.drawImage(images[j], x, y, this);
          }

Hi
I have try putting it on the for loop, as well as
while loop. However, it's not working the way as I
desired. The result is either 5 in a rows, and no
second row. Another is 5 row, but no 5 columns of
images.
DId i put the wrong place? Could you kindly advise
me?
Thank YouBasically it needs to be like this (untested, of course - you fiddle with it):
int x = 0, y = (some initial value, I don't know what it would be);
for(int j = 0; j < images.length; j++)
  if ((j % 5) == 0)
    // reset x for next row (indeed, even for first row) to be at the
    // first column of this row
    x = 0;
    // increment y to go to the next row
    y += (I don't know how much you need to increment y for your row);
  x += 122; // same as x = x + 122
  g2.drawImage(images[j], x, y, this);
}

Similar Messages

  • Transparency problem for images

    I have created a table for the main body of my site. In this
    main body table I would like to have images that stick out slightly
    over the sides of the table into the border areas on each side.
    These images I’ve made in photoshop all have pink as the
    background color because the main table body has the same color
    background. The problem is that the borders either side of the main
    body table are white and those images are going to look funny
    because of the pink background I have applied to them. I know gif
    transparency is an option but the image quality is poor and the
    shadow effect I applied in photoshop is lost when I convert them to
    gif. Is there any way around this ?

    here is a wonderful tutorial explaining the use of CSS for
    transparent
    overlays
    http://www.mandarindesign.com/opacity.html
    Good Luck
    Jeff
    "bobsmith1" <[email protected]> wrote in
    message
    news:f2shcp$6fu$[email protected]..
    >I have created a table for the main body of my site. In
    this main body
    >table I
    > would like to have images that stick out slightly over
    the sides of the
    > table
    > into the border areas on each side. These images I?ve
    made in photoshop
    > all
    > have pink as the background color because the main table
    body has the same
    > color background. The problem is that the borders either
    side of the main
    > body
    > table are white and those images are going to look funny
    because of the
    > pink
    > background I have applied to them. I know gif
    transparency is an option
    > but the
    > image quality is poor and the shadow effect I applied in
    photoshop is lost
    > when
    > I convert them to gif. Is there any way around this ?
    >

  • Access Problem for images

    Sir
    i make a jar file which contain all the images and properties files.befor jar i a pass the path
    like that
    JButton button=new JButton(new ImageIcon("images\abc.gif"));
    now how can i access the abc.gif from the jar file.
    plz give me a line of example
    thanks and regard

    Oops!... sorry too quick on keyboard!
    Try this way (supposing your .JAR file contains a folder called 'images' containing the file 'abc.gif':
       URL url = new Object().getClass().getResource("/images/abc.gif");
       ImageIcon icon = new ImageIcon(url);Hope this helped,
    Regards.

  • Hi, I have small problem, for some time in music area I had two folders to use 1. Apple loops for soundtrack pro 2. Final Cut pro sound effects now both are gray and with out content may I know what happend

    Hi, I have small problem, for some time in music area I had two folders to use 1. Apple loops for soundtrack pro 2. Final Cut pro sound effects now both are gray and with out content may I know what happend

    I just went through this and it appears that my Focusrite Saffire was the culprit. I connected all the outputs on the focusrite according to the way the jacsk on the back were labeled and then set up the multichannel speaker setup to match. Then I went into STP, created a pink noise clip and panned it around, the LFE, center and rears were not in the right place.
    I reconnected the hardware to match the 5.1 pan pot in STP then changed the multichannel speaker setup to match. Everything appears to be correct now but I would have loved to have been able to just assigned the output busses to correct outputs in the saffire.
    Next step is to pan that pink noise around with my SPL meter to calibrate the room.

  • Search for images using Keywords Problem.

    1) In LR4, Search for images using Keywords (click on arrow next to Keyword).
    2) Select image, export to PS6, save as Tif.
    3) Tif retains all Keywords when it appears in LR
    4) Despite that, image does not show up in the same 'Search for images using Keywords'.
    Can anyone help with this, it is frustrating me!

    V. 4.1
    Thanks, I will try, but it seems to be an inconsistent problem.
    Simon Fletcher
    Simon Fletcher Photography
    Woody's Nest
    Newton of Kinkell
    by Conon Bridge
    Ross-shire
    Scotland
    UK  IV7 8AS
    Tel: 01 349 864 830
    Web: www.simonfletcherphotography.co.uk
    Work:
    The Glass Scribe
    Tel: 01 349 867 088
    Email: [email protected]
    Web: www.glassscribe.com

  • I have just reinstalled Adobe Acrobat X1 and I can't save any PDF's that are emailed to me. I just get "This document could not be saves. There is a problem reading this document (21)" and then when I click OK i get "insufficient data for image"  Help!

    I have just reinstalled Adobe Acrobat X1 and I can't save any PDF's that are emailed to me. I just get "This document could not be saves. There is a problem reading this document (21)" and then when I click OK i get "insufficient data for image"  Help!

    More information about this issue can be found here:
    https://forums.adobe.com/thread/1672655
    A "quick" fix that worked for me was to uninstall Adobe... then download the base install for Adobe Reader 11.0.
    Then download each of the individual updates and run them sequentially. 
    I've installed back up to the last security update which is version 08 and have been able to do normal Save As operations.
    You will have to disable automatic updates in order to stay at version 08 until Adobe resolves this issue in a later release.
    http://www.adobe.com/support/downloads/product.jsp?product=10&platform=Windows
    Adobe Reader 11.0 - Multilingual (MUI) installer    AdbeRdr11000_mui_Std
    Adobe Reader 11.0.01 update - Multilingual (MUI) installer    AdbeRdrUpd11001_MUI.msp
    Adobe Reader 11.0.02 update - All languages    AdbeRdrSecUpd11002.msp
    Adobe Reader 11.0.03 update - Multilingual (MUI) installer    AdbeRdrUpd11003_MUI.msp
    Adobe Reader 11.0.04 update - Multilingual (MUI) installer    AdbeRdrUpd11004_MUI.msp
    Adobe Reader 11.0.05 security update - All languages    AdbeRdrSecUpd11005.msp
    Adobe Reader 11.0.06 update - Multilingual (MUI) installer    AdbeRdrUpd11006_MUI.msp
    Adobe Reader 11.0.07 update - Multilingual (MUI) installer    AdbeRdrUpd11007_MUI.msp
    Adobe Reader 11.0.08 security update - All languages    AdbeRdrSecUpd11008.msp

  • I have a HP workforce 610 and cannot scan.  I just spoke with HP and they told me it is a software problem with my MAC for image capture.  Anyone else having difficulty?

    I have a HP workforce 610 and cannot scan.  I just spoke with HP and they told me it is a software problem with my MAC for image capture.  Anyone else having difficulty?

    If Image Capture doesn't work you could try the paid for app VueScan ( www.hamrick.com ). You can try it for free in demo mode to see if it works before purchase.

  • Problems for retrieving image attributes

    Hi,
    I am a new user for Oracle interMedia and i have following problem.
    I have wroten ein java programm to retrieve the image properties. At First, the images (jpg, tif) are stored as BLOB in the table, then i use the function setProperties() to set the image attributes.
    PreparedStatement pstmt = con.prepareStatement("INSERT INTO btable VALUES(?, ORDSYS.ORDImage.init())");
    for (int ef=1; ef<=anzahl_summe; ef++){
    pstmt.setInt(1, ef);
    pstmt.execute();
    OracleResultSet rs = (OracleResultSet)stmt.executeQuery("SELECT * FROM btable WHERE bid = " + ef + " FOR UPDATE");
    while(rs.next()) {
    OrdImage imgObj = (OrdImage)rs.getCustomDatum(2, OrdImage.getFactory());
    imgObj.loadDataFromFile(f_location[ef]);
    imgObj.setProperties();
    OraclePreparedStatement orpstmt = (OraclePreparedStatement)con.prepareStatement("UPDATE btable SET bild = ? WHERE bid =" + ef);
    orpstmt.setCustomDatum(1,imgObj);
    orpstmt.execute();
    orpstmt.close();
    Now if i use the functions getHeight(), getFormat(), ... for querying the properties, i will get just only the values for the image height, width and size. The other attribute values i get either null or ???. I don't understand why. The Bildforamte(jpg, tif)are supported by Oracle.
    Can you tell me what shall i do?
    thank you very much and greeting from germany
    rabbit

    Hi larry,
    thank you for your help. I have set autocommit off and commit in the end of the programm. I think, that is not a problem.
    I use the following table:
    CREATE TABLE bildtable_intern(bild_id int PRIMARY KEY not null, bild ORDSYS.ORDImage)
    My java programm:
    public class OracleBild_intern {
    public Connection connect() throws Exception{
    //thin driver is used
    conn.setAutoCommit(false);
    public void bildmessung(Connection con) throws Exception{
    PreparedStatement pstmt = con.prepareStatement("INSERT INTO bildtable_intern VALUES(?, ORDSYS.ORDImage.init())");
    for (int ef=1; ef<=10; ef++){
    pstmt.setInt(1, ef);
    pstmt.execute();
    OracleResultSet rs = (OracleResultSet)stmt.executeQuery("SELECT * FROM bildtable_intern WHERE bild_id = " + ef + " FOR UPDATE");
    while(rs.next()) {
    OrdImage imgObj = (OrdImage)rs.getCustomDatum(2, OrdImage.getFactory());
    //I have also tried to use loadDataFromInputStream() and loadDataFromByteArray()
    imgObj.loadDataFromFile(f_location[ef]);
    imgObj.setProperties();
    OraclePreparedStatement orpstmt = (OraclePreparedStatement)con.prepareStatement("UPDATE bildtable_intern SET bild = ? WHERE bild_id =" + ef);
    orpstmt.setCustomDatum(1,imgObj);
    orpstmt.execute();
    orpstmt.close();
    pstmt.close();
    retrieveattr(con);
    public long retrieveattr(Connection con) throws Exception{
    OracleResultSet rs = (OracleResultSet)stmt.executeQuery("SELECT * FROM bildtable_intern");
    while (rs.next()){
    OrdImage imgObj = (OrdImage)rs.getCustomDatum(2, OrdImage.getFactory());
    System.out.println("bild_id = " + rs.getInt(1));     
    System.out.println("bild_height = " + imgObj.getHeight());
    System.out.println("bild_width = " + imgObj.getWidth());
    System.out.println("bild_size = " + imgObj.getContentLength());
    System.out.println("bild_format = " + imgObj.getFormat());
    System.out.println("contentformat = " + imgObj.getContentFormat());
    System.out.println("compressionformat = " + imgObj.getCompressionFormat());
    System.out.println("mimetyp = " + imgObj.getMimeType());
    public static void main(String[] args) throws Exception{
    //call the methode connect()
    con.commit();
    con.close();
    I try again, but i get always only the values for image height, width and contentlength. Can you tell me, what ist wrong with this programm?
    Thank you very much and greeting aus germany!
    rabbit

  • Problem with "Insufficient data for image" and embedded JPEG 2000 Images

    I frequently download pdf from the http://www.glorecords.blm.gov web site.  They are reporting a problem with Reader Reader 10.1.4 and the pdf files they have.
    "("Insufficient data for image" and embedded JPEG 2000 Images)"
    I am experiencing the same "Insufficient data for image" error when opening their downloaded pdf and viewing in ACROBAT X 10.1.4.
    Can someone address this please?
    Win 7 sp1

    Read this:
    http://blogs.adobe.com/dmcmahon/2012/08/21/acrobat-insufficient-data-for-an-image-error-af ter-updating-to-10-1-4-or-9-5-2/

  • When trying to install Epson R200 driver/utility combo, the installer gets stuck in an endless loop asking for admin password without installing. Any idea how to fix this problem?

    When trying to install Epson R200 driver/utility combo, the installer gets stuck in an endless loop asking for admin password without installing. Any idea how to fix this problem?

    Have you checked on the Epson support site? R200 support is located here.

  • Problems with Image Capture for Epson Scanner

    When using image capture for my Epson scanner, at the Image Correction, when I select Manual I get no menu options.

    There is no Epson scanner utility for Mountain Lion, it appears. Even Epson's FAQ defers to Image Capture and says it only provides software for image modification.
    http://www.epson.com/cgi-bin/Store/support/supDetail.jsp?BV_UseBVCookie=yes&info Type=FAQ&oid=207953&foid=214278&cat=214269&subcat=214264
    Unfortunately Image Capture completely fails to provide the service it should be expected to. The 3rd party software VueScan seems like it would be adequate once I learned how to manipulate it a little more, but ultimately the only decision I can justify is to hook up the scanner to my Windows PC and use the TWAIN-based scan utility there.
    If there's anywhere I can make an official plea to Apple to get Image Capture in a workable state, feel free to point the way.

  • RX3870 infinite loop problem

    Hi all
    A week ago i bought the RX3870-T2D512E-OC and now i have problems with it, sometimes while playing games i get a BSOD saying that the ati driver got in a infinite loop, sometimes the image just freezes and i have to restart the PC, and sometimes the VPUrecovery restarts the driver. I have tried different versions of the catalyst driver, reinstalled windows but the results are the same.
    Does anyone have an idea what the problem could be?

    Quote from: Frankenputer on 23-April-08, 11:51:41
    boon25,
    Which Chieftec PSU is that? What specific model?
    It's the GPS-550AB A, here is the chieftec page http://www.chieftec.com/smart-power.html
    I dont think that something's wrong with the PSU because sometimes i can play games for hours without any crashes, they occur randomly

  • Relative paths for images upset by forwarding requests

    Hello World.
              I am using a web app deployed in Weblogic 5.1 with service pack 8.
              I have hit a problem which puzzles me. When I forward a request from
              one JSP to another (say from A to B) the web server seems to take the
              URLs of the images on the served file (B) relative to the path on the
              calling file (A). Here's a detailed explanation...
              Suppose I have a the web app structured as follow
              /oddApp/launch/A.jsp
              /oddApp/B.jsp
              /oddApp/images/tick.gif
              Page A simply stores its request URI and forwards its request to page B
              <jsp:forward page="/B.jsp" />
              Page B displays its requestURI, contextPath and servletPath. It also
              attempts
              to show three images
              <img src="images/tick.gif">
              <img src="../images/tick.gif">
              <img src="/images/tick.gif">
              When I invoke page B directly, the first image is shown, the others are not.
              When I invoke page A, it forwards to B and the second image is shown, the
              others are not.
              In each case the URI, contextPath and servletPath are correctly displayed
              with regard to page B.
              URI = [oddApp/B.jsp]
              contextPath = [oddApp]
              servletPath = [B.jsp]
              The URI in A.jsp is also correct (i.e. /oddApp/launch/A.jsp).
              The search for the images seems to be relative to the original URI (i.e. not
              the URI used to forward), which strikes me as daft. It means that page B
              must be aware of where it is being called from. It is perfectly plausible
              that
              relative paths which suit when called from one location are incorrect when
              called from another.
              I had thought that including the leadling slash (as shown as the third
              image)
              would cause the search relative to the document root (/oddApp/), but this
              appears not to be the case. The search is done relative to the root of the
              server not the web app.
              Adding jsp mappings in the deployment descriptor of the web app does not
              help (I had thought it a long shot anyway).
              Does anyone have any thoughts on this?
              PHiL
              

    i face the same problem (WinNT, WLS6.0): my wep app has a contextRoot " root " which makes it react to the URL: http://host:port/root /: it is this folder which will be used as a basis by the Web server But in the jps I use a relative URL for images: / images/toto.gif : it works very well when I deploy my jsp out of a Web-app by setting a document.root to the weblogic web server.On the other hand, once deployed in a Web-app, images are not found because the default path of the browser is http://host:port, without the context root of the Web-app! In other words, my war has images/*.gif in its root but when /images/toto.gif is resolved in a jsp, as the relative URL is not prefixed by my context-root, the image is not search in the war! actually, if I type http://host:port/root/toto.gif, my image appearsany clues? an alias on the web server? a setting in web.xml/application.xml and their weblogic equivalent files?
              

  • Problem with images in XML with excel output

    Hello:
    I made an XML concurrent program, with excel output, but i am having a problem:
    The rtf template has a logo (bmp image), but it is not showing in the excel (if i execute the concurrent in the oracle applications). However, if i create the xml in Oracle Reports in my computer, and then load that xml in the rdf template in word, i can see the logo in the excel preview. I don't know why is it not showing when i execute the program in applications.
    If someone can help me with this, i will be very grateful.
    Greetings
    Message was edited by:
    user632438

    xml cP, will not give you a image in excel output,..
    In RDF there is a placeholder for image, and the image is located in certain location, at runtime it picks and render the output with logo.
    but xml CP, will get the data in xml type and merge with rtf to get the output you wanted..
    if you have the rtf with logo embedded in it, if output is of pdf or rtf output , then it will display the logo ,.
    in excel currently it is not possible to show the logo,..
    excel you see could be xml-excel or csv-excel not the true binary excel.
    to get the logo embedded ,for that you have to wait on tim for the excel template, which will be release in near future i guess..

  • Change transaction using BDC-problem for large number of lines on screen

    Hi All,
    I am developing BAPI (using BDC) which creates quality notification in SAP which is entered via front end web application. Structure p_qmsm contain 3 lines of task in notification. The code is as given below. To avoid problem of large no of lines on screen,code lines starting with * is used. This actually for pagedown after entering every 2 lines and creates new line. so that 2 lines always push up on screen and there will not be problem for creating large no of lines on screen
    perform bdc_dynpro using 'SAPLIQS0' '7200'.
    perform bdc_field using 'BDC_OKCODE' '=10\TAB11'.
    LOOP AT p_qmsm INTO wa_qmsm.
    *IF wa_qmsm_cntr > 2.
           wa_qmsm_cntr = 2.
           perform bdc_dynpro  using 'SAPLIQS0'                   '7204'.
           perform bdc_field   using 'BDC_OKCODE'                 '=PEND'.
    ENDIF.
    perform bdc_dynpro using 'SAPLIQS0' '7204'.
    perform bdc_field using 'BDC_OKCODE' '/00'.
    CONCATENATE 'VIQMSM-QSMNUM(' wa_qmsm_cntr ')' INTO wm_qmsm_qsmnum.
    CONCATENATE 'VIQMSM-MNGRP(' wa_qmsm_cntr ')' INTO wm_qmsm_mngrp.
    CONCATENATE 'VIQMSM-MNCOD(' wa_qmsm_cntr ')' INTO wm_qmsm_mncod.
    CONCATENATE 'VIQMSM-MATXT(' wa_qmsm_cntr ')' INTO wm_qmsm_matxt.
    perform bdc_field using wm_qmsm_qsmnum wa_qmsm-qsmnum.
    perform bdc_field using wm_qmsm_mngrp wa_qmsm-mngrp.
    perform bdc_field using wm_qmsm_mncod wa_qmsm-mncod.
    perform bdc_field using wm_qmsm_matxt wa_qmsm-matxt.
    wa_qmsm_cntr = wa_qmsm_cntr + 01.
    ENDLOOP.
    CALL TRANSACTION 'IQS2' USING wt_bdc
    MODE 'N' UPDATE 'A'  MESSAGES INTO P_MESSTAB.
    The same code is used in modify mode also. web application is sending all 3 lines in modify mode even if single line is modified. It is already decided to send all rows back from web application to SAP in same sequence. It is working fine if i comment 5 lines which is starting with *. But in modify mode, how can i ensure that correct row is modified? and how can i achieve problem of large no of lines on screen?Please suggest?

    Hi yogesh,
    how can i ensure that correct row is modified?
    1. For this we need to know two things ;
       a) the database table in which the entries are already stored
       b) the sequence in which they are displayed in the transaction.
    2. So before changing any line, we need to compare (the primary key values / important values)
       a) as per the database table and as per the incoming data from web application (using bapi)
      b) if the match is ok, it means that particular row was not modified, else modified.
    how can i achieve problem of large no of lines on screen?
    1. For this I am  not sure about the transaction and its screen. Manytimes for appending row on the screen,
      there is a PLUS + button on the grid toolbar. So for every entry, (inspite of some empty/filled rows already visible on the screen), we should use the + button, and this new row always appears on the top i.e. row number 1.
    hope this helps.
    regards,
    amit m.

Maybe you are looking for

  • Black window for Show Photo Settings

    Using iMovie 6.3. I have edited several photos and put them in place for iMovie. but without Ken Burns effect. When I want add editing, ie. Ken Burns effect, I get a black window which makes editing impossible. This only happens with photos previousl

  • Adding subpartitions to existing partition

    Can anyone provide me the script to Add subpartitions to existing partition. Thanks.

  • Nothing happens on clicking 'Organizer' tab in welcome screen.

    Nothing happens on clicking 'Organizer' tab in welcome screen. Photoshop elements 13

  • HT4913 How do I fix an error 4010

    I get an error 4010 when I try to do iTunes Match.   This happened after I upgraded to the most recent iOS How do I resolve the error?

  • Ipod to PC after HD failure

    How do I get every song that is on my iPod Touch 2nd Gen back into my iTunes on my new hard drive? I saw some of the options for backing up my songs...unfortunately...that's after my HD crashed. Now I have a new HD and all I see are programs you have