J2me newbie graphics questions

Hi all.
I've been messing with J2SE for a while but now I'm looking at J2ME for games on mobile phones.
I've got a few questions which I'd appreciate any input on.
1) Could you please point me towards somewhere I can get a comparison of screen dimensions/colour depth of current common mobile phones. E.g. what is the minimum/maxiumum dimensions I could expect to find on current devices capable of using java MIDlets (I'm currently looking at Nokia's N-Gage at 176x208,12bpp and 7210 at 128x128 but I've seen res low as 96x65 mono so any help is much appreciated).
2) As far as I'm aware, I can't scale Graphics image draw function so I'd have to pre-calculate it in code if required. Is this right?
3) I haven't found any way to draw an area of an image (only the entire image) in the basic Graphics class. Is there any way to do this, or even to make a new Image which references the same source data but uses a different stride?
4) I understand that there is no support for translucency, but does punch through transparency work OK? If so then is there any significant hit for using it (in general, as it could vary dramatically with different hardware).
Thanks in advance.
-nmk

P.S: Any comparisions of memory size and screen latency would also be helpful. thanks!

Similar Messages

  • General place for newbie datamodeler questions?

    With the production release of SQL Developer Data Modeler I'd assume that this forum will draw a bunch of new users. Is there a better place to ask some pretty simple, newbie like questions that won't bother the more seasoned members?
    For instance, I am working in a Rails environment, which has some stringent naming conventions, one of which is that all of the primary key columns are numeric and called "id", with the foreign key linked columns called <table_name>_id.  When engineering a logical model to a relational model, the added foreign key columns are all "id#".  Is there a way I can define a naming rule to keep me from having to redo the relation column names?
    Also, we have a standard set of columns (mostly Rails related) which appear in every table. Can I define a generation rule which automatically includes these tables?
    Thanks

    Thank you. I will try changing that setting.
    IS there a setting which tells the relational model to automatically create pk and fk indexes? I haven't seen one, and manually setting them up is a tedious task. --sw                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Newbie script question... consecutive numbers with update.

    complete newbie type question... this is also my first post.  ( I am using CS3)
    does anyone have a script which can make it so I can add numbers into the text consecutively.
    for example, if this is my text "the big fat dog sat on the very wide mat, but was then displaced by a unfriendly cat."
    and I wanted to place a number 1, number 2, 3, etc at points in the text so it read, "the big fat dog1 sat on the very wide mat2, but was then displaced by a unfriendly cat3." but later wanted to add another number and have later numbers update themselves, so the text then said, "the big fat dog1 sat on the very wide mat2, but was then displaced3 by a unfriendly cat.4".
    by inserting the three, the previous three became four.
    Has anyone got something which might be useful in this regard.
    Many thanks
    Steve

    i wanted to avoid footnotes as they leave a bar at the bottom of each page.
    i wanted a script to do something similar to footnotes but not much further.
    does anyone have just a simple script that can do what I asked?
    Steve

  • Newbie XSan question - authenticating a computer from XSan Admin

    Hello - I have a very newbie XSan question!
    I have 2 computers that connect to an XSan. 1 I am having no problems with. The other I am unable to connect with.
    When I look in XSan Admin the 2nd computer (the one that is not working) is not authenticated.
    So I click on it and choose Authenticate. I enter what I know is an Admin username and password for the computer I am attempting to connect. The dot next to the computers IP turns green with 3 dots in it and then it turns gray again. It just does not connect.
    What is the problem?
    Is it licensing?
    Thanks
    Taj

    You need a different license ID for each machine, plus the admin machine. Do you have that?

  • MP 1.1 graphics question

    Mac Pro 1.1 graphics question
    I know this question has probably been posted to death but is it true that in a MP 1.1 we can't use the EVGA GeForce GTX 285? and if not.. what is the best upgrade option? this what I currently have..
    NVIDIA GeForce 7300 GT:
    Chipset Model: NVIDIA GeForce 7300 GT
    Type: GPU
    Bus: PCIe
    Slot: Slot-1
    PCIe Lane Width: x16
    VRAM (Total): 256 MB
    Vendor: NVIDIA (0x10de)
    Device ID: 0x0393
    Revision ID: 0x00a1
    ROM Revision: 3011
    Displays:
    Model Name: Mac Pro
    Model Identifier: MacPro1,1
    Processor Name: Dual-Core Intel Xeon
    Processor Speed: 2.66 GHz
    Number Of Processors: 2
    Total Number Of Cores: 4
    I really appreciate the help.. looking for at least 512 memory but was hoping for 1 gig...

    For what its worth, the NVIDIA GT 120 card will NOT work on the MAC PRO 1,1
    As I understand it, the newer mac pros use a 64 bit EFI boot prom, while our older 1,1 machines use a 32 bit EFI. The proms on most newer graphics cards won't initialize right at boot. Some ATI cards supposedly have both 32 and 64 bit firmware on the proms.
    I had hoped that if I put both NVIDIA cards in, I might still get the EFI to boot on my old 7300 GT card and then have OS-X recognize the newer card for an additional monitor and/or an openCL GPU. It was relatively cheap, but I never got it to work.
    Given the number of web posts that had incorrectly implied the NVIDIA should have worked in my machine, I decided not to try again on one of the more expensive ATI cards.

  • J2me Newbie question

    Hi,
    I am new to j2me programming, and I've been trying to run an app that uses:
    javax.microedition.media.control.VideoControl
    But I don't seem to have a library that contains this class...
    Where can I find such a library? I understood it's in the MMAPI, but how do I use it?
    Thanks!
    Dave

    daveblat2000 wrote:
    Hi,
    I am new to j2me programming, You realize this isn't the J2ME topic, right?
    and I've been trying to run an app that uses:
    javax.microedition.media.control.VideoControl
    But I don't seem to have a library that contains this class...
    Where can I find such a library?Did you try Google? What did you find?
    I understood it's in the MMAPI, but how do I use it?
    Did you read the API? A tutorial? Hello?!

  • J2ME Image / Graphics problem my misunderstanding?

    Hi,
    Cannot find a J2me forum so I'm posting here :)
    I have a mutable Image which I am using as an offscreen buffer. I initialise this image by setting the colour to white and calling the fillRect() method with the screen size as parameters. I do this in the constructor for my Canvas object.
    In my paint() method I then draw only the extra things on the backbuffer (since I have already filled the image with white) and use the drawImage() method of the screens Graphics object to copy the backBuffer onto the screen of my device.
    The problem is that text from the previous Form shows up, as if I have not filled the backBuffer with a white rectangle....
    Code :
    Initialisation :
    backBuffer = Image.createImage(screenWidth,screenHeight);
    Graphics g = backBuffer.getGraphics();
    g.setColor( 255, 255, 255 );
    g.fillRect( 0, 0, getWidth(), getHeight() );
    In my paint() method :
    Graphics saved = g; // Save the frame buffer
    g = backBuffer.getGraphics();
    g.setColor(255,0,0); // change the colour to red
    // Draw the selection box.
    g.drawRect(x,y,imageWidth,imageHeight);
    saved.drawImage(backBuffer,0,0,Graphics.LEFT|Graphics.TOP);
    Thanks,
    Norris

    backBuffer =
    Image.createImage(screenWidth,screenHeight);
    Graphics g = backBuffer.getGraphics();
    g.setColor( 255, 255, 255 );
    g.fillRect( 0, 0, getWidth(), getHeight() );you initialise the backBuffer size to screenWidth by screenHeight
    yet, when you clear the image, you use the canvas's width and height
    g.fillRect( 0, 0, getWidth(), getHeight() );this is wrong, you should either have
    g.fillRect( 0, 0, backBuffer.getWidth(),backBuffer.getHeight());or
    g.fillRect( 0, 0, screenWidth, screenHeight);rob,
    p.s. next time, post MIDP questions in this forum...
    http://forums.java.sun.com/forum.jsp?forum=50
    Hi,
    Cannot find a J2me forum so I'm posting here :)
    I have a mutable Image which I am using as an
    offscreen buffer. I initialise this image by setting
    the colour to white and calling the fillRect() method
    with the screen size as parameters. I do this in the
    constructor for my Canvas object.
    In my paint() method I then draw only the extra things
    on the backbuffer (since I have already filled the
    image with white) and use the drawImage() method of
    the screens Graphics object to copy the backBuffer
    onto the screen of my device.
    The problem is that text from the previous Form shows
    up, as if I have not filled the backBuffer with a
    white rectangle....
    Code :
    Initialisation :
    backBuffer =
    Image.createImage(screenWidth,screenHeight);
    Graphics g = backBuffer.getGraphics();
    g.setColor( 255, 255, 255 );
    g.fillRect( 0, 0, getWidth(), getHeight() );
    In my paint() method :
    Graphics saved = g; // Save the frame buffer
    g = backBuffer.getGraphics();
    g.setColor(255,0,0); // change the colour to red
    // Draw the selection box.
    g.drawRect(x,y,imageWidth,imageHeight);
    saved.drawImage(backBuffer,0,0,Graphics.LEFT|Graphics.T
    P);
    Thanks,
    Norris

  • This Newbie Has Questions

    Hi there. I am a newbie to Apple. I purchased the iBook last month and of course, when the MacBook (which had the features I wanted) came out, I rushed out and got one and I'm very pleased with my purchase - but I have a few "newbie" questions:
    1) Printing on a PC based Linksys seems to be a nightmare. I can't get anything printed on the shared HP 2600N and HP1012 printers. I literally have to disconnect them from the PC and plug the USB directly to my MacBook to print. It seems like there should be a better, easier and MacFriendly way of doing this - anyone have an easy solution?
    2) I'm going to purchase Windows XP so I can run my windows programs on this computer. Does anyone have any pre-installation advice?
    3) I have a blackberry device that worked fine with my iBook, but does not work with my MacBook - any suggestions or is there a software compatibility patch?
    4) I transferred everything from my old Mac to my new Mac with no problem. How can I migrate my contacts from Entourage to the Address Book?
    5) I notice that sometimes the MacBook "stalls" or doesn't work fast in some functions...is it just me - I expect the machine to jump quickly...but sometimes I get that annoying pinwheel when opening programs.
    Thanks for your help!

    1) Printing on a PC based Linksys seems to be a
    nightmare. I can't get anything printed on the
    shared HP 2600N and HP1012 printers. I literally
    have to disconnect them from the PC and plug the USB
    directly to my MacBook to print. It seems like
    there should be a better, easier and MacFriendly way
    of doing this - anyone have an easy solution?
    The problem is probably a driver issue.
    Printing to a printer on a XP PC from a Mac running 10.4.x
    http://www.ifelix.co.uk/tech/3015.html
    You may need to use a third-party driver such as the HPIJS drivers or the Gimp-Print drivers, but this is not the case with all printers.
    2) I'm going to purchase Windows XP so I can run my
    windows programs on this computer. Does anyone have
    any pre-installation advice?
    Ensure you get a full version (not an upgrade version) and it comes with XP SP2 already.
    Do not install Boot Camp on a critical machine and make regular backups of your data, this is beta software and there are bugs and issues.
    5) I notice that sometimes the MacBook "stalls" or
    doesn't work fast in some functions...is it just me -
    I expect the machine to jump quickly...but sometimes
    I get that annoying pinwheel when opening programs.
    Are these Universal or PPC only applications?
    iFelix

  • Two graphics questions

    Two questions about graphics, which aren't related to each
    other:
    - I'd like to add vector graphic objects to one of my slides
    (some arrows). Captivate seems to have no "draw" module like the
    one in Word. There are several less-cool solutions, one of which I
    used. But graphic objects right in Captivate would be nice. Any way
    to do it? (What I did was copy the background to MS Paint and draw
    in some arrows, which have jagged edges because they're diagonal.)
    - When I'm documenting the use of input boxes and pull-down
    lists, the outline on the box or list is often incomplete, as if
    someone erased some random segments. Even a small bitmap image
    superimposed to complete the broken line doesn't work-- something
    seems to be "on top of" the whole slide and causing this. Any idea
    what of the cause?

    Hi Chris
    You said RH and this is posted in the Captivate forums. Do
    you really mean RH or is that a mistype?
    If you really do mean Captivate, you might find that you
    achieve better results by editing the image in TechSmith SnagIt
    (assuming you have it available).
    Cheers... Rick

  • Java2D graphics question ?

    hi,
    i had to tell that i have absolutely no experience with 2D features, and i would like to embellish my interface without having to read a lot of docs and tutorial, so my question is simple for swing's guru
    I would like to apply the GradiantPaint(say form blue to white) to the backgournd color of a
    JPanel object, can anyone tell me how to do it ?
    thanks for your help

    I have never tried this so i cannot tell you for definate extend JPanel similar to this and use JPanelGrad in the exact same way you would JPanel
    public class JPanelGrad extends JPanel
      GradientPaint gp;
      public JPanelGrad(GradientPaint gp)
        super();
        this.gp=gp;
      public JPanelGrad(GradientPaint gp, LayoutManager layout, boolean isDoubleBuffered)
        super(layout, isDoubleBuffered);
        this.gp=gp;
      public void paint(Graphics _g)
        super(_g);//this statment will slow down painting and i think it is will make no difference to remove it...
                           //i think that in JPanel it simply calls paintComponent(g); paintBorder(g); paintChildren(g);
                           //try it both ways - preferablely remove it
        Graphics2D g=(Graphics2D)_g;
        g.fill(new Rectangle(0, 0, getWidth(), getHeight()));
        g.setPaint(gp);
        paintComponent(g);
        paintBorder(g);
        paintChildren(g);
                      //these three methods r to be in this order;
    JPanelGrad panel=new JPanelGrad(new GradientPaint(0, 0, Color.blue, 10, 0, Color.white));
    Simple as. Bamkin

  • Newbie wireless question (slightly off-topic)

    I didn't want to post this here as it's not entirely an Airport-specific question. I posted this to the iBook forums, but nobody there has answered so my apologies if this is not welcome here. (Any moderators can remove it if that's the case.)
    I've been using computers extensively for over a decade, but I'm a total newbie to wifi. I just set up a wireless network in my house and would appreciate some advice/feedback.
    My main concerns are whether or not my network is reasonably secure. I know there is no such thing as perfect security, but I don't know if what I've done is good enough or not.
    I don't have an Airport base station, but I do have a D-Link Airplus G and an Airport card in my iBook. I have WEP set up on the router and I have enabled MAC filtering, listing only my desktop and my iBook, excluding all others from the network.
    I'm fairly certain that nobody in my neighborhood is going to get into my machines this way or be able to sniff my network data stream, but am I right in assuming that nobody can "piggyback" on my Internet connection too? Presumably, if everyone but my own machines are MAC-filtered and kept out, then the Internet connection is also protected. Is that how it works?

    WEP and MAC filtering are better than nothing, but you can do better. These are my suggestions:
    1. Use WPA with a pre-shared key (PSK) and TKIP encryption on your Netgear router, along with an alphanumeric passphrase of at least eight characters not found in any dictionary. The equivalent setting on your Mac is "WPA Personal". Unlike WEP security (which an expert can crack in under half an hour), WPA security is currently unhackable by any practical means as long as you use a non-dictionary passphrase. One last point - WPA security requires all your wireless Macs to be running MacOS 10.3 or newer.
    2. MAC filtering is (these days) essentially useless as a wireless security method. Using "packet sniffing" of traffic on your wireless network to find out what MAC addresses are used by computers on your network, and a PC that allows its MAC address to be cloned so that it is identical to the MAC address of one your own wireless computers (which is possible with most PC wireless network adapters) even an amateur hacker can defeat MAC address filtering in minutes.
    By the way - I don't think your posted message here is off topic. In my opinion, the Airport discussion forums are the best place to post any questions related to usage of wireless networks. Questions of this nature are virtually never specific to any Mac model.

  • Graphics question. paint(), repaint(), update()

    Hi
    I have a GUI which consists of swing components and I want to paint onto them. For example if somebody select a component I want to paint a rectangle around it.
    The select event stores the component in a variable and calls repaint(). This shoul call paint() which looks like this:
    public void paint( graphics g){
    draw the rectangle
    super.paint(g);
    The rectangle is actually painted for half a second. Then it is gone again. I want to have it painted permanentely. Why is the rectangle erased after that? Is it because of the update() method?
    I tried to overwrite the update method with a plain method:
    public void update(graphics g) { }
    it didnt do anything.
    Another question. I have to paint differnt stuff regarding what events are thrown. Is it a good programming style to put all the draw stuff into the paint method and look what happend like:
    if(event a)
    else if(event b)
    ...

    Have you tried putting super.paint(g) before the code to draw the rectangle? I think what's happening is that the super's paint is drawing the component, thus erasing your rectangle.
    You may want to check the API for other options. There may be a property that indicates the size and color of a border. It would be easier and probably look better to adjust that, if it exists.
    I believe that update() draws a background (just a square of background color) and then calls paint(). If you override it with an empty method, I'd expect that nothing would be drawn.

  • Basic graphical question (actionscript/flashbuilder)

    I'm a totally newbie trying to create a library of graphical components that I can reuse in applications. I've created two projects in my workspace, one for the widgets and one for the application. When I draw the components onto the design screen, they now paint themselves as opposed to just being empty rectangles, great. They is something I'm missing however in the graphical heirarchy, b/c when I resize them they don't clear. Below is my class hierarchy:
    public class WidgetBase extends Canvas
            public function WidgetBase()
                super();
            override protected function commitProperties():void
                // The idea here is that since this is a graphical object, all of its properties are probably
                // going to cause a redraw
                this.invalidateDisplayList();
            override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
                super.updateDisplayList(unscaledWidth, unscaledHeight);
                draw(unscaledWidth, unscaledHeight);           
            protected function draw(unscaledWidth:Number, unscaledHeight:Number):void
                graphics.clear();
    public class MyWidget extends WidgetBase
            public function BreakerWidget()
                super();
            protected override function draw(unscaledWidth:Number, unscaledHeight:Number):void
                super.draw(unscaledWidth, unscaledHeight);           
                graphics.beginFill(0xee0000, 0.9);
                graphics.drawRect(1, 1, unscaledWidth-1, unscaledHeight-1);                       
    What do I have to add to get MyWidget to clear properly?

    Hi Bob, thanks for getting back to me.
    quote:
    Originally posted by:
    Bob Pierce
    "_root.goRandom(this.slideshow_rand_mc.topslide_mc);"
    There's a typo in that line - if it's in your code, it won't
    work!
    Ah, true. The typo actually happened when I was re-writing
    the code in post. The actual code in the movie is
    _root.goRandom(this.topslide_mc);
    This is attached to a keyframe of the container movie-clip
    containing the slides MC.
    I've put the fla file on our server.
    slideshow_random.fla.zip
    If you, or someone else could download it and help me find
    out what I'm doing wrong, I'd be ever-so grateful. I'm sure it's
    something really obvious. Without being very familiar with Flash
    and Actionscript, it's hard to explain things, and much easier to
    show you the actual Flash file.
    The 2 functions are on a keyframe on frame 1 of the root
    timeline. The 'goRandom' function is supposed to be called from a
    keyframe in 'slideshowRand_MC'. I envisaged calling the random
    pause function from another keyframe in the same movieclip.
    Thanks again,
    Alex

  • Newbie saving question in Illustrator

    I know this is a newbie question. I designed a logo in Illustrator. Is there a way to save just the logo for exporting into other applications (ie Pagemaker or Photoshop) without having the white artboard?
    Thanks
    Brad

    I don't know Pagemaker but with Photoshop I simply select all, copy and then paste in Photoshop - transparency will be maintained. If you paste as a Smart Object you retain the ability to edit the Illustrator artwork in Illustrator and update the PS file.

  • Quick graphics question  (again)

    I'm trying to display a string (and an image) on my applet but I don't want to put the code in the paint() method. The reason is that paint() is called every time the display is refreshed and I just want to display some text (g.drawString) one time only.
    So, what is wrong with this code: (from inside my JApplet class)
    public void drawTest() {
       Graphics g = getContentPane().getGraphics();
       g.drawString("My string", 20, 20);
       g.dispose();
    }I've also tried using:
    Graphics g = this.getGraphics();But that doesn't seem to work either.
    What am I doing wrong?

    Getting back to your original question, here's a demo of two of the many ways of combining a string with an image. Your original post mentioned this, but was sketchy...
    import java.awt.*;
    import java.awt.geom.*;
    import java.awt.image.*;
    import java.io.*;
    import java.net.*;
    import javax.imageio.*;
    import javax.swing.*;
    public class X {
        public static void main(String[] args) throws IOException {
            BufferedImage image = ImageIO.read(new URL("http://today.java.net/jag/Image1-large.jpeg"));
            String title = "James Gosling";
            Font font = new Font("Lucida Sans", Font.PLAIN, 12);
            Color foreground = Color.WHITE;
            JLabel label = new JLabel(new ImageIcon(labelIt(image, title, font, foreground)));
            JPanel panel = new JPanel(new BorderLayout());
            panel.setBackground(Color.BLACK);
            panel.add(new JLabel(new ImageIcon(image)));
            JLabel titleLabel = new JLabel(title, SwingConstants.CENTER);
            titleLabel.setForeground(foreground);
            panel.add(titleLabel, BorderLayout.NORTH);
            JFrame f = new JFrame(title);
            Container cp = f.getContentPane();
            cp.setLayout(new FlowLayout());
            cp.add(label);
            cp.add(panel);
            f.pack();
            f.setLocationRelativeTo(null);
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.setVisible(true);
        public static BufferedImage labelIt(BufferedImage image, String text, Font font, Color color) {
            BufferedImage result = new BufferedImage(image.getWidth(), image.getHeight(), BufferedImage.TYPE_INT_RGB);
            Graphics2D g = result.createGraphics();
            g.drawRenderedImage(image, null);
            Rectangle2D bounds = font.getStringBounds(text, g.getFontRenderContext());
            float x = (float)(image.getWidth() - bounds.getWidth())/2;
            float y = (float)bounds.getHeight();
            g.setColor(color);
            g.setFont(font);
            g.drawString(text, x, y);
            g.dispose();
            return result;
    }

Maybe you are looking for

  • Did RH 9.02 patch break something...???

    Yesterday we upgraded to Version 9.0.2. Today my stylesheets don't work. I rely very heavily on stylesheets because my company has two divisions with two separate brandings. Every day I have to import the same document to two separate projects, and a

  • Documents in CP1215 print queue won't delete - Windows 7 Home

    I'm running Windows 7 Home Edition. My printer is a HP CP1215. Two problems. I have a CP1215 and it shows in Devices and Printers. It has two stalled documents in its queue that will not delete. It itself cannot be deleted. In addition on a restart o

  • [SOLVED] VLC and WebCam networking

    Been searching and trying all kind of command line combinations and GUI settings so that a web cam connected to my laptop can stream video to my main desktop through router.  No success. I cannot get VLC to stream, always errors.  VLC works fine if I

  • HsSetValue in Smart View 11.1.2.1.103

    Greetings, the team I am working in is having an issue executing the hssetvalue command. The function is built and, submit data is pressed and, the data is not saved to the database. We also used the refresh button with the same result. The submit ze

  • Possible to convert autonomous AP to LWAPP via CLI?

    Hi, Probably a silly question but was wondering why it is not possible to convert an autonomous AP to LWAPP by using CLI commands? For example we have over 300 access points to convert and thought about using Linux to automate the task but seems ther