Backgorund image

How to change the background of my application to an image one instead of color?

I prefer a pattern algorithm to create a textured background as it carries next to no overhead and its more fun: eg;-
import javax.swing.*;
import java.awt.*;
import java.awt.geom.Rectangle2D;
import javax.swing.border.Border;  
* A Pattern5.class.
* @author Sum-shusSue
* Nov 2002 jdk 1.3.1
public class Pattern5 extends JFrame{
   public final static int BORDER_TYPE_RAISEDBEVEL = 3;
   JPanel pan;
   public Pattern5()  {     
      super();
      pan = new JPanel() {
         public void paintComponent(Graphics g) {
           super.paintComponent(g);
              for(int x = 0;x < this.getWidth();x+=2) {
                 for(int y = 0;y < this.getHeight();y+=2) {
                    if ((x % 6 == 0)&&(y % 4 == 0))g.setColor(Color.white);
                    else if ((x % 4 == 0)&&(y % 6 == 0)) g.setColor(Color.lightGray);
                    else g.setColor(Color.black);
                    g.drawLine(x,y,x-1,y-1);
       pan.setOpaque(false);
       getContentPane().add(pan);
       Border m_border = BorderFactory.createRaisedBevelBorder();
       pan.setBorder(m_border);
public static void main (String []args) {
   Pattern5 frame = new Pattern5();
   frame.setSize(400, 300);
   frame.setVisible(true);
   frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
   frame.show();
}

Similar Messages

  • Transfer photo images to PC for printing

    1. Tried saving image as jpeg and as png file (rather than PSD), but got errors when attaching to email as transfer media.
    2. Tried to 'flatten the image' using PS editor, but most of the EDit function items are grey (inactive).
    Does anyone have suggestions on what I'm doing wrong?
    Alternately, can anyone suggest a better approach to saving and transferring images from Photo Shop to a printable format?
    Thanks

    Hi,
    Regarding the jpeg/png saving, what is the error message your getting when trying to transfer the media?
    Also, could you make sure that the backgorund image is unlock while editing in PS>
    -Harshit yadav

  • CFMAIL - Background Image contained in TD Not Displaying in Outlook

    A backgorund image contained in a <TD width="400" background="http://www.abcdef.com/img/background_B.jpg"> does not appear when the html email message is opened in Outlook. However, if you click the having trouble viewing this email prompt the image does display on the web view. Is this a CFMAIL problem? If so does anyone have a work around for or other ideas where to look for a solution?

    As we don't know your code, your imaging library or anything else that you are doing - and my crystal ball is on the fritz - we can't really help :(.
    However, given that you are talking about CMYK the first question is about whether you a re working on a CMYK surface or converting to RGB?  If converting, how?
    Second, what filter is applied to the image?  DCT? Flate?  Other?
    Third, are you considering any DecodeParms on the image?
    Fourth, is the image indexed or not?
    And the list goes on..

  • Xml images looping?

    hai to all
    i am in a problem that is, i did a backgorund image changer
    for 10 secs for my project. the code below works fine. all well but
    what i need is after compeleting all the images in the xml file it
    stops.
    i want it to loop or repeat the process again can any say how
    plzzz
    this is my code:-
    xmlData = new XML ();
    xmlData.ignoreWhite = true;
    xmlData.onLoad = loadXML;
    xmlData.load ("images.xml");
    function loadXML (loaded) {
    if (loaded) {
    xmlNode = this.firstChild;
    image = [];
    total = xmlNode.childNodes.length;
    for (i=0; i<total; i++) {
    image
    = xmlNode.childNodes.childNodes[0].firstChild.nodeValue;
    //trace (image
    firstImage ();
    else {
    trace ("file not loaded!");
    p = 0;
    filesize = picture.getBytesTotal ();
    loaded = picture.getBytesLoaded ();
    function firstImage () {
    if (loaded == filesize) {
    picture.loadMovie (image[0], 1);
    picture._alpha = 100;
    alpha (picture);
    effect (picture);
    timer ();
    function nextImage () {
    if (p<(total-1)) {
    p++;
    if (loaded == filesize) {
    picture.loadMovie (image[p], 1);
    picture._alpha = 100;
    alpha (picture);
    //removeMovieClip("effect1");
    effect (picture);
    timer ();
    /*function prevImage () {
    if (p>(total-1)) {
    p--;
    picture.loadMovie (image[p], 1);
    picture._alpha = 100;
    timer ();
    function timer () {
    var secs = 10;
    var id = setInterval (function () {
    clearInterval (id);
    nextImage ();
    }, secs*1000);
    var alpha_interval = setInterval (alpha, 100, picture);
    function alpha (picture) {
    picture._alpha += 10;
    if (picture._alpha<100) {
    trace ("alpha");
    clearInterval (alpha_interval);
    function effect (picture) {
    this.attachMovie ("effect", "effect1", 10);

    go to google and type:  as3 slideshow tutorial.

  • Files from template not copy img background property

    i have a simple(single) template with two bars(vertical and horizontal, each one has a specific png backgorund image set in .twoColHybLtHdr #header and #sidebar ) and a editable region in the middle of the page, so far i've built the entire site based on that template with no problems.
    today i'm doing some work, edited the templates links, updated all the pages, but when i try to generate a new file from template i encounter a completely black background, checking the css style shows that the background-image property ain't there anymore(if i try to add it it says that it's in a locked portion of the file thus the chnge will be discarded).
    i've tried downloading an old model and the resulting files are the same
    i'm attaching the model and a resulting page
    you can also see them online at: http://www.espiralcalipso.com.ar/error.html
    and a good one: http://www.espiralcalipso.com.ar/editorial.html
    any ideas are greatly appreciated.
    DW is CS4 10.0 b4117
    PD: i've noticed that this is EXACTLY my same problem: http://forums.adobe.com/message/2456171
    but only posted is a workaround.
    i've checked my site definition and the root folder is pointed to the file system root, the url is the correct one and it's relative to document

    That's pretty easy to do. This should get you close:
    set the_template_file to (choose file with prompt "Select the template file:")
    set the_name_list_file to (choose file with prompt "Select the file containing the names:")
    set the_names_list to paragraphs of (read the_name_list_file)
    tell application "Finder"
              repeat with each_name in the_names_list
                        set new_file to duplicate the_template_file
                        set name of new_file to each_name & ".docx"
              end repeat
    end tell
    The script will first ask you for the template file, then ask you for the file that contains the list of names.
    It then loops through the list of names, for each name it duplicates the template file, then renames it to match the contents of the file.
    There's no error checking here, so you might want to pad this script to catch errors, but it should be functional.

  • In Cp5, can you record a window that is smaller than the project size?

    We would like to have a project that is sized larger than the application capture areas, in order to have a section to the side of the application captures that can be used for buttons, text boxes, and rollover objects for example. For example, the Cp project size may be 800x600, while the captured window size is 700x600. In Cp4, I can only capture at the size of the project. Is Cp5 different or does the capture size just have to equal the project size? Would this example require capturing at 700x600 and resizing to 800x600, while maintaining the backgorund image sizes and orienting the images left/right during resize? Has anyone done something like this and have a recommended way to accomplish it?

    Hello,
    Sorry to be a bit lazy, but it is late in the evening over here. Perhaps my blog post about Knockout Master slides could help? You will have to rescale anyway and I tried to explain some maths for the rescaling:
    Create and use a knockout master slide
    Lilybiri

  • Flash Movie not runnning on smartphones?

    Good morning.
    If there is already a thread on this please point me in the right direction.
    My flash movie runs fine in ie, ff, gc but not pda's / smart phones
    Thanks HardLee

    Not a fix.  But inserting the same backgorund image used in flash project to the cell properties at least gives me a still image of
    the info.

  • I just finised with brush tool and eye driopper earsing part of the backgorund and adjusting ther rest of the image.  I now want to take the image make it transparent and incert it into another file with only parts of this file showing through.  Any sugge

    As, we can all see I have been working for so long I can no longer spell therefore please forgive my errors

    It sounds like he simply wanted to select an element in one document and copied it over to another document.
    One suggestion I can give: Step away from the computer every once in a while. It's not healthy to just sit there for hours on end. Get up for a few minutes every so often.

  • Linked Image with CSS Hover background Color Jerks in IE8

    Please see http://www.rrmuseumpa.org/about/musviews/index.shtml and hover over any of the five slideshow images, using IE8. Note that the hover causes a jerk when the assigned background color for hover kicks in, apparently by adding some vertical margin at botton. It's fine in all other browsers.
    What I want is for any image that serves as a link to not have a border and to not pick up the default hover background color, and to not cause the "jerk" in IE8.
    CSS file is at http://www.rrmuseumpa.org/css/main.css . Specific css would be most appreciated.
    Thanks.
    Jim

    The very last style rule states
    /* HACK FOR IE: to stabilize appearance of menu items; the slash in float is to keep IE 5.0 from parsing */
    @media screen, projection
    ul.MenuBarHorizontal li.MenuBarItemIE
    display: inline;
    f\loat: left;
    background: #FFF;
    color: #FFF;
    This is a white backgorund and white text. Simply change the background colour to #2565B2
    Gramps

  • Create a negative image in Appleworks

    I need to turn AppleWorks Drawing documents into negatives. For example, I might have 6 scanned images on one A4 page. These are usually lineart eps images. I need to convert these so the images are white and the backround page is black. I can do this in Photoshop by pressing [Apple + I]. I have tried to save the AppleWorks file as a jpg (and other formats) in AppleWorks and then open them in PhotoShop to invert, but they open up in PhotoShop all jagged.
    It is not practicable to convert the images in Photoshop to white images and past them on to a black background because:
    1. The images cannot be stacked closely together (eps is essentialy so you can have transparent backround, making the images closer together. A transparent white image is no good on top of a black backgorund)
    2. It is harder to adjust the size of the images on a black background because I can't see the grid, which is always black).
    Any ideas? This is an important part of process of making letterpress negatives.
    Intel iMac 20"   Mac OS X (10.4.6)  
    Intel iMac 20"   Mac OS X (10.4.6)  
    Intel iMac 20"   Mac OS X (10.4.6)  

    There is no setting for inverting colours with my HP LaserJet 5MP. I have checked the settings when the print window comes up.
    I have used AppleWorks very successfully for my purpose for around 12 years. I used it to set up a page to lay out rubber stamps for manufacture. Until recently I was printing the images as positives and using photographic film to make a negative, which is used for making rubber stamps. I now can save a lot of time by printing directly onto a new film, which acts as the negative, saving time messing around with chemicals etc. However, to do this I must print the image inverted.
    The advantages of AppleWorks are
    1. It is very simple and quick to start up.
    2. I use eps images in lineart (transparent whites), so I can move different images close to each other, whithout a white corner of an image overlapping [imagine 2 black circles can be placed almost touching each other - if you used a jpg then there would be a large white corner interfering with the image underneath].
    3. I keep the grid set in inch sizes. This way I can easily resize images on the page individually to the grid, without having to keep track of the original scanned images - these can be deleted right away.
    4. It is very easy to move images around to optimize the number that can be packed on a sheet.
    The problem with PhotoShop is
    1. There is no grid, so images have to be sized before pasting into a document.
    2. You will end up with multiple layers, which would be really confusing if I hada lot of designs on one page (I can have up to 100 small designs on one page).
    3. I can copy and paste documents in AppleWorks from one document to another. If I copy an AppleWorks document into PhotoShop it goes really jagged (useless)
    4. The transparent background does not seem to work on pasting into a document.
    In an ideal world I would have
    a) a plugin for AppleWorks to invert the image or
    b) a print option on the printer to invert the image [How do you find out about this before you buy the printer].
    Intel iMac 20" Mac OS X (10.4.6)
    Intel iMac 20" Mac OS X (10.4.6)
    Intel iMac 20" Mac OS X (10.4.6)
    Intel iMac 20" Mac OS X (10.4.6)
    Intel iMac 20" Mac OS X (10.4.6)
    Intel iMac 20" Mac OS X (10.4.6)

  • How to load an icon on image

    Hello friends please hel[p me as to how to load an icon on an image in the backgorund.                                                                                                                                                                           

    using JFrame, I use following code in the constructor
    public class MyConfig extends JDialog {
       public MyConfig(JFrame parent, boolean modal) {
                java.net.URL imgURL = MyConfig.class.getResource("images/colorcircle.gif");          
                parent.setIconImage(new ImageIcon(imgURL).getImage());
        public static void main(String[] args) {
            MyConfig c = new MyConfig(new JFrame(), true);
            c.setVisible(true);
    }

  • Optimizing images

    I thought I knew how to optimize images.  I was taught to use the Export Wizard in FW to not reduce the dimensions, but the size.  For some reason, this doesn't seem to be working for this site.  I am testing all the pages with this free tool someone showed  me and it's giving me a "too slow" or "way too slow" status.  Maybe I'm not optimizing them correctly using the Export Wizard?  I just choose JPEG or GIF or whatever and then save it.
    Any ideas to reduce the images would be so helpful.
    Thanks so much in advance!

    On the logo, the red border will cause the image to be larger, as GIFs are "run length encoded," the number of pixels in a row that are the same color. Since you're placing that image on a red background, anyway, you don't need the red border.
    For the images with the drop shadows, the background color you've placed them on doesn't match your page background, so you should change that. Other than that, I don't know what you could do to make the images smaller. I like going through File > Image Preview and playing with the settings until I get a good quality image.
    On the can_logo, you would probably have better results optimizing that as two images, a .jpg for the photo and a b&w .gif for the actual logo. Then, maybe stick them together in a table. You could probably add a black border to the table in fewer bytes than it takes to draw it in pixels on the image. Again, since that image is on a red background, you don't need those pixels in the image at all.
    I think that testing site is out of touch. It seems to highlight the 28.8k modem as the download speed of concern. While I know not everyone is on broadband, I would start with a 56k modem and not concern myself with the 14.4k at all.
    One other small point. The background texture looks greenish, when compared to your red sidebar and the gold in the backgorund of the logo. You might want to adjust it. Here's a png with a solid rectangle of the logo gold and a greyscale version of your background image, with various blending modes. You might see if you like one of them better than what you have. (Or tell me to jump in the lake! )

  • PLEASE, IMAGES HELP!

    Hi!, I have a problem with Images and drawOval,
    I need load a image and paint as backgorund in a JFrame, and drawOvals
    over of this image, is possibble do that?.
    10 duck dollars for you reply!!
    Thanks you so much from Uruguay - SouthAmerica
    Alvaro

    public void paint(Graphics g)
    g.drawImage(myImage, 0, 0, getWidth(), getHeight(),
    this);
    g.drawOval(x,y,r1,r2);
    }This will not work in a JFrame. You have to override the proper paintComponent() method, but you should already know that if you read the Swing tutorial or have been taught it.

  • If image file not exist in image path crystal report not open and give me exception error problem

    Hi guys my code below show pictures for all employees
    code is working but i have proplem
    if image not exist in path
    crystal report not open and give me exception error image file not exist in path
    although the employee no found in database but if image not exist in path when loop crystal report will not open
    how to ignore image files not exist in path and open report this is actually what i need
    my code below as following
    DataTable dt = new DataTable();
    string connString = "data source=192.168.1.105; initial catalog=hrdata;uid=sa; password=1234";
    using (SqlConnection con = new SqlConnection(connString))
    con.Open();
    SqlCommand cmd = new SqlCommand("ViewEmployeeNoRall", con);
    cmd.CommandType = CommandType.StoredProcedure;
    SqlDataAdapter da = new SqlDataAdapter();
    da.SelectCommand = cmd;
    da.Fill(dt);
    foreach (DataRow dr in dt.Rows)
    FileStream fs = null;
    fs = new FileStream("\\\\192.168.1.105\\Personal Pictures\\" + dr[0] + ".jpg", FileMode.Open);
    BinaryReader br = new BinaryReader(fs);
    byte[] imgbyte = new byte[fs.Length + 1];
    imgbyte = br.ReadBytes(Convert.ToInt32((fs.Length)));
    dr["Image"] = imgbyte;
    fs.Dispose();
    ReportDocument objRpt = new Reports.CrystalReportData2();
    objRpt.SetDataSource(dt);
    crystalReportViewer1.ReportSource = objRpt;
    crystalReportViewer1.Refresh();
    and exception error as below

    First: I created a New Column ("Image") in a datatable of the dataset and change the DataType to System.Byte()
    Second : Drag And drop this image Filed Where I want.
    private void LoadReport()
    frmCheckWeigher rpt = new frmCheckWeigher();
    CryRe_DailyBatch report = new CryRe_DailyBatch();
    DataSet1TableAdapters.DataTable_DailyBatch1TableAdapter ta = new CheckWeigherReportViewer.DataSet1TableAdapters.DataTable_DailyBatch1TableAdapter();
    DataSet1.DataTable_DailyBatch1DataTable table = ta.GetData(clsLogs.strStartDate_rpt, clsLogs.strBatchno_Rpt, clsLogs.cmdeviceid); // Data from Database
    DataTable dt = GetImageRow(table, "Footer.Jpg");
    report.SetDataSource(dt);
    crv1.ReportSource = report;
    crv1.Refresh();
    By this Function I merge My Image data into dataTable
    private DataTable GetImageRow(DataTable dt, string ImageName)
    try
    FileStream fs;
    BinaryReader br;
    if (File.Exists(AppDomain.CurrentDomain.BaseDirectory + ImageName))
    fs = new FileStream(AppDomain.CurrentDomain.BaseDirectory + ImageName, FileMode.Open);
    else
    // if photo does not exist show the nophoto.jpg file
    fs = new FileStream(AppDomain.CurrentDomain.BaseDirectory + ImageName, FileMode.Open);
    // initialise the binary reader from file streamobject
    br = new BinaryReader(fs);
    // define the byte array of filelength
    byte[] imgbyte = new byte[fs.Length + 1];
    // read the bytes from the binary reader
    imgbyte = br.ReadBytes(Convert.ToInt32((fs.Length)));
    dt.Rows[0]["Image"] = imgbyte;
    br.Close();
    // close the binary reader
    fs.Close();
    // close the file stream
    catch (Exception ex)
    // error handling
    MessageBox.Show("Missing " + ImageName + "or nophoto.jpg in application folder");
    return dt;
    // Return Datatable After Image Row Insertion
    Mark as answer or vote as helpful if you find it useful | Ammar Zaied [MCP]

  • Can you show at a glance which event images are in albums?

    Say I had an event containing multiple similar but different images, is there a way to show in the grid view for example which images have already been used in one or more albums?
    Would be handy to be able to select a 'show list of albums containing this image'dialogue box. I guess you could hide images you've used but that wouldn't work automatically, nor would any other tagging/rating.
    Another approach would be to make albums containing everything in a given event, then move the images out of that album once used, just seems fiddly to me.
    AC

    AC
    Would be handy to be able to select a 'show list of albums containing this image'dialogue box.
    Yes it would and many people have suggested tit. Add your voice to the chorus at iPhoto Menu -> Provide Apple Feedback.
    A workaround - and it's no better - is to go to an album and select al, then give all those pics a keyword. Then in grid view you can see which pics have the keyword. (View -> Keywords)
    Regards
    TD

Maybe you are looking for

  • Is there a way for EDI 820 (remittance advice) to identify proforma invoice

    Hi,   We have certain customers who pay by proforma invoices. These customers send remittances through EDI 820 which we create as payment advice in SAP. When the cash comes in, the payment advice is not being applied since the document number has the

  • Error when deploying SSIS package in 2012

    Hi, I am trying to deploy a SSIS package to 2012 version. But i am getting error as  below, TITLE: SQL Server Integration Services There was an exception while loading Script Task from XML: System.IO.FileNotFoundException: Could not load file or asse

  • Xfce4-session-helper NOT FOUND

    After upgrading xfce4-session the other day, [PACMAN] upgraded xfce4-session (4.10.0-6 -> 4.10.0-7) These errors appear in syslog: Apr 29 13:27:56 arch-top slim[342]: (xfce4-session:397): xfce4-session-WARNING **: Unable to launch "xfce4-settings-hel

  • What is the story with Lightroom

    Can anyone tell me about Adobe Lightroom? I am a pe5 user. Is there any reason to buy lightroom and use it with PE5? Can I replace PE5 with lightroom? Andy

  • CS4 freezes when building Blu-Ray

    Trying to build an ISO for a Blu-Ray project in Encore CS4 and whenever it transcodes the large file (6GB) it freezes when less than 1/4 of the way in. I have two files both exactly the same codec (H.264 1920x1080) and the first one is way smaller an