Create an image of a JLayeredPane 's content

hi there,
we have a problem here: we'd like to create one image out of a JLayeredPane`s content. but the only thing we get is a gray box which size is the size of the JLayeredPane.
the purpose is: we're developing a graphic tool where you can draw and arrange objects in the JLayeredPane(which is in a JScrollPane). and now we're implementing the print-function which allows to print the graphs over several pages, therefore it is neccessary to have an image(*.jpeg) for our printpreview-window. the preview-window and the printfuntion are nearly implemented and the only problem is that we cant make an image of the JLayerdPane's content.
maybe you have an idea or codesamples...
thanks a lot in advance!!
george

1. Getting any JComponent to render onto a buffered image isn't a problem -- just call paint, passing it a graphics object backed by that buffered image.
2. Writing an image to a file isn't a problem: use javax.imageio.ImageIO.
Some code:
import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
import java.io.*;
import javax.imageio.*;
import javax.swing.*;
import javax.swing.border.*;
public class Ex {
    public static void main(String[] args) {
        JFrame f = new JFrame("Ex");
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        final JLayeredPane pane = new JLayeredPane();
        Border b = BorderFactory.createEtchedBorder();
        pane.add(createLabel("DEFAULT_LAYER", b, 00, 10), JLayeredPane.DEFAULT_LAYER);
        pane.add(createLabel("PALETTE_LAYER", b, 40, 20), JLayeredPane.PALETTE_LAYER);
        pane.add(createLabel("MODAL_LAYER", b, 80, 30), JLayeredPane.MODAL_LAYER);
        pane.add(createLabel("POPUP_LAYER", b, 120, 40), JLayeredPane.POPUP_LAYER);
        pane.add(createLabel("DRAG_LAYER", b, 160, 50), JLayeredPane.DRAG_LAYER);
        f.getContentPane().add(pane);
        JPanel south = new JPanel();
        JButton btn = new JButton("save");
        btn.addActionListener(new ActionListener(){
            public void actionPerformed(ActionEvent evt) {
                save(pane);
        south.add(btn);
        f.getContentPane().add(south, BorderLayout.SOUTH);
        f.setSize(400,300);
        f.show();
    static JLabel createLabel(String text, Border b, int x, int y) {
        JLabel label = new JLabel(text);
        label.setOpaque(true);
        label.setBackground(Color.WHITE);
        label.setBorder(b);
        label.setBounds(x,y, 100,20);
        return label;
    static void save(JComponent comp) {
        int w = comp.getWidth(), h = comp.getHeight();
        BufferedImage image = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
        Graphics2D g2 = image.createGraphics();
        g2.setPaint(Color.MAGENTA);
        g2.fillRect(0,0,w,h);
        comp.paint(g2);
        g2.dispose();
        try {
            ImageIO.write(image, "jpeg", new File("image.jpeg"));
        } catch(IOException e) {
            e.printStackTrace();
}Why does the saved image have a magenta background? JLayerPane, by default, is non-opaque. You can set it to be opaque and choose its background color, as you like.

Similar Messages

  • How do I Create interactive images to be used in another website?

    Our office is contracted with a simple website company, so from the begining the framework is there. I want to add an interactive map that has each county hyperlinked to information about that area. I was told that Dreamweaver is the program I would need in order to create it.
    So, I have the program now but every tutorial I read is about making your own website in dreamweaver and I can't find anything about how to create the image to upload into a different website.
    Anyone know how to do this????
    Thank you!

    This helps, thanks. I have the content on the web page (where the hyperlinks will attach to), I have the image of the map, and I am making the shapes for the hotspots, just not how to get it all to link up.
    Also, when I saved a trial (just to make sure it would all work) it doesn't successfully upload as an image onto the website, just a little box with a red X. Any more thoughts anyone? 

  • How can I create an image gallery with "next" buttons?

    So I am almost done with my portfolio site (YES!)..now I just need the actual content (the images). My site is written in AS3.
    I've watched many tutorials on how to create an image gallery (auto scrolling ones, scrolling ones that require mouse hover, etc etc), but those aren't what I am looking for.
    I want a gallery that looks exactly like this one here:
    http://jalbum.net/res/help/integrating-tutorial.html
    I have a lot of work to display in my porfolio so there must be arrows at the end of the thumbnails so I can add more stuff. So I am just stumped on how to make the image gallery work with the ability to scroll for more photos with the click of the arrows.
    Any ideas? Thank you.

    Watching tutorials and learning from them are two different things.  If you have learned from them you should be able to use what you have learned to devise a gallery such as the one you link to.  If you have learned from them and cannot use what you learned, then you probably need to find/learn more.
    If you study the design you linked you should be able to reason out what elements you need to devise... it is not overly complicated. 
    For the large picture you could have a Loader into which you load whatever image is selected from the thumnails. To get a brief transition you could just set the alpha of the Loader to 0 when an image change is occuring and gradually fade it in after the image has loaded.
    The greatest challenge you are likely to face is in getting the thumbnails to advance back and forth depending on which is selected.  All of the thumbs would be placed in a container (movieclip or sprite) and that would be masked so that only a portion of them is visible. 
    All thumbs that are not selected have their alpha property set to some value less than 1.  Selecting one calls for the file it associates with to be loaded into the Loader.  If the choice happens to lie off screen, then you need to move the movieclip that contains all of the thumbs some set value in the right (+x) or left (-x) direction.
    If you want the thumbnails to wrap infinitely then when one leave the thumbnails area for movement in a direction, you need to take that thumb and relocate it to the other end of the thumbs in the container.

  • Creating javaFX Image with InputStream

    Hi,
    I have dataset(Medical Image data), i want to build a javaFX Image,
    Can some one help me how can i construct the image from this.
    is there any way creating a image other than using url?
    Thanks....

    Try this:
    var stream = A.class.getResourceAsStream( "lion1.png");
    Stage {
        title: "Image from stream"
        width: 250
        height: 280
        scene: Scene {
            content: [
                ImageView {
                    image: Image {
                        impl_source: stream
    }

  • Trouble with creating an image sequence in QT Pro 7.4.

    I'm having trouble creating an image sequence in QT Pro 7.4(Windows XP). I have a folder containing a JPEG sequence (alternative a PICT-Image sequenz). I Open image sequence, choose the image-frequency and choose the first image, but QT created only the first image in a self-contained movie. But, the same images with the same procedure with QT Pro 7.2 on another Windows XP- PC created a correctly self-contained movie. Is this a bug in QT Pro 7.4?
    Please help me and apologize for my bad english!

    You have to revert to an older version of QT. After Effects users are having the same issue. Here's a link to a temporary fix (reverting back to older version):
    http://www.adobeforums.com/webx/.3c05dee6
    1) I downloaded QT 7.3.1 from the Apple Support Downloads website.
    2) I downloaded Pacifist from their webiste
    3) I installed Pacifist on my machine
    4) I opened the QuickTime DMG file and drug the PKG file out of it
    5) I launched Pacifist and dragged the QuickTime 7.3.1 PKG file onto the Pacifist window.
    6) I clicked on "Contents of QuickTime531_Leopard.pkg" to select it in Pacifist
    7) I choose "Install" from the Pacifist menu at the top of the window
    It started installing and I chose "Replace" when ever it prompted me. You can actually click a little check box that says "Don't Keep Asking Me This" and then you don't have to click "Replace" a 1000 times.
    9) I restarted my computer (Intel Quad-Core 3 Ghz) went to System Preferences>QuickTime and checked that I was now actually running QT 7.3. YES!!!

  • Create Thumbnail Image in JSP

    I have JSP a page, were I want to show Thumbnail Image from specified path. The specified path contain one or more file. If anybody have the code or reference for doing this please replay. (For one image will also the helpfule for me)
    Thank You

    The following is what I use to create thumbnail images. It uses struts, is a bit of a haste work but never failed in creating thousands of thumbnails. I'd be glad if you suggest improvement.
    import java.io.*;
    import java.text.*;
    import java.util.*;
    import org.apache.struts.upload.FormFile;
    import javax.imageio.ImageIO;
    import java.awt.*;
    import java.awt.image.BufferedImage;
    import org.apache.log4j.Logger;
    * @author Niklas
    public class ClassifiedImage {
        Logger log = Logger.getLogger(this.getClass());
        /** Creates a new instance of ClassifiedImage */
        public ClassifiedImage() {
        public void generateImage(FormFile file, String outputFilename, String outputthumbFilename) {
            try {
                String type = file.getContentType();
                String name = file.getFileName();
                int size = file.getFileSize();
                byte[] data = file.getFileData();
                if (data != null && name.length() > 0) {
                    ByteArrayInputStream bis = new ByteArrayInputStream(data);
                    BufferedImage bi = ImageIO.read(bis);
                    int width = bi.getWidth();
                    int height = bi.getHeight();
                    Image thumb = null;
                    if (width > 600 || height > 600) {
                        Image scaledimage = null;
                        if (width > 600) {
                            scaledimage = bi.getScaledInstance(600, -1, Image.SCALE_SMOOTH);
                            thumb = bi.getScaledInstance(80, -1, Image.SCALE_SMOOTH);
                            BufferedImage scaledBuffImage = StrutsUploadAction.toBufferedImage(scaledimage);
                            BufferedImage thumbBuffImage = StrutsUploadAction.toBufferedImage(thumb);
                            int newWidth = scaledBuffImage.getWidth();
                            int newHeight = scaledBuffImage.getHeight();
                            int thumbBuffImagenewWidth = thumbBuffImage.getWidth();
                            int thumbBuffImagenewHeight = thumbBuffImage.getHeight();
                            if (thumbBuffImagenewHeight > 60) {
                                thumb = thumbBuffImage.getScaledInstance(-1, 60, Image.SCALE_SMOOTH);
                            if (newHeight > 600) {
                                scaledimage = scaledBuffImage.getScaledInstance(-1, 600, Image.SCALE_SMOOTH);
                            BufferedImage scaledthumbBuffImage = StrutsUploadAction.toBufferedImage(thumb);
                            BufferedImage scaledBuffImage2 = StrutsUploadAction.toBufferedImage(scaledimage);
                            int newWidth2 = scaledBuffImage2.getWidth();
                            int scaledNewHeight = scaledBuffImage2.getHeight();
                            String formatName = "jpg"; // desired format
                            File outputFile = new File(outputFilename);
                            File outputthumbfile = new File(outputthumbFilename);
                            if (width > 600 || newHeight > 600) {
                                boolean writerExists = ImageIO.write(scaledBuffImage2, formatName, outputFile);
                                boolean writerthumbExists = ImageIO.write(scaledthumbBuffImage, formatName, outputthumbfile);
                        } else if (height > 600) {
                            Image scaledimage2 = bi.getScaledInstance(-1, 600, Image.SCALE_SMOOTH);
                            thumb = bi.getScaledInstance(-1, 60, Image.SCALE_SMOOTH);
                            BufferedImage scaledBuffImage2 = StrutsUploadAction.toBufferedImage(scaledimage2);
                            int newWidth2 = scaledBuffImage2.getWidth();
                            int newHeight2 = scaledBuffImage2.getHeight();
                            BufferedImage scaledthumbBuffImage2 = StrutsUploadAction.toBufferedImage(thumb);
                            int newthumbWidth2 = scaledthumbBuffImage2.getWidth();
                            int newthumbHeight2 = scaledthumbBuffImage2.getHeight();
                            if (newWidth2 > 600) {
                                scaledimage2 = scaledBuffImage2.getScaledInstance(600, -1, Image.SCALE_SMOOTH);
                            if (newthumbWidth2 > 80) {
                                thumb = scaledthumbBuffImage2.getScaledInstance(80, -1, Image.SCALE_SMOOTH);
                            BufferedImage ndscaledBuffImage2 = StrutsUploadAction.toBufferedImage(scaledimage2);
                            BufferedImage ndscaledthumbBuffImage2 = StrutsUploadAction.toBufferedImage(thumb);
                            int n_newWidth2 = ndscaledBuffImage2.getWidth();
                            int n_newHeight2 = ndscaledBuffImage2.getHeight();
                            String formatName2 = "jpg"; // desired format
                            File outputFile2 = new File(outputFilename);
                            File outputfile3 = new File(outputthumbFilename);
                            if (height > 600 || newHeight2 > 600) {
                                boolean writerExists2 = ImageIO.write(ndscaledBuffImage2, formatName2, outputFile2);
                                boolean writerExists3 = ImageIO.write(ndscaledthumbBuffImage2, formatName2, outputfile3);
                    } else {
                        FileOutputStream fileOut = new FileOutputStream(outputFilename);
                        fileOut.write(data);
                        fileOut.flush();
                        fileOut.close();
                        BufferedImage b = null;
                        ByteArrayInputStream bi2 = new ByteArrayInputStream(data);
                        BufferedImage bufi2 = ImageIO.read(bi2);
                        int width2 = bi.getWidth();
                        int height2 = bi.getHeight();
                        Image thumbnail2 = null;
                        if (height2 > width2) {
                            thumb = bufi2.getScaledInstance(-1, 60, Image.SCALE_SMOOTH);
                            BufferedImage scaledBuffImagethumb = StrutsUploadAction.toBufferedImage(thumb);
                            int newWidth7 = scaledBuffImagethumb.getWidth();
                            int newHeight7 = scaledBuffImagethumb.getHeight();
                            if (newWidth7 > 80) {
                                thumb = scaledBuffImagethumb.getScaledInstance(80, -1, Image.SCALE_SMOOTH);
                            b = StrutsUploadAction.toBufferedImage(thumb);
                        } else {
                            thumb = bufi2.getScaledInstance(80, -1, Image.SCALE_SMOOTH);
                            BufferedImage scaledthumb = StrutsUploadAction.toBufferedImage(thumb);
                            int scaledthumbwidth = scaledthumb.getWidth();
                            int scaledthumbheight = scaledthumb.getHeight();
                            if (scaledthumbheight > 60) {
                                thumb = scaledthumb.getScaledInstance(-1, 60, Image.SCALE_SMOOTH);
                            b = StrutsUploadAction.toBufferedImage(thumb);
                        File f = new File(outputthumbFilename);
                        boolean bo = ImageIO.write(b, "jpg", f);
            } catch (Exception e) {
                log.error(e.getMessage(), e);
    }And the helper method:
    // This method returns a buffered image with the contents of an image
        public static BufferedImage toBufferedImage(Image image) {
            if(image instanceof BufferedImage) {
                return (BufferedImage)image;
            // This code ensures that all the pixels in the image are loaded
            image = new ImageIcon(image).getImage();
            // Determine if the image has transparent pixels; for this method's
            // implementation, see e661 Determining If an Image Has Transparent Pixels
            boolean hasAlpha = false;
            // Create a buffered image with a format that's compatible with the screen
            BufferedImage bimage = null;
            GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
            try {
                // Determine the type of transparency of the new buffered image
                int transparency = Transparency.OPAQUE;
                if(hasAlpha) {
                    transparency = Transparency.BITMASK;
                // Create the buffered image
                GraphicsDevice gs = ge.getDefaultScreenDevice();
                GraphicsConfiguration gc = gs.getDefaultConfiguration();
                bimage = gc.createCompatibleImage(image.getWidth(null), image.getHeight(null), transparency);
            } catch(HeadlessException e) {
                // The system does not have a screen
            if(bimage == null) {
                // Create a buffered image using the default color model
                int type = BufferedImage.TYPE_INT_RGB;
                if(hasAlpha) {
                    type = BufferedImage.TYPE_INT_ARGB;
                bimage = new BufferedImage(image.getWidth(null), image.getHeight(null), type);
            // Copy image to buffered image
            Graphics g = bimage.createGraphics();
            // Paint the image onto the buffered image
            g.drawImage(image, 0, 0, null);
            g.dispose();
            return bimage;
        }

  • Automatice sequence creater for image sequence

    Hi Friends,
    I got doubt where there is an option for creating an auto sequence, what i mean by is in avid when we load the source in the source monitor or viewer in FCP and when we want to overwrite it in the composer window or record monitor in avid it creates an automatice untitled sequence with the content since i no need to specify the format and blah blah blah.
    I have an image sequence and i dont no the format and frame size etc and i imported the sequence thru qt ref andi want it in an sequence without redering shown in my timeline.
    I hope u understand what i want to tell.
    thanx
    g.balaji

    With image sequences, probably the biggest thing to address is the pixel x pixel sizes of the stills. For maximum performance (and quality in my book), I like to have those Scaled to match the Frame Size of the Project Sequence. The PNG format should be just fine, but size DOES matter. What are the pixel x pixel dimensions of your stills?
    I do a lot of work with stills, but not usually in image sequences. For my work, I usually just leave the stills as PSD's, and never have any issues. These are Scaled to the Project, or only slightly larger (when I need to Pan on a Zoomed out image), and my Scaling is always done in Photoshop, prior to Import.
    Good luck,
    Hunt

  • Mistake creating an Image Map

    Hello, I have a problem with my Image Map. Here are my steps:
    1.Create areas for the Image Map
    2.Create the Image Map with areas
    3.upload the image
    4.create the OTH file
    5.Enable rendering information option
    6.Create KM navigation iView and its layout set mode as default
    All references for directories and for my pic are OK but it doesn´t show any Image Map. I need help please!
    Thank you

    Hi,
       You can follow this example:
    In KM, image maps are used for a graphical depiction of folder contents. These objects are displayed using graphics instead of in their normal text form.
    Step 1 – Determine the image you want to use for navigating. This can be any JPG or GIF file. In this example I will reference the file world.gif.
    Step 2 – Configuring an image map. Take your image file world.gif and place it in the system. For our example place the file in the path: …../knowledgemanagement/etc/public/graphics. The subdirectory “graphics” was created within the public folder.
    Step 3 – In the documents folder, create the following folders:
    •  World
         Within the “World” folder, create the subfolders:
         North America
         South America
         Europe
         Asia
    Note: you can create as many folders as you like. This structure will serve as the navigation structure for world.gif image map.
    Step 4 – Determine the navigation coordinates for the image world.gif. Any tool can be used, for this example the tool GeoHTML was used. It is a freeware tool that can be downloaded from http://www.fegi.ru/geohtml.
    •  The following coordinates were determined for the folders:
         North America: 253, 255, 303, 285
         South America: 424, 171, 474,201
         Europe: 368, 43, 418, 73
         Asia: 276, 37, 326, 67
    Step 5 – Create new link-sensitive Areas for the image map. Menu path: Configuration -> Content Management -> User Interface -> Image Maps -> Areas
    Please note, an area would need to be defined for each area on the image map that would be link-sensitive areas.
    Step 6 – Defining an Image Map. In this step the name of the image map will be defined as well as specifying the path of the image, the tooltip, and lastly assigning the areas.
    Step 7 – Configure an Object Type Handling (OTH) file for the image map. OTH files are located in the /oth subdirectory within the /etc repository. Copy an existing OTH file in this subdirectory and copy it to “world.oth”. In This OTH file, define the navigation path, collection renderer, layout controller, action and image map. The OTH file should look as follows:
      <?xml version="1.0"?>
      <ObjectTypeHandler Name="Image Map world"
    Class="com.sapportals.wcm.service.objecttypehandler.GenericObjectTypeHandler">
    <SelectionCriteria>
      <Paths>
        <Path>/documents/World</Path>
      </Paths>
    </SelectionCriteria>
    <Properties>
      <Property Key="rndCollectionRenderer"              Value="ImageMapRenderer"/>
      <Property Key="LayoutController"                   Value="DefaultLayoutController"/>
      <Property Key="rndShowActions"                      Value="false"/>
      <Property Key="rndMap"                      Value="MapOfWorld"/>
    </Properties>
    <Actions/>
    </ObjectTypeHandler>
    Step 8 – Display the image map. For the navigation iView that is being used, ensure that the iView property “Layout Set Mode” is set to default.
    Step 9 – Reload the object type handler in order for the system to read the new oth file world.oth. This can be done by within the Rendering Information link in any navigation iView for a user that is specified in the Debugging Settings (this is done in the user interface configuration).
    Another option to reloading the object type handler would be restarting the J2EE engine.
    Step 10 – In the navigation iView for this mage map, navigate to the image map. In this example, the menu path would be documents/World
    Patricio.
    ps: If you want I can send you complete example.

  • Creating specific image sizes on contact sheets

    I need to be able to create specific images size on contact sheets 1.75"x 2.25" on 24"w x ??"L paper. Anyone know how to do this?

    A script like my Paste Image roll. Paste Image Roll Script and Picture Package Support
    http://www.mouseprints.net/old/dpr/PasteImageRoll.jsx
    From my Photo Collage Toolkit
    Photoshop scripting is powerful and I believe this package demonstrates this A video showing a 5 image collage PSD template  being populates with images:
    The package includes four simple rules to follow when making Photo Collage Template PSD files so they will be compatible with my Photoshop scripts.
    Size the photo collage templates for the print size you want - width, height and print DPI resolution.
    Photo collage templates must have a Photoshop background layer. The contents of this layer can be anything.
    Photo collage templates must have alpha channels named "Image 1", "Image 2", ... "Image n".
    Photo collage templates layers above the background layers must provide transparent areas to let the images that will be placed below them show through.
    There are twelve scripts in this package they provide the following functions:
    TestCollageTemplate.jsx - Used to test a Photo Collage Template while you are making it with Photoshop.
    CollageTemplateBuilder.jsx - Can build Templates compatible with this toolkit's scripts.
    LayerToAlphaChan.jsx - Used to convert a Prototype Image Layer stack into a template document.
    InteractivePopulateCollage.jsx - Used to interactively populate Any Photo Collage template. Offers most user control inserting pictures and text.
    ReplaceCollageImage.jsx - use to replace a populated collage image Smart Object layer with an other image correctly resized and positioned.
    ChangeTextSize.jsx - This script can be used to change Image stamps text size when the size used by the populating did not work well.
    PopulateCollageTemplate.jsx - Used to Automatically populate a Photo Collage template and leave the populated copy open in Photoshop.
    BatchOneImageCollage.jsx - Used to Automatically Batch Populate Collage templates that only have one image inserted. The Collage or Image may be stamped with text.
    BatchMultiImageCollage.jsx - Used to Automatically Batch Populate Any Photo Collage template with images in a source image folder. Easier to use than the interactive script. Saved collages can be tweaked.
    BatchPicturePackage.jsx - Used to Automatically Batch Populate Any Photo Collage template with an image in a source image folder
    PasteImageRoll.jsx - Paste Images into a document to be print on roll paper.
    PCTpreferences.jsx - Edit This File to Customize Collage Populating scripts default setting and add your own Layer styles.
    Documentation and Examples

  • Create dynamic image, dump on server someplace and reference in JSP?

    I was thinking about creating dynamic images and referencing them on a JSP
              (creating them is ok). I'm sure this is a pretty standard thing, but I
              don't know how to do it. Any ideas? I tried doing a search on the BEA
              support site (nice changes :>) but nothing very accurate came up.
              Thanks.
              

    Assign an ID (e.g. 1234) to the uploaded file. You should abstract the store
              so that it will work on the file system or in the database.
              The JSP will include an image ref to that ID, e.g.
              http://www.myco.com/myapp/imageservlet?id=1234
              The image servlet will retrieve and stream the image. It has to set content
              type etc. You should also verify that the current user has access to the
              requested image if security/privacy is an issue.
              Peace,
              Cameron Purdy
              Tangosol, Inc.
              http://www.tangosol.com/coherence.jsp
              Tangosol Coherence: Clustered Replicated Cache for Weblogic
              "PHenry" <[RemoveBeforeSending][email protected]> wrote in message
              news:[email protected]...
              > Howdy. I just thought of something. If the img is coming across via the
              > stream, how do you reference it in the html/jsp file? I just thought
              about
              > that now as I was getting a cup of coffee. (I need to cut back! :>)
              >
              > Thanks.
              >
              >
              >
              >
              > "Cameron Purdy" <[email protected]> wrote in message
              > news:[email protected]...
              > > If you write it to a file, you are writing it to an OutputStream, right?
              > >
              > > Instead, just write it to the OutputStream that comes from the
              HttpRequest
              > > object. For example:
              > >
              > > <img src="http://www.mysite.com/myapp/my.jsp?name=whatever">
              > >
              > > That would hit your JSP (it would be better to use a Servlet in this
              case
              > > though), and you would stream back the image.
              > >
              > > Peace,
              > >
              > > Cameron Purdy
              > > Tangosol, Inc.
              > > http://www.tangosol.com/coherence.jsp
              > > Tangosol Coherence: Clustered Replicated Cache for Weblogic
              > >
              > >
              > > "PHenry" <[RemoveBeforeSending][email protected]> wrote in message
              > > news:[email protected]...
              > > > Interesting. I'm still a bit new to this stuff. Do you have/know
              where
              > > to
              > > > find some examples?
              > >
              > >
              > >
              >
              >
              

  • Failsafe method to create NetInstall image of pre-configured MacOSX

    Hi All
    I am trying to create NetInstall image of a pre-configured MacOSX install(mid-2011 mac mini) in this case.  Here is my workflow:
    1.  Setup base OSX Mountain lion
    2.  Do all updates and configure System Preferences and Finder Preferences as desired
    3.  Install all desired software to be packaged with the system
    4.  Boot into target mode and then use a second mac mini running Casper Composer to create a .dmg of the OS.
    5.  Copy the finished .dmg to ML Server
    6.  Try to use System Image utility to create a NetInstall image that other mac minis can then use as base install
    I havent had any success so far creating a valid .nbi folder I can use(and that works) for re-deployment unless I use Casper Admin and Casper Imaging to manage this.  The reason I am trying to get away from using them is that the differnece between buying a $70 Casper Composer(or using the free Disk Utility) and buying the full Casper Suite is considerable.  Also, my understanding of System Image Utility is that:
    1. It should be possible to build a customised image of OSX from base with packages and coonfiguration added but it doesnt seem to work
    2. NetInstall is the only viable option for what we want to do as NetBoot presumes you will boot off the image each time you start up(which is not what we want - we want the ability to clone systems and from bare metal if necessary) and NetRestore flatly doesnt seem to work from .dmgs.
    Here is what I have found:
    a) I can create NetInstall images from a mounted downloaded Apple-provided OSX Installer that work but as soon as I put customisations in them, the customisations fail.
    b) By default NetInstall is greyed out when you mount the dmg and use it as a source in System image utility.  Suggestions online are to change the Source to use a New variable and then point it back at the same location.  NetInstall is then available.  If you try to create a .nbi from this, you get an error saying that there isnt enough space on the target drive - the uncompressed dmg is about 7GB max and there is a spare 60-70Gb free on the drive I am trying to create the image on.
    c) I have tried manually creating the .nbi folder but the instructions I found at http://support.apple.com/kb/TA21133 for doing this are outdated as they apply to ppc firmware and although I suspect the technique will still work, I cant work out which elements of the i386 folder I need to retain/move.  Copying the i386 folder from another working Netinstall folder doesnt help.
    d) I found some links suggesting that NetInstall only worked when the OSX versions were identical so I tried to run the System Image Utility on the Mac where the dmg was created.  Here I get two errors:
         i) If I just run the NetInstall using the default source, it errors saying an unknown error has occurred and get the following in the log:
    Workflow Started (2013-08-21 11:39:45 +0100)
    OS X 10.8.4 (12E55), System Image Utility 10.8.3 (624)
    Starting action: Define Image Source (1.4)
    Finished running action: Define Image Source
    Starting action: Create Image (1.7.2)
    Starting image creation process...
    Create NetInstall Image
    Failed to validate the install type!!! Error: The source volume is not an OS X 10.8 volume.
    An unknown error has occurred.
    An unknown error has occurred.
    Image creation process finished...
    Stopping image creation.
    Image creation failed.
         ii) If I change the source to the .dmg file and unmount it quickly to avoid any file locks, the installer goes further and seems to almost finish but then gives the following error(just appending the final bits):
    + echo 'Detaching disk image'
    Detaching disk image
    + '[' DEBUG == DEBUG ']'
    + /usr/sbin/lsof +fg /tmp/mnt.UJaQAiTy
    COMMAND PID USER   FD TYPE FILE-FLAG DEVICE SIZE/OFF NODE NAME
    mds 36 root   24r   DIR R,EVO    1,5      306 2 /private/tmp/mnt.UJaQAiTy
    + '[' '/dev/disk1s2 on /private/tmp/mnt.UJaQAiTy (hfs, local, nodev, nosuid, nobrowse)' '!=' '' ']'
    + /usr/bin/hdiutil detach /tmp/mnt.UJaQAiTy
    "disk1" unmounted.
    "disk1" ejected.
    + /bin/rmdir /tmp/mnt.UJaQAiTy
    + return 0
    + '[' '' '!=' '' ']'
    + /bin/rm -r '/Users/admin/Documents/NetBoot of Untitled 1.nbi/i386'
    + /bin/rm '/Users/admin/Documents/NetBoot of Untitled 1.nbi/NetInstall.dmg'
    + /bin/rm '/Users/admin/Documents/NetBoot of Untitled 1.nbi/System.dmg'
    + /bin/rmdir '/Users/admin/Documents/NetBoot of Untitled 1.nbi'
    + exit 1
    Script is done.
    Bridge exited with status 256
    Failed to create image from restore source.
    An unknown error has occurred.
    An unknown error has occurred.
    Image creation process finished...
    Stopping image creation.
    Image creation failed.
    Anyone have any idea how I can get around these issues?

    First, let's define the various image types...
    NetInstall:
    A network based image which, when booted into, presents the user with a Mac OS installer. Functionality is effectively the same as running the Install Mac OS X application locally on a machine.
    NetRestore:
    A network based image which, when booted into, uses Apple Software Restore to replace the contents of a volume with a previously imaged volume.
    NetBoot:
    A network based image which, when booted into, acts just like a locally booted hard drive, except no changes are written to the disk. Each time the client boots into the NetBoot volume, the system is "reset" to the original state.
    As defined by your workflow, you are trying to create NetRestore images.
    As piperspace has noted, you need to start with the latest OS Install application. Starting with an older OS which has been updated to the latest will not work.
    Creating NetRestore images from other disk images doesn't work because you need to have the Recovery Partition available. As both chicster and piperspace have noted, the way to do this is to image the volume directly.
    Many preferences are "ByHost", which means that they are keyed to the UUID of the machine they are set on. To make those settings transfer to the new machines, you may need to use the "Apply System Configuration Settings" action and check the "Change ByHost preferences to match..." option.

  • Can't create CD Image

    Hi,
    I'm having trouble creating a CD Image in Disk Utility. I insert the CD and then open Disk Utility. I then highlight the CD drive and click on New in the menu. The problem is that the "Disc Image from Device" option is greyed out. Does someone know why this option can't be selected?
    Thanks,
    James
    Ibook G4 1.2GHz, 768MB   Mac OS X (10.4.5)  

    Hi James,
    You will want to select the contents of the CD, and not the CD itself.
    There should be a sort of file "tree" shown in Disk Utility.
    Disk - Session - Files (or similar)
    Try selecting Session or Files and I believe the option to create an image from device will be open to you.
    Good luck.

  • Which is the best app to create cartoon images on that i can move around to other apps and animate to create cartoons

    which is the best app to create cartoon images on that I can move around to other apps and animate.  I want to create the image only, no background or anything

    Hi Susan,
    Kindly check out Flash pro CC
    For more details: Explore Adobe desktop apps | Adobe Creative Cloud
    Thanks,
    Atul Saini

  • Class casting, creating an image and decompiling...

    Hi, I've got a couple of questions:
    1)
    How can I fully decompile classes, so with the implementation of the methods? Is it always possible to fully decompile a class file? When is it and when not?
    2)
    I aks this questions before, but I still haven't got it working, so sorry, but I ask it again :) :
    I want to create my own class, for example cMyClass which extends the java.awt.Image class, which has abstract methods. How do these methods(for example getGraphics etc) have to be implemented?
    3)
    I can't cast a Image to cMyClass... why not?
    Someone told me he did the following:
    Canvas c = new Canvas()
    cMyClass oImage = (cMyClass) c.createImage (100, 100);
    and that this worked... I tried to do this too, and it seemed to work, but it actually didn't!!
    I found out that c.createImage returns a null reference!!! That's why Java was able to cast it to my own cMyClass (not a problem to cast a null to something else), but when I created a Image (by doing a lot of unnessacary difficult stuff), and then tried to cast this Image to cMyClass it throw a ClassCastException or something like that...
    How can I cast the java.awt.Image class to my class anyway?
    3)
    Why can't you create a image like i've done above or even like below:
    Canvas c = new Canvas()
    Image oImage = c.createImage (100, 100);
    Why does this return a null reference?
    Isn't there a better way to create an image?
    4)
    The getWidth and getHeight need a I thought observer...? Why is this? I just want the width and height and don't have an observer or something like that. Is there a way around this?
    I tried getWidth(null) but this returns -1
    Please help! :)

    Hi, I've got a couple of questions:
    1)
    How can I fully decompile classes, so with the
    implementation of the methods? Is it always possible
    to fully decompile a class file? When is it and when
    not?You can always get a dump of the bytecode with 'javap -c'. If you don't want to figure things out yourself, try searching google for a class file decompiler, possibly a de-obfuscator.
    De-compilation is completely possible if the original author wanted that, by including debugging information. Depending on the degree of such information and the amount of code obfuscation, the decompiled code may lack variable names, line numbers, field and method names, class names, and even code structure. Names and line numbers are usually not re-creatable automatically, since the information is simply lost, but you can replace them with your own strings when analyzing an unknown class file (using the correct tools). Re-creating the original code structure may work in some cases, but to me the general case looks rather close to the halt problem (i.e. not solvable).
    Use a de-obfuscator, hope you've got good luck, and analyze the bytecode manually if that doesn't work.
    2)
    I aks this questions before, but I still haven't got
    it working, so sorry, but I ask it again :) :
    I want to create my own class, for example cMyClass
    which extends the java.awt.Image class, which has
    abstract methods. How do these methods(for example
    getGraphics etc) have to be implemented?I don't really understand the problem. 'abstract' means on the language level that your subclass must provide an implementation, i.e. a method body. What that method is expected to do is explained in the javadocs for Image. But in fact you're free to do anything. You could play a sound in the getWidth() method (replace with any method name if you want). Just consider the fact that a lot of code calls getWidth in the hope of getting the width of the image, not playing a sound. So much about the language level.
    On a higher level, a subclass of Image should implement a certain way to describe an image. AFAIK this means that your code must know the size of the image and know how to produce the pixels of the image. I can't tell you in general how you must do this, because it depends on your special case. This boils down to the question, why do you want to write a subclass of 'Image'? What new way of describing and image have you come up with?
    3)
    I can't cast a Image to cMyClass... why not?Simple, and that's certainly not an ALT. Because that specific Image is not a cMyClass. It's probably a BufferedImage or similar that was produced by AWT.
    Please read the specs carefully what casting is about.
    Someone told me he did the following:
    Canvas c = new Canvas()
    cMyClass oImage = (cMyClass) c.createImage (100,
    100);
    and that this worked... I tried to do this too, and it
    seemed to work, but it actually didn't!!
    I found out that c.createImage returns a null
    reference!!! That's why Java was able to cast it to my
    own cMyClass (not a problem to cast a null to
    something else), but when I created a Image (by doing
    a lot of unnessacary difficult stuff), and then tried
    to cast this Image to cMyClass it throw a
    ClassCastException or something like that...
    How can I cast the java.awt.Image class to my class
    anyway?You can't, and if you understood casting then you'd understand that it wouldn't make sense.
    3, 4(don't know)
    Maybe stupid question, but for example the BufferedImage, is this
    completly written in Java?
    How is the link made between the OS+hardware and the Java code? I
    mean, displaying images etc. is very platform dependend not?Look for JNI (Java Native Interface). It's a way to link native (e.g. C) code with Java code.

  • Unable to create Disc Image from DVD

    I get the following error when trying to make a copy of a family wedding DVD. I'm using Disc Utility and creating the image as a DVD/CD master (.cdr) file. It gets to about 3/4 of the way and then gives the following error.
    The internal drive is a PIONEER DVD-RW DVR-K05
    Sep 10 22:13:24: Disk Utility started.
    Creating Image “Wedding of xxx & xxx.cdr”
    Reading VOLUME_IDENTIFIER (Apple_UDF : 0)...
    Unable to create “Wedding of Sarah & Federico.cdr” - Input/output error.
    I've tried twice now and the same error. Looks like I might have to use Toast/Popcorn etc?
    Thanks,
    Darren
    iMac G5 2.1GHz 1Gb RAM 260Gb HDD   Mac OS X (10.4.7)  

    I do not know what that error means. However, if you open up the Disk Utility & go into it's Help Menu & in the search field type duplicating a CD or DVD. There you will find detailed instructions on how to create a disc image from a DVD.
    Good possibility your answer may be found there and/or there may have been something you missed in creating a disc image.
    Good luck.

Maybe you are looking for

  • Old compy's hard drive erased-how do i get songs back on new compy?

    kinda complicated... had itunes and ipod mini for about 1 1/2 years. My lovely computer's hard drive was completely wiped out by a virus (and i wasnt maintaining it well =/) and my parents bought me a new compy. I still listen to my ipod mini... but

  • Broken Keypad Key

    The 'X' or '8' key from my 9700 got plucked out and I am now missing this key! Is there anyway I can replace just this key or do I have to get a new phone. Thanks for any help. M1

  • OSB project deployment problem with MFL file

    Hi, I have created a OSB project to transform a xml message into a text file. For this I have created a mfl and the necessary proxy/business service. I can generate the sbconfig.jar from OEPE tool. But while trying to deploy the sbconfig.jar (generat

  • OO-me qustion

    Hi, i learn about oo abap and i want to ask about ME , what does me->category is initial. commend is doing? method DISPLAY . data: ls_vt001w type v_t001w. if me->category is initial. CLEAR ls_vT001W. ls_VT001W-MANDT = SY-MANDT. ls_VT001W-WERKS = me->

  • JOB WORK SECANRIO.

    Dear Gurus, We recevie a material for Job Work in our plant .to process this material we have use certain of our in house raw materials and then send it back after processing . the material coming into our plant is enter as Non Valuate material as it