JOGL and Large Background Images

Hullo gurus! :)
I'm having trouble with converting my work-in-progress RTS-style game from using Graphics2D into a (hopefully) faster JOGL format.
In my current approach, I've got a 2000x2000 pixel JPG which contains the entire map. Units and structures are layered on top of the background image, and nature takes its course.
Now, I'm trying to figure JOGL out, and have picked up a book and read a number of samples within, as well as around the web. One of the examples from this very site suggested a process of converting the image into a format that would display as expected on the screen. The code snippet looks something like this:
        Image i = Toolkit.getDefaultToolkit().createImage ("Map_0_0.jpg");
        MediaTracker tracker = new MediaTracker(new Canvas());
        tracker.addImage (i, 0);
        try {
            tracker.waitForAll();
        } catch (InterruptedException ie) {}
        dukeHeight = i.getHeight(null);
        dukeWidth = i.getWidth(null);
        System.out.println ("Got image, width=" +
                            dukeWidth + ", height=" + dukeHeight);
        // turn it into a BufferedImage
        WritableRaster raster =
            Raster.createInterleavedRaster (DataBuffer.TYPE_BYTE,
                                            dukeWidth,
                                            dukeHeight,
                                            4,
                                            null);
        ComponentColorModel colorModel=
            new ComponentColorModel (ColorSpace.getInstance(ColorSpace.CS_sRGB),
                                     new int[] {8,8,8,8},
                                     true,
                                     false,
                                     ComponentColorModel.TRANSLUCENT,
                                     DataBuffer.TYPE_BYTE);
        BufferedImage dukeImg =
            new BufferedImage (colorModel, // color model
                               raster,
                               false, // isRasterPremultiplied
                               null); // properties
        Graphics2D g = dukeImg.createGraphics();
        // use an AffineTransformation to draw upside-down in the java
        // sense, which will make it right-side-up in OpenGL
        AffineTransform gt = new AffineTransform();
        gt.translate (0, dukeHeight);
        gt.scale (1, -1d);
        g.transform (gt);
        g.drawImage (i, null, null);
        // now retrieve the underlying byte array from dukeImg
        DataBufferByte dukeBuf = (DataBufferByte)raster.getDataBuffer();
        dukeRGBA = dukeBuf.getData();       
        g.dispose();However, on the "g.drawImage (i, null, null);" line, I get the "Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space.
Am I doing something dumb? Is there a better approach that will let me render everything the way I'm trying to? Any advice would be greatly appreciated... :)
-Squeakz

> This is not good as I have a background image next the
header.
VIEW | Visual Aids > Hide All.
> and open the predefined template and save as a page.
This is wrong, wrong, wrong. Please read the F1 Help for how
to properly
create child pages from your templates.
All links in the TEMPLATE file should be one of three kinds -
1. Relative to the template file, e.g.,
<a href="../ (meaning that you must go up one level from
the template folder
to reach the root of the site, hence all other files, since
none of them
should be in the templates folder)
2. Relative to the site root, e.g.,
<a href="/ (meaning that one would begin looking for the
linked file at the
root of the site and follow the pathing from that point)
3. Absolute, e.g.,
<a href="
http:// (meaning that the link is to a page
external to the site).
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
==================
"lister110" <[email protected]> wrote in
message
news:fl3bi5$g4s$[email protected]..
> Hello everyone...
>
> I have just started using dreamweaver, and want to be
able to use
> templates. I
> have started with a basic page. Now there are a few
things that seem odd.
> Once
> I have defined the page as a template and selected a
header 1 say and
> define as
> an editable region the section nudges down slightly to
reveal the editable
> caption. This is not good as I have a background image
next the header.
> Anyway,
> I then save the template and open the predefined
template and save as a
> page.
> But all my background images have disapeared? even the
css tab shows no
> background images all. Whats going on with templates???
>
> I am using Dreamweaverv Cs3 on a PC running windows xp
>
>
> help..
>
>
> lister
>

