[ask]Split an Image into 2 Icon

Hi all, here's my problem just hoping any of you willing to help
let say i have an image 800 x 800 pixels
i want to store the image in 2 icon
icon1 contain the image from width 0 to 400 pixels, with same height(800)
icon2 form 401 to 800 also same height
but icon1 and icon 2 have width have width and height same as the original image(800x800)
how can we do this?
i do a little bit of coding, here it is
icon  = new ImageIcon("science/Page (1).jpg");
                createLeftBufferedImages(icon);
                icon  = new ImageIcon(bi);
                icon2  = new ImageIcon("science/Page (1).jpg");
                createRiteBufferedImages(icon2);
                icon2  = new ImageIcon(bi);and
public void createLeftBufferedImages(ImageIcon icon) {
            //init_bi();          
            biSrc = new BufferedImage(icon.getIconWidth()/2, icon.getIconHeight()
                    , BufferedImage.TYPE_INT_RGB);                   
            Graph  = biSrc.createGraphics();           
            Graph.drawImage(icon.getImage(), 0, 0, icon.getIconWidth(), icon.getIconHeight(),this);         
            bi=biSrc;
        public void createRiteBufferedImages(ImageIcon icon) {           
            biSrc = new BufferedImage(icon.getIconWidth()/2, icon.getIconHeight()
                    , BufferedImage.TYPE_INT_RGB);                               
            Graph  = biSrc.createGraphics();           
            Graph.drawImage(icon.getImage(), 0, 0, icon.getIconWidth(), icon.getIconHeight(),this);
            bi=biSrc;
        }but the problem i cant get the icon2 properly..
how i solve this problem?
thx

but the problem i cant get the icon2 properly..How do you know this? Your code does nothing with the icon2 variable. Just because the icon2 variable is assigned a new Oject, does not mean the GUI will automatically display the icon. You still need to invoke a method like:
labelTop.setIcon( icon2);
If you need further help then you need to create a [Short, Self Contained, Compilable and Executable, Example Program (SSCCE)|http://homepage1.nifty.com/algafield/sscce.html], that demonstrates the incorrect behaviour.

Similar Messages

  • Split an image into average small blocks

    Hi Guys:
    Is there any easy way for me to Split an image into average small blocks ? like following , i don't want to get the size of the entire image , and computer the x,y,hight,wight for every blocks , then use image extract

    Hi Abodefree,
    How many averaged blocks do you need? What size of block (in pixels) are you looking for?
    In genersal terms, what is your application -- why do you require the averaged blocks? Are you looking for the brightest quadrant (for example)? 
    Depending on your application, a convolution filter might be useful...
    -- Dave
    www.movimed.com - Custom Imaging Solutions

  • Ask split long text into two line into same cell for ALV

    Dear All,
    Is it possible split long text into two line into same cell for ALV display data?
    Regards,
    Luke
    Moderator message: please search for information before asking.
    Edited by: Thomas Zloch on Feb 24, 2011 10:12 AM

    Keep options: Select the paragraph, then CtrlAltK (Mac: CmdOptK, I
    think).
    If you want the paragraphs in pairs, create two paragraph styles. Style
    A has keep options set to start on a new page, and also, its Next Style
    is style B.
    Style B has no keep options, but it's Next Style is Style A.
    Select all the text.
    From the flyout menu of the paragraph styles palette, apply Style A
    "then next style."
    Now all paragraphs will be alternating -- style A, style B, style A, etc.
    Now do what I wrote initially, and you'll have pairs of paragraph in
    separate text frames.

  • Splitting an image into seperate RGB colour channels

    Hi there everyone,
    im pretty new to java and not that great to be perfectly honest : ( Anyhoo, i have to create a CBIR program that accepts an image and then splits it up into its three colour channels -RGB and then creates a histogram to display the frequency of the colour intensity of pixels in the range 0 -255.
    However i am struggling to get the image split into the individual colour channels at the start.
    I dont expect anyoiine to provide a solution but if anyone could provide any advice on how i could get started, what sort of classes methods to look at i would be most grateful
    Many thanks for your time
    Craig

    Hi Rich123, many thanks for your advice, i'll be looking into those classes. Much appreciated

  • Splitting an image into two links

    OK, I have an image on a site that I would like to split into
    two links. I want the image to be intact, but I would like the
    image invisably split in two, so if you click on one part of the
    image it will take you to a sepearate page to the other half. any
    ideas? Many thanks

    select the image in design view of dw.
    use the "hotspot" tools in the lower left of the Property
    Inspector to draw
    the areas for the two clickable links. See the F1 help.
    Alan
    Adobe Community Expert, dreamweaver
    http://www.adobe.com/communities/experts/

  • Split image into clickable sections

    Hi, I was wondering if anyone know how to split an image into several clickable sections. I am trying to make the game "Risk", and I am sort of stuck at this problem. I have been thinking of making an individual image button for every country with the respective country as image, but I hope there is a better way to do this. The best would be to just split the world map into country sections.
    Thank you in advance
    OhM

    A naive (but possibly sufficient) implementation could just be to keep a table mapping (x,y) pairs to countries. To keep the table smaller, you could map 10x10 blocks of pixels to countries.
    Ultimately this is about storing and then managing data.
    One hack (in my opinion) is to check the color of the clicked pixel in the image of the map. But that is nasty for a variety of reasons (such as, it keeps you from being able to easily change the map image, and things like text in the map (like the names of countries) kind of screws that up. But it's an option.
    You can also keep lists of pixels in sequence describing a polygon, and then use certain algorithms (which I don't recall right now) to determine whether a given point is inside or outside a given polygon.
    Also you can do things like "binary space partitions", I think.
    These last two things are computer graphics techniques, and are non-trivial to implement. I dimly recall them from college but recall no details. You can get a computer graphics textbook (which tend to be expensive) to get more info, or these days there's probably a wiki about it somewhere.
    But I'd suggest keeping it modular. Add a layer of abstraction, writing an API around this functionality. Then write an implementation with a simple table of locations or blocks of locations, and if this proves to be insufficient later, swap it out with something more sophisticated.

  • Spltting an image into its red green and blue components

    Hi,
    I need to split an image into 3 images, one the red component of the original image, one the green component, and one the blue.
    Any idea how this can be done?

    Hi,
    something along these lines:
    Robot robot = new Robot();
    // loop: get color for each pixel in image
    Color pixelColor = robot.getPixelColor(x, y);
    int red = pixelColor.getRed();
    int green = pixelColor.getGreen();
    int blue = pixelColor.getBlue();
    // do your stuff with these values
    Cheers,
    Jim

  • Wall decals over size.. functionality to cut image into piece on artboard ?

    1- I am doing wall decals, I am drawing a big tree (7 foot long). My vinyl roll size in 24 inches. Is there a functionality in Adobe Illustrator CS5.5 to split the image into section ready to cut ? My cutting software can do it but I want to do it in illustrator... is there a way ???
    2- I am not able to find information on how illustrator can help me to place the objects on the artboard (with spaces between each objects) to maximize the vinyl space available without have to place each object by hand one by one.
    Thanks Nancy

    This kind of stuff (vinyl cutting project setup) was a pain to do in Illustrator prior to its finally (literally decades late to the game) acquiring the ability to have more than one page in a file. It's still a pain comparitive to Adobe's other vector drawing program (FreeHand), due to Illustrator's still-yet-to-appear ability to draw to user-defined scale.
    This is how I routinely do it in FreeHand:
    1. Draw the whole design at a comfortable scale (ex: 1"=1') on a convenient page size (ex: tabloid, so I can print it on a desktop printer). Define spot color Swatches for each vinyl.
    2. When the design is done, add pages (one for each vinyl to be used) with either height or width the actual width of my vinyl (ex: 24"). Set ruler guides on each page to indicate what I consider a comfortable "maximum cut width" for the gripper/roller margin of my machine.
    3. Select all elements of a single vinyl color, duplicate them to one of the full-size pages. Do this for each vinyl.
    4. Scale the elements to actual size (ex: 1200%).
    5. For an element too large for the maximum cut width, place a pair of ruler guides separated by the amount of desired overlap (ex: .25").
    6. Duplicate the object in place. Use the Knife tool to slice the object along one of the guides. Delete the unwanted piece.
    7. Similarly cut the remaining (original) copy along the other guide. Delete the unwanted piece.
    8. Freely arrange (move and/or rotate) each of the pieces so as to maximize vinyl usage on each vinyl-specific page. Drag length of vinyl pages to fit final arrangement.
    9. Export the full-size pages only.
    10. Open the exports in my cutter driver software, and cut.
    I leave it to you to translate the same basic operations to Illustrator. Some of the reasons I still find Illustrator inferior for this:
    Still no support for user-defined ruler scales.
    Very unreliable snaps behavior at zooms.
    The infernal "Global" swatch designation.
    Pages interface (like many things) needlessly cumbersome compared to FreeHand's. (Separate "Artboard mode" is tedious for arranging Artboards, making page-specific guides, snapping Artboards to grid and to each other.)
    Inferior behaviors of Boolean path operations ("Pathfinders"). (Ex: converting compound paths to groups.)
    Inferior cutting tools (Ex: releasing compound of compound paths; failure to handle open, unfilled paths.)
    JET

  • How to split image into smaller (same size) pieces?

    Hi all,
    My question is how to split image into smaller (same size) pieces, using Photoshop elements 13? Could anyone help me with this one?
    Thanks!

    Use the Expert tab in Editor (I think that is what it is called in PSEv.13)
    You may find the grid helpful. Go to View>Grid. It will not print, but will help to orient you. You can set up the gridlines to suit via Edit>Preferences>Guides and Grid. If you want to partition the picture in to 4 uniform pieces, it would be Gridline every 50%, Subdivision 1. Also, go to View>Snap to>Grid.
    Set up the Rectangular marquee tool: If the picture is 6" wide & 4" high, enter width=3in & height=2in.on the tool's option bar. This will be a fixed size.
    Click and select one quadrant, press CTRL+J to place this quadrant on a separate layer
    Repeat for the other 3 quadrants
    You should end up with 5 layers : Background, and layers 1, 2, 3, 4.

  • Guys, i want to ask on how to resize the images into 1200 pixels wide?

    Guys, i want to ask on how to resize the images into 1200 pixels wide, how to do it? and what are the step by steps on doing that? thank you!!!

    See this link: http://forums.adobe.com/docs/DOC-3691

  • Load/import images into layers to create animated gif in PE4

    I'm trying to make an animated gif using Photoshop Elements 4.0.
    I have numerous images (photos) that I need to insert into separate frames of one image.
    (photo1, photo2 ..... photo10 - all combined in layers to create the frames of the animated gif)
    I can open each photo separately, copy it, go the the animated gif image, create a new layer, and paste the image into the layer to create a frame in the animated gif.  This is very time consuming.
    Does Elements 4.0 allow for just opening/importing the separate images (photos) into the layers (frames) of the gif direclty?  I remember having software that came with Macromedia Dreamweaver 4.0 in 2000 that made this simple and straight forward.

    We are not the right people to ask.  The Touch forum (for tablet) is at
    Adobe Photoshop Touch for tablet
    There's a long list f video tutorials here, but I can't see anything about animation
    Learn Photoshop Touch | Adobe TV

  • How to insert image into table and to in Oracle 9i intermedia?

    Mr Lawrence,
    I want to ask something:
    I use Oracle 9i intermedia
    If i use this script:
    CREATE TABLE images (
    file_name VARCHAR2(100) NOT NULL,
    image ORDSYS.OrdImage
    then
    CREATE OR REPLACE DIRECTORY imgdir AS 'd:/data';
    then
    INSERT INTO images (file_name, image)
    VALUES ('tree', ORDSYS.ORDImage.init('file','imgdir','tree.jpg' ));
    I put tree.jpg in directory d:/data in my hard drive.
    Is my tree.jpg file had already get in to my images table?
    I'm little confuse, because when i check my table with this script:
    select file_name, i.image.getWidth() from images i;
    it's show that my i.image.getWidth() for file_name tree is empty.. that mean my tree.jpg doesn't get in to my table.. am i correct?
    N also i want to ask how to display to screen all of my image from images table?
    Is it posible Oracle 9i intermedia to support display image from table?
    How?
    thanks Mr Lawrence

    -- First step would be to create a directory in oracle and map it to the folder where your image resides.
    create directory image_dir as *'c:\image_dir';*
    Then you would have to use a procedure to insert the image in your table. SO first create a table to hold the image. Note that you have to use a BLOB to insert the image.
    CREATE TABLE test_image
    ID NUMBER,
    image_filename VARCHAR2(50),
    image BLOB
    Now let's write the procedure to insert the image in the table above.
    CREATE OR REPLACE PROCEDURE insert_image_file (p_id NUMBER, p_image_name IN VARCHAR2)
    IS
    src_file BFILE;
    dst_file BLOB;
    lgh_file BINARY_INTEGER;
    BEGIN
    src_file := BFILENAME ('image_DIR', p_image_name);
    -- insert a NULL record to lock
    INSERT INTO temp_image
    (ID, image_name, image
    VALUES (p_id, p_image_name, EMPTY_BLOB ()
    RETURNING image
    INTO dst_file;
    -- lock record
    SELECT image
    INTO dst_file
    FROM temp_image
    WHERE ID = p_id AND image_name = p_image_name
    FOR UPDATE;
    -- open the file
    DBMS_LOB.fileopen (src_file, DBMS_LOB.file_readonly);
    -- determine length
    lgh_file := DBMS_LOB.getlength (src_file);
    -- read the file
    DBMS_LOB.loadfromfile (dst_file, src_file, lgh_file);
    -- update the blob field
    UPDATE temp_image
    SET image = dst_file
    WHERE ID = p_id AND image_name = p_image_name;
    -- close file
    DBMS_LOB.fileclose (src_file);
    END insert_image_file;
    Now execute the procedure to insert the image.
    EXECUTE insert_image_file(1,'test_image.jpg');
    Thanks,
    Aparna

  • I have a DAQ Assistant configured to read multiple channels at the same time. When I wire a graph indicator to the output, I see all of my signals jumbled together. How do I split them up into seperate signals?

    I have a DAQ Assistant configured to read 2 channels at the same
    time. When I wire a graph indicator to the output, I see the 2
    signals jumbled together. How do I split them up into seperate signals?
    When I wire any type of indicator it is showing just one output of a single channel.
    I want 2 indicators showing 2 different signals as expected from the 2 channels configured. How to do this?
    I have tried using split signal but it end up showing only 1 output from 1 signal in both the indicators.
    thanks in advance.
    Solved!
    Go to Solution.

    Yes you are right. I tried that but I did not get the result.
    I just found the way. When we launch split signal, we should expand it (split signal icon) from above and not from below. It took me a while to figure out this. 
    thanks 

  • How do I turn an image into a transparency?

    Hi,
    There's a question I've seen asked dozens or hundreds of times, and I thought I found an answer a few years ago. I've since forgotten how to do it:
    Turn an image into a transparency.
    Now, the obvious solution is to set the layer to "multiply." Yes, this is the effect I want. However, I want the layer to be transparent instead.
    Another solution is to draw an image on a transparent layer. This works great, but only applies if I create the image from scratch. I want to convert an existing image.
    Another solution is multiple steps:
    1) Copy image
    2) Click "edit in quick mask mode."
    3) Paste image
    4) Exit quick mask mode.
    5) Invert selection.
    6) Ctrl+backspace to fill selection with black, on a blank transparent layer.
    Result? The image is now transparent! However, this converts the image to greyscale! Great for linework and text, terrible for photos or art!
    In an older version of Photoshop 7, I believe I got the following to work:
    A) Follow the previous steps 1-6, creating a layer with transparency
    B) Copy the original picture to a layer above the transparency
    C) Group the layer with the transparency layer below. (Note, grouping doesn't work the same any more.)
    D) The top layer provides the colors, but the bottom layer provides the transparency.
    E) It is too light, so you take the top layer, and maximize "saturation" 100%.
    F) Merge the two layers. It retains the transparency of the bottom layer, with the hue of the top layer.
    This no longer works, because I don't know how grouping layers works anymore.
    So, I need white pixels to be transparent. Black pixels to have zero transparency. Red pixels to have zero transparency. Etc.
    Meanwhile, grey pixels are solid black, but partly transparent. Pink pixels are solid red, but partly transparent.
    All pixels are 100% saturated, and the "lightness" is determined by how transparent they are.
    So, an analogy would be printing a photo on a transparency. I need to convert an image to a transparency.
    If the image/layer were overlaid on white, it would look exactly like the original photo.
    Does anyone know how to accomplish this? Mathematically, it's easy. But I don't know about any filter, process, or method to make the conversion using CS5.
    Thanks,
    Ben

    Hello!
    I hope that I understand what you need.
    (One could just put the image on a layer, and lower its opacity, but you seem to be looking for an effect in wich the tranparency is not the same for all pixels.)
    Try this:
    1) Turn your image image as a layer (double-click it if it is a background layer) [In order to add a mask]
    2) Select all, Copy (CTRL+a, CTRL+C)
    3) add a layer mask (click the rectangle with a circle in the bottom of the layers panel) [to be able to change transparency]
    4) target the mask [so that you can past an image in it] ALT+click the mask, paste the image.
    5) Invert the colors of the mask (CTRL+I) [in order for the white to be transparent and the black opaque].
    You now have a layer whose transparency is based on the lightness of the pixels.
    Hope that's what you are after!
    Pierre

  • Crystal report - how to split a field into more fields

    Hello,
    I`m new to Crystal reports and I`ve got a trouble. I have field which contains an address - street, city, zip code. The example is:
    STEHLIKOVA 977 165 00 PRAHA 620 - SUCHDOL 165 00.
    What I need to achieve is to split this string into three separated fields. I`ve trouhg a couple of forums but haven`t been able to find a proper answer. The problem is that the addresses differ so I can`t use an absolute defining of a start position. Looking at the DB (HEXA code) the parts in the string are divided by two dots:
    STEHLIKOVA 977..165 00 PRAHA 620 - SUCHDOL..165 00
    I`ve been able to work out this solution:
    stringVar array x := split({cparty.STREET_ADD},"..");
    Local numberVar i;
    Local stringVar outputString := "";
    For i:=1 to Count(x) do
    outputString := outputString + x[i] + Chr(10)
    outputString;
    It splits the string into three rows:
    STEHLIKOVA 977
    165 00 PRAHA 620 - SUCHDOL
    165 00
    And I don`t know how to find the end of each row so to be able to separate the strings and report them as three different fields.
    Would be anyone so kind and help me out with this?
    Thank you.
    Petr

    Hi
    Actually using a for loop is not necessary here. All you need to do is to add several formula fields: one for street, one for city and one for zipcode. In @street field you add formula:
    stringVar array x := split({cparty.STREET_ADD},Chr(13));
    x[1];
    Then you drag such formula field to details section of your report and watch preview to check if everything looks alright. Repeat for every formula field that you'd like see in your report.
    In @city you add almost identical formula but you change index, i. e. instead of x[1] you need to use x[2]. Then for @zip x[3].
    You may need to check if your address has all three parts - for example if you want to use formula in the second part of your address field you may need check first if there are at least two parts after split:
    stringVar array := split({cparty.STREET_ADD},Chr(13));
    numbervar c; 
    c := count(x); 
    if 2 <= c then 
    x[c]; 
    Var 'c' is used to store the number of elements in array after split. Then I'd like to check if the part (second) actually exists. So I try to check if number of part that I want to refer to is not bigger than the number of elements in array after split (here stored in var 'c').
    Actually the code presented above is not enough since you have no guarantee that you'll always get address structured in the very same way. For example in demo PL database I have zip code and city in the same row after split with Chr(13) as delimiter.
    You'll need to experiment or ask someone to prepare correctly structured data coming from B1 to your report.
    Kind regards,
    Radek

Maybe you are looking for