I want to display a 2d image in a buffer then onto screen

Hi!
I was wondering does anyone know how to draw an image first into a buffer
and then when desirable onto the screen.
so for example in class A there is a method:
void setContrast(float contrast)
contrast = contrast;
repaint;
}and then in class B i want to paint first into a buffer for a given contrast and then onto the screen when i want.
any ideas?

the problem is, my paint method has to be as follows:
and it is in a class called class A.
//in class A
public void paint(Graphics g)
super.paint(g);
Graphics2D g2D = (Graphics2D) g;
for(j=0; j<size; j=j+2)
  for(k = 0; k<size; k=k+2)
   g2D.setPaint(new Color(contrast, contrast, contrast));
   Rectangle2D r2 = new Rectangle2D.Float(j, k, 2, 2)
   g2D.fill(r2)
}the contrast is set through class B calling setContrast(float contrast) which is a method in A
public void setContrast(double c)
contrast =c ;
repaint();
}in this case, how would i do it? and then to display the image in class B?
thanks!!

Similar Messages

  • I need to create a image using some numeric values and i want to display values in image,

    I need to create a image using some numeric values and i want to display values in image, Numeric values be enterd by text file, excel file or user input by dialog box,
    this is the sample if image.
    http://s17.postimg.org/5xvtzbztn/5_01_03_I.png
    128 x 16 Pixels , Back ground Black, Numbers in Red, Should be same as above picture.
    Because i have hundreds of images to create like this.
    If any one can make a script for this it is very good.
    Sorry about my English.
    Thank you.

    Have you checked out data driven graphics?
    https://helpx.adobe.com/photoshop/using/creating-data-driven-graphics.html

  • Want to display a still image if user cannot see Flash

    I am looking at all the various Flash detectors and am a bit overwhelmed. Most of the info I find is from 2008 and before so I am afraid it is outdated.
    I want to be able to detect if a user has flash plugin and if not then display a still image. I am concerned that I-phone users are not seeing the flash embed in my site.
    What is the currently recommended solution?

    Nevermind the above question.... I found my answer at a different source.

  • Table of content, I want to display just the image for each chapter and the name of the chapter. my book is not landscape format but each time I draging a picture into a specific chapter it duplicate it to all chapters why?

    table of content in a landscape orientation.
    I want to have in my table of content only image and the name of the chapter which is each to do.
    my problem when I am draging an image to each chapter it copied it to all chapter although I am marking only the specifc chapter.
    why? how can i overcome it?

    Are you using Microsoft word?  Microsoft thinks the users are idiots. They put up a lot of pointless messages that annoy & worry users.  I have seen this message from Microsoft word.  It's annoying.
    As BDaqua points out...
    When you copy information via edit > copy,  command + c, edit > cut, or command +x, you place the information on the clipboard. When you paste information, edit > paste or command + v, you copy information from the clipboard to your data file.
    If you edit > cut or command + x and you do not paste the information and you quite Word, you could be loosing information.  Microsoft is very worried about this. When you quite Word, Microsoft checks if there is information on the clipboard & if so, Microsoft puts out this message.
    You should be saving your work more than once a day. I'd save every 5 minutes.  command + s does a save.
    Robert

  • When I click on itunes store it displays it for a few seconds and then the screen goes blank?

    When I click on the itunes store the info appears for a couple of seconds and then the screen goes blank.  I never had this problem before any ideas?

    same thing with me have you found an answer? the only thing i cant think of is to download the new itues but when i try they are haveing problems with the site or something and i cant dowload it.

  • How to display a dynamic image file from url?

    Hey,I want to display a dynamic image file from url in applet.For example,a jpg file which from one video camera server,store one frame pictur for ever.My java file looks like here:
    //PlayJpg.java:
    import java.awt.*;
    import java.applet.*;
    import java.net.*;
    public class PlayJpg extends Applet implements Runnable {
    public static void main(String args[]) {
    Frame F=new Frame("My Applet/Application Window");
    F.setSize(480, 240);
    PlayJpg A = new PlayJpg();
    F.add(A);
    A.start(); // Web browser calls start() automatically
    // A.init(); - we skip calling it this time
    // because it contains only Applet specific tasks.
    F.setVisible(true);
    Thread count = null;
    String urlStr = null;
    int sleepTime = 0;
    Image image = null;
    // called only for an applet - unless called explicitely by an appliaction
    public void init() {
                   sleepTime = Integer.parseInt(getParameter("refreshTime"));
              urlStr = getParameter("jpgFile");
    // called only for an applet - unless called explicitely by an appliaction
    public void start() {
    count=(new Thread(this));
    count.start();
    // called only for applet when the browser leaves the web page
    public void stop() {
    count=null;
    public void paint(Graphics g) {
    try{
    URL location=new URL(urlStr);
    image = getToolkit().getImage(location);
    }catch (MalformedURLException mue) {
                   showStatus (mue.toString());
              }catch(Exception e){
              System.out.println("Sorry. System Caught Exception in paint().");
              System.out.println("e.getMessage():" + e.getMessage());
              System.out.println("e.toString():" + e.toString());
              System.out.println("e.printStackTrace():" );
              e.printStackTrace();
    if (image!=null) g.drawImage(image,1,1,320,240,this);
    // called each time the display needs to be repainted
    public void run() {
    while (count==Thread.currentThread()) {
    try {
    Thread.currentThread().sleep(sleepTime*1000);
    } catch(Exception e) {}
    repaint(); // forces update of the screen
    // end of PlayJpg.java
    My Html file looks like here:
    <html>
    <applet code="PlayJpg.class" width=320 height=240>
    <param name=jpgFile value="http://Localhost/playjpg/snapshot0.jpg">
    <param name=refreshTime value="1">
    </applet>
    </html>
    I only get the first frame picture for ever by my html.But the jpg file is dynamic.
    Why?
    Can you help me?
    Thanks.
    Joe

    Hi,
    Add this line inside your run() method, right before your call to repaint():
    if (image != null) {image.flush();}Hope this helps,
    Kurt.

  • Help with SWFObject2, problem with display of alternate image

    I'm trying to use SWFObject2 dynamic publishing version to test the visitors browser for flash pluggin and the version.
    I want to only show my flash image if the browser finds the flash plug in and it supports the correct version of flash for my banner, otherwise I want to display a jpeg image in its place.
    When flash support is available in my browser the flash image is displayed, no problems. But when Javascript or flash plugin support is not available and my alternate image jpeg is displayed something wierd happens and i would appreciate any help on this:
    The image is displayed but is pushed to the right of the screen and it seems to have a box behind the image, the edge of the box is only visable and changes colour on rollove like it wants to be clicked, obviously i cannot see what the box is because the image covers it. There is nothing wrong with my image, i put that in place first and tested it loaded ok before i added the SWFObject code and file.
    My code is below:
    <script type="text/javascript" src="Scripts/swfobject.js"></script>
    <script type="text/javascript">
    swfobject.embedSWF("advertise_banner.swf", "altContent", "468", "60", "6.0.0", "expressinstall.swf");
    </script>
    </head>
    <body>
    <div id="wrapAltContent">
    <div id="altContent">
    <a href="advertise_banner.php?ad=y">
    <img src="Images/advertise_banner.jpg" alt="Image linking to information on  advertising a banner ad on Choose Almeria" />
    </a>
    </div>
    </div>
    Looking forward to replies.

    Hi,
    Is this your question still relevant? If yes, did you study already this for example?
    http://code.google.com/p/swfobject/wiki/documentation
    Hans-G.

  • How to display a blob image in RTF template's Header.

    Hi,
    I want to display a blob image (logo company) in my RTF template,
    my problem is how i can display this image in the template's Header.
    I tried this
    <?
    <fo:instream-foreign-object content-type="image/jpeg" >
    <xsl:value-of select=".//LOGO"/>
    </fo:instream-foreign-object>
    ?>
    but was unsuccessful
    Thanks in advance.

    I tried this
    <?
    <fo:instream-foreign-object content-type="image/jpeg" >
    <xsl:value-of select=".//LOGO"/>
    </fo:instream-foreign-object>
    ?>
    but was unsuccessful
    sure
    what is red elements ?
    you template can be looks like
    ..... some data .....
    ( after  all data )
    <?template:footer_logo?>
    <fo:instream-foreign-object content-type="image/jpeg" ><xsl:value-of select=".//LOGO"/></fo:instream-foreign-object> (as field )
    <?end template?>
    <?call-template:footer_logo?> ( in header/footer )
    some remarks https://oralublog.wordpress.com/2014/10/04/bi-publisher-11g-footers-and-headers-in-rtf-template/

  • How to display a binary image in a webpage?

    Hi,
    I want to display a binary image in a webage. The image has been stored in a DB as binary format. I am using servlet. How could I retrieve it and display it on a webpage? Could you give me some suggestions?
    I have read some metrial about JAI, the method 'createImageEncoder( )', which seems very helpful! I am on the right way, right? Thanks for your any comments!
    Best Regards,
    Hai

    Here is my idea to display the pic on the webpage:
    The pic is stored in DB as binary, after retrieving it, the binary data will be converted to JPEG pic. Then, the pic will be saved to the local machine automaticly. After that, I get the pic's SRC, and use html display it.
    My code is as follow (not completed), some errors in it.     public static String getPayoffSRC(Services serv, long fileId)
                                                                    throws FileNotFoundException,
                                                                  DBException,
                                                                  DbFileNotFoundException,
                                                              IOException {
            BufferedImage buffy = new BufferedImage(300, 400,
                                                        java.awt.image.BufferedImage.TYPE_INT_RGB);   
            FileOutputStream out = new FileOutputStream(serv.getFileManager().getFileDb(fileId).getFileName());
            JPEGImageEncoder jencoder = JPEGCodec.createJPEGEncoder(out);
            JPEGEncodeParam enParam = jencoder.getDefaultJPEGEncodeParam(buffy);
            enParam.setQuality(1.0F, true);
            jencoder.setJPEGEncodeParam(enParam);
            jencoder.encode(buffy);
            out.close();
            return Pic's SRC,
        }

  • How to display an animated image of any sort in centre of screen

    Hi,
    Would really appreciate some help on how to present the user with a animated image in the centre of the screen whilst a user is waiting for a operation to load/complete.
    I basically have a situation where a user presses a button to load a CSV file and during this operation, want to display this animated image and then remove it on completion.
    Thanks.
    Tony.

    Hi Tony,
    Is this the kind of thing you are looking for?
    Re: Displaying 'please wait' graphic during long running process
    Regards
    Paul

  • Display legend(as image) for ALV

    Hello experts,
    I have created ALV report in which it displays data in ALV grid. I want to display legend as image which explain output of the ALV grid. ie I want to display image below/under the ALV, which image gives information about outpout. (Legend)
    Any suggestions or helpful solutions ideas are appreciated.
    Thanks in advance...
    Regards,
    Viral Patel
    Edited by: Viral Patel on Jan 5, 2010 6:24 AM

    Hi Sandeep,
    Thanks for Your quick response.
    Could You please elaborate it how can I implement it in my code as I am new to ALV. There is one button in ALV display called 'Information(Ctrl+F12), when I press it will open browswer and display help on ALV. Is there any way to customize that button and get display legend?
    Thanks n Regards,
    Viral Patel
    Edited by: Viral Patel on Jan 5, 2010 6:42 AM

  • I want to display BLOB image in JSP Using  html tags IMG src=

    GoodAfternoon Sir/Madom
    I Have got the image from oracle database but want to display BLOB image using <IMG src="" > Html tags in JSP page . If it is possible than please give some ideas or
    Send me sample codes for display image.
    This code is ok and working no problem here Please send me code How to display using html tag from oracle in JSP page.
    <%@ page import="java.sql.*" %>
    <%@ page import="java.io.*" %>
    <%@ page import="javax.swing.ImageIcon;" %>
          <%
            out.print("hiiiiiii") ;
                // declare a connection by using Connection interface
                Connection connection = null;
                /* Create string of connection url within specified format with machine
                   name, port number and database name. Here machine name id localhost
                   and database name is student. */
                String connectionURL = "jdbc:oracle:thin:@localhost:1521:orcl";
                /*declare a resultSet that works as a table resulted by execute a specified
                   sql query. */
                ResultSet rs = null;
                // Declare statement.
                PreparedStatement psmnt = null;
                  // declare InputStream object to store binary stream of given image.
                   InputStream sImage;
                try {
                    // Load JDBC driver "com.mysql.jdbc.Driver"
                    Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
                        /* Create a connection by using getConnection() method that takes
                        parameters of string type connection url, user name and password to
                        connect to database. */
                    connection = DriverManager.getConnection(connectionURL, "scott", "root");
                        /* prepareStatement() is used for create statement object that is
                    used for sending sql statements to the specified database. */
                    psmnt = connection.prepareStatement("SELECT image FROM img WHERE id = ?");
                    psmnt.setString(1, "10");
                    rs = psmnt.executeQuery();
                    if(rs.next()) {
                          byte[] bytearray = new byte[1048576];
                          int size=0;
                          sImage = rs.getBinaryStream(1);
                        //response.reset();
                          response.setContentType("image/jpeg");
                          while((size=sImage.read(bytearray))!= -1 ){
                response.getOutputStream().write(bytearray,0,size);
                catch(Exception ex){
                        out.println("error :"+ex);
               finally {
                    // close all the connections.
                    rs.close();
                    psmnt.close();
                    connection.close();
         %>
         Thanks

    I have done exactly that in one of my applications.
    I have extracted the image from the database as a byte array, and displayed it using a servlet.
    Here is the method in the servlet which does the displaying:
    (since I'm writing one byte at a time, it's probably not terribly efficient but it works)
         private void sendImage(byte[] bytes, HttpServletRequest request, HttpServletResponse response) throws IOException {
              ServletOutputStream sout = response.getOutputStream();
              for(int n = 0; n < bytes.length; n++) {
                   sout.write(bytes[n]);
              sout.flush();
              sout.close();
         }Then in my JSP, I use this:
    <img src="/path-to-servlet/image.jpg"/>
    The name of the image to display is in the URL as well as the path to the servlet. The servlet will therefore need to extract the image name from the url and call the database.

  • I have a sharepoint custom list with Title and image attachments, now i want to display image attachments in div based on the title.

    hi,
    i have a sharepoint custom list with Title and image attachments, now i want to display image attachments in div based on the title.

    i am using the below code only
     SPSite mySite = new SPSite("http://sharepoinsiteaddress");
    SPWeb myweb = mySite.OpenWeb();   
    SPList myList = myweb.Lists["Announcements"];   
    SPListItem myListItem = myList.GetItemById(1);   foreach (String attachmentname in myListItem.Attachments)
    String attachmentAbsoluteURL =    myListItem.Attachments.UrlPrefix // gets the containing directory URL
       + attachmentname;
       // To get the SPSile reference to the attachment just use this code
      SPFile attachmentFile = myweb.GetFile(attachmentAbsoluteURL);
       // To read the file content simply use this code
       Stream stream = attachmentFile.OpenBinaryStream();    StreamReader reader = new StreamReader(stream);
       String fileContent = reader.ReadToEnd();
    here i am using panel, how can i attach this attached image to panel

  • I  want to retrieve a photo image of an Employee to display in smartforms

    Hi,
    i want to retrieve a photo image of an Employee to display in smartforms , how do i do that? can anyone help me with this?
    Regards
    Anbu B

    Hi Anbu,
    Check this link:
    smartforms: logo
    http://help.sap.com/saphelp_nw2004s/helpdata/en/27/1d008bdd4811d3969500a0c930660b/content.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/d2/69a154cd8b11d3b563006094192fe3/content.htm
    Regards,
    Chandra Sekhar

  • How to display image and data in module pool screen?

    Hi,
    I want to display image and relevant data besides the image in module pool screen, I am using docking container to display the image.
    Actually I am able to display image or data any one but not both.
    one more thing I want to display multiple images and their data.
    Please suggest some one if you have any idea.
    Regards,
    Dileep.

    You can try below way, I have used in report.
    DATA: gc_docking              TYPE REF TO cl_gui_docking_container, "#EC NEEDED  "Docking Container
           gc_split                 TYPE REF TO cl_gui_easy_splitter_container, "#EC NEEDED  "Splitter
           gc_top_container         TYPE REF TO cl_gui_container, "#EC NEEDED  "Top Container
           gc_bottom_container      TYPE REF TO cl_gui_container, "#EC NEEDED  "Bottom Container
          gc_document              TYPE REF TO cl_dd_document, "#EC NEEDED  "Document
           gc_events                TYPE REF TO lcl_event_class, "#EC NEEDED  " Local Event Class
           gc_grid                  TYPE REF TO cl_gui_alv_grid, "#EC NEEDED  " ALV Class
    " Creating Docking
    CREATE OBJECT gc_docking
           EXPORTING
             ratio = c_95.
         IF sy-subrc EQ 0.
    * Splitting the Docking container
           CREATE OBJECT gc_split
             EXPORTING
               parent        = gc_docking
               sash_position = c_10 "Position of Splitter Bar (in Percent)
               with_border   = c_1. "With Border = 1 Without Border = 0
         ENDIF.
    *   Placing the containers in the splitter
         gc_top_container = gc_split->top_left_container .
         gc_bottom_container = gc_split->bottom_right_container .
    *   Creating Grid
         CREATE OBJECT gc_grid
           EXPORTING
             i_parent = gc_bottom_container.
       ELSE.
    * Background job handling
         CREATE OBJECT gc_grid
           EXPORTING
             i_parent = gc_docking.
       ENDIF.
    *   Creating the document
       CREATE OBJECT gc_document
         EXPORTING
           style = 'ALV_GRID'.
    Regards,
    Sameer

Maybe you are looking for

  • How can I download a previous version of an app?

    I recently just downloaded the latest version of eBuddy, 5.2.0, and it is absolutely terrible. It doesn't give me all my messages, and it crashes every few seconds. I wish to revert back to 5.1.0 without deleting the information on my iPod as of curr

  • WRT54GS - No longer able to connect to internet

    Hello I've been using the WRT54GS for at least three years without any major problems. My set up has two main PCs, one in the basement we'll call F-PC and the other on the second floor we'll call M-PC. F-PC connects via wire to the WRT54GS, which in

  • Order Process Sequence Problem

    Currently I have a FM that does data from an incoming PO IDoc, makes some conversions, changes, etc.  It saves these changes into a new IDoc structure and then uses IDOC_INBOUND_ASYNCHRONOUS FM to post them to create orders.  The problem is if I have

  • IPhone 3GS to factory settings

    Hello I have iPhone 3GS purchased from Singapore while I live in india I jailbroked my iPhone and now want back in factory settings As suggested by different blogs I tried it by restoring using iTunes but that left iPhone useless until it is jailbrok

  • WEB SERVCIE TO INSERT ROW ina Table in DATABASE

    Hi ALL I want to create a web service to insert row in a table in database. As I am new to Web Service. Please help me to do it. Thanks in advance !