Similar Messages

  • How Can Make a Large Background Image For A Website (reduced file size)?

    Hi, I want to edit a large photo so that it fits the width of the browser (I'm using a responsive layout). The image needs to be a small file size so that it loads quick enough.... My question is are their any tricks or adjustments within Photoshop where I can reduce the file size of an image whilst maintaing large image size. I heard that adding noise can reduce the file size or something? Is there any other effects that do this?
    Thanks in advance!!!

    twenty_one wrote:
    JJMack wrote:
     If I were stuck in an area that only had low speed Internet connections I would not use the web as much as I do.
    Where do you get this stuff...?   About the only thing I do strictly for fun on the internet is this and a couple of other forums. Other than that it's strictly business and I really don't have a choice in the matter. So there I sit, patiently waiting, counting 0, 1, 1, 0, 0, 1, 1, 1....
    You making my point if all you have is slow Internet connection you use the web less. You only use it when you have a real need.  You do not use it for fun or streaming video you live with the reality of what you have and use it accordingly.
    In 2003 I took a long vacation to New Zealand and Oz land.  I carried my ThinkPad with its 15" IPS 1600x1200 px Display for Photoshop and storing my images. I also use for connecting to the Internet via modem for E-mail and banking not for fun.  These days you can carry a iPod in you shirt pocket and gab a cup of coffee at a local Starbucks a use a high speed wireless in access point they provide for their customers for free.  High speed in becomming the norm in all but rual areas.

  • How to select and edit background images in templates?

    I open a template in pages ('elegant brochure' for example) and there is a background image that takes up the entire background of the page. When I click on the image, instead of being surrounded by the 6 little circles (that allow resizing) there are little x's. I can't move or change the image. I thought this was a master object, but it does not have blue circles, and I have 'master objects selectable'. I find it a little annoying that I want to use a prepared template but edit it beyond what apple gives me. Why can't I have more control (short of making a template from scratch)? How do i edit the images that have x's surrounding them?

    easiz,
    The x's indicate that it's a locked object. Click on Arrange > Unlock to edit it.
    -Dennis

  • Problems with XleTView and the background image

    Hello!
    I�m a student trying to develop aplications with MHP, i am actually using XleTView 0.3.6.
    I�ve traying to show a background image but but nothing appears in the background. I have tryed with Steven Morris's HaviExample and with other codes found in the internet and in this forum.
    As i have read, with this version of Xletview its not neccesary to have an I-Frame so i�ve been trying with .jpg, .png, .gif...
    actually if i try with an .mpg this appears:
    [XleTView]-INFO->org.havi.ui.HBackgroundDevice:
    At the moment XleTView always return a HStillImageBackgroundConfiguration here
    [XleTView]-INFO->org.havi.ui.HBackgroundImage:Display of .mpg is not yet supported.
    A workaround for now is to use a .jpg with the same name.
    xjava.io.File - Menu1.jpg
    and i have the Menu1.jpg in the right directory, but nothig appears. I've tryed the 0.3.5 too. Someone can help me?
    Thank you!!

    Finally i have resolve the problem, i have used this code to resize the video layer (maybe is usefull for someone):
    ServiceContext serviceContext = null;
            Player player = null;
            try{
                 serviceContext = ServiceContextFactory.getInstance().getServiceContext(context);
            } catch(ServiceContextException ex){
                 ex.printStackTrace();
            ServiceContentHandler[] handlers = serviceContext.getServiceContentHandlers();
            for(int i = 0; i < handlers.length; i++){
                 if(handlers[i] instanceof Player)
                     player = (Player)handlers;
    AWTVideoSizeControl awtVideoSizeControl;
    if (player != null) {
    awtVideoSizeControl = (AWTVideoSizeControl) player.getControl("javax.tv.media.AWTVideoSizeControl");
    awtVideoSizeControl.setSize(new AWTVideoSize(new Rectangle(0, 0, 720, 576), new Rectangle(0,0,0,0))); 

  • When I try to print, I get one page with a header and the background image, another page with the content, and a third page with a footer and background image. How can I make it print properly?

    Also, if I print to a .pdf, the background does not show up even if I have the checkbox checked to print background image.
    The site I'm trying to print is:
    [http://www.puertovallartatours.net/coupons-discounts.htm http://www.puertovallartatours.net/coupons-discounts.htm]

    I did not have the HP printer software for Mac OSX installed properly. Once installed the problem went away.

  • UNDO Management - Config changes for OLTP and large background processes

    Hi,
    I am running 9i on a 2 node RAC cluster - Sun Solaris.
    I use Automatic Undo.
    The database is currently configured for OLTP and has 2 undo datafiles - 1GB in size and undo_retention set to default (900seconds)
    I am about to start scheduling a batch job to run each night that will delete approx 1 million records each time it runs.
    To get this to work without the dreaded Error -30036: ORA-30036: unable to extend segment by 8 in undo tablespace 'UNDO01', I have increased the undo datafiles to 5GB and the undo_retention to 4000.
    The question is do I need to worry about switching between these settings - using the smaller values for daytime OLTP and the nighttime settings for the heavy processing?
    What issues might I encounter if I just left the UNDO Management settings in place that I use for the large delete?

    I would say no, leave the settings the highest level required to accomplish the work of the instance. Once the setting are correct for the instance, you should not have to change them around. They are really max setting for the heaviest load on your instance.

  • Spacing of Spry Menu submenu items, and inserting background images

    Hiya, need a bit of help, could someone possibly guide me with this?
    I've created a Spry Menu in DW CS5 - so far, so good.. However I'm pretty new to CSS Styles so need pointers at what to change to get the result I need. I've created the spry menu, however the submenu dropdown items are not flush to the ones above, theres a 1px horz gap between each item and while it looks okay, its particularly visible in Firefox and Chrome and would prefer no spacing at all..
    The live site is at http://www.ebm.co.uk/2011site/indexnavbar2.html
    if you take a look at the drop down menu bar you'll see what i mean - what do I need to do to remove the spacing?
    I also want to replace the solid colour with images, where do I specify the images for 1) top menu item 2) submenu item and 3) 'hover' item, and do I need to make any areas transparent?
    Any advice would be much appreciated.. thanks!
    Chris

    This is a good place to start http://www.dwcourse.com/dreamweaver/ten-commandments-spry-menubars.php.
    Also this might help http://labs.adobe.com/technologies/spry/samples/menubar/CenteringHorizontalMenuBarSample.h tml
    Gramps

  • Centering a webpage and a background image

    Can anyone help

    Yes.
    Please give more details about what you want to do.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "jingley" <[email protected]> wrote in
    message
    news:ecf1bk$km4$[email protected]..
    > Can anyone help

  • Background images flickering and turning black on scroll in published site, but in not preview.

    The background images are very flickery and turning black when scrolling when viewing published site in Safari.   This just started happening today after working on this for a few weeks now and the first time I'm noticing it.   Everything is still ok in preview mode.  All the large background images are optimized to be 500kb or less (they are all just placeholders).
    http://ics0913.businesscatalyst.com
    Any help would be appreciated.  Thank you.

    that is so strange, i had the location "image/rotator/......" for all three of my images in the js file and only the third one works?
    i believe they are all loading up fine as of this moment, just like they were yesterday, but not this morning when i first arrived at work. i wonder what changes the location by itself.
    hopefully the same thing won't happen again. 
    as for the text problem, thanks for pointing that out, i really appreciate it! but our office has been quite understaffed for a while, and no one here really knows anything about web maintenance. hopefully someone will fix those problems some day.
    thanks again bregent!

  • I'm getting ugly vertical stripes at pictures and background images on my HTC One S.

    I like using Firefox on my HTC One S, syncing the browsing history and bookmarks really comes in handy.
    But however, sometimes i get ugly stripes above some images. When resizing the site, they sometimes disappear. It happens only with images and css-background images.
    A few screenshots: https://www.dropbox.com/sh/tq47ved3p1qe766/0KiMvzEHSD/screenshots/firefoxbug

    I think you can thank Apple for this.  See this discussion.
    Photoshop CC: MacOS 10.10 Yosemite: Graphics driver problem
    Nancy O.

  • Full bleed background images

    I have full bleed background images. They load correctly (proportionally) and quickly  in firefox. In internet explorer, they take a long time to load and they are scaled disproportionally.  Once I change the size of the browser window, they adjust to the correct scale. Once a page has gone through this motion, it stays correct when revisiting the page. On another computer, also in IE , they load incorrectly at first and after a few seconds, adjust to the correct scale.  What can I do make sure the images load correctly in all internet browsers?

    With CSS:
    body {background: url(your_BGimage.jpg) repeat}
    You need to use small, seemless images strips or tiles that are suitable for repeating across and down the page.
    http://alt-web.com/Backgrounds.shtml
    Large background images or photos do not resize in browser unless you build your site entirely in Flash.
    Font-size is dependant upon the end user's browser settings.   Viewport size doesn't effect text size.
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics |  Print | Media Specialists
    www.alt-web.com/

  • How to build proportionally scaled, full bleed background images correctly

    How do I build full bleed proportionally scaled background images that proportionally scale to different sizes of browser windows and without leaving any blank spaces at the right or bottom? How do I make sure that the text also scales proportionally?

    With CSS:
    body {background: url(your_BGimage.jpg) repeat}
    You need to use small, seemless images strips or tiles that are suitable for repeating across and down the page.
    http://alt-web.com/Backgrounds.shtml
    Large background images or photos do not resize in browser unless you build your site entirely in Flash.
    Font-size is dependant upon the end user's browser settings.   Viewport size doesn't effect text size.
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics |  Print | Media Specialists
    www.alt-web.com/

  • Colour background images changes when applying effect

    Hey,
    I created a page, with a large background image in the back. When applying an effect (like shadow, or transparency) to text above, the colour of the image below changes, it becomes less saturated. This persist even when exporting and viewing in Acrobat Reader.
    Im using InDesign CS3 with Windows XP SP2
    Greets!

    Try changing your transparency blend space to RGB.
    Bob

  • Background image causes horizontal browser scrollbar

    We have a large background image on a website so that people can change the size of their browser window amd still see the background image. The image is also part of the page design so we can't use any of the scale options. All page content is centred and there are no objects other than the background image anywhere outside the 940 pixel wide centre column.
    The problem is that the background image is causing the horizontal scroll bar to appear at the bottom of the browser, which is undesirable. Worse is that the scroll bar is not centred, it is instead all the way to the left. Can this behaviour be fixed in the next update please?

    Figured out what was causing it (the footer, d'uh!). Any ideas on how to fix the footer up so it doesn't do that? The footer has an image the same width as the page background.

  • HTML background image stops being replicated in long page

    This is a straight HTML (no JavaScript, no CSS) page with a tiled background image (128x128 pixel JPEG). After about 2/3 of the roughly 3,000 lines of this page the background image stops, with a smooth horizontal divide: the tiled image background above, and a white background below. The discontinuity moves up and down some while scrolling this page, but remains a clean horizontal break.
    This is new behavior with Firefox 7. The background image was displayed throughout the full page with Firefox 6 and earlier.

    Hi vestibule, the home page renders out to 42072.5px tall, and Firefox has a bug that limits backgrounds to a height of approximately 32735px tall. See [https://bugzilla.mozilla.org/show_bug.cgi?id=671302 Bug 671302 – cairo-gdi: large background-images and gradients don't work beyond ~ 32735px].
    This bug is coming up on a year old and for some reason hasn't been fixed yet, perhaps because such long pages are relatively rare on the web. ??
    Until that is resolved, to make the "transition" less jarring, you can add a matching background color (this is the closest I can come up with at the moment):
    <br>body {
    background-image: url(Image_Files/parchmnt.jpg);
    background-color: #f8f8d4;
    }

Maybe you are looking for