Is pixel by pixel painting possible in standard MIDP?

With pixel by pixel painting I mean painting each pixel on the screen instead of using methods like draweline and drawarc. I know that this is possible when using platform specific Java libraries, like Nokias. But is it also possible to do this in standard MIDP, so it works on all Java-enabled mobiles?

I assume you mean that there is no such method.No, I mean you should look in the api docs to see if there is such a method (but no, there is none)
I want to make a fullscreen animation. If I did that
by calling drawline for each pixel, wouldn't that be
e terribly slow?Well, just try it. Also, you probably don't need to update all of the screen with every frame

Similar Messages

  • Can you make a background a random multicolor, pixel by pixel?

    In any basic window, would you be able to color the background, like, a random multicolor? Let me explain...
    Say I have a window that was generated with Java. Typically, this window would have a white background. Instead of that, I'd like the background to be a continuously changing random bunch of colors, pixel by pixel. So, it would be just a giant mess of crazy colors.
    Is there a way to do this? I searched online, but didn't find anything.
    This isn't really important to me, just something I thought would be fun to do.
    ~Dac

    import java.awt.event.*;
    import java.awt.image.*;
    import java.util.*;
    import javax.swing.*;
    import javax.swing.Timer;
    public class TVExample implements Runnable, ActionListener {
        private Timer t = new Timer(10, this);
        private JLabel label;
        private BufferedImage image;
        private Random r = new Random();
        public void run() {
            image = new BufferedImage(100, 100, BufferedImage.TYPE_INT_RGB);
            label = new JLabel(new ImageIcon(image));
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(label);
            f.pack();
            f.setResizable(false);
            f.setLocationRelativeTo(null);
            f.setVisible(true);
            t.start();
        public void actionPerformed(ActionEvent evt) {
            int x = r.nextInt(image.getWidth());
            int y = r.nextInt(image.getHeight());
            int rgb = r.nextInt(0x1000000);
            image.setRGB(x, y, rgb);
            label.repaint();
        public static void main(String[] args) {
            SwingUtilities.invokeLater(new TVExample());
    }

  • Report Painter: Possible to show Report with Zero (not No records were sel)

    Report Painter: Possible to show Report with Zero (not No records were selected)
    Dear Guru,
      is there any way to make Report Painter to show Report with Zero / 0 when there were no record were found. (No records were selected).
    Regards,
    Howard

    hummm, I dont think so
    THats not possible, as far as I know
    Regards
    Ajay M

  • Recruitment Faxing & e-mailing only possible for standard text in SAPscript

    Hi,
    I am using the old recruitment module PA-RC ion ECC6 and I am trying to send an email to an applicant. When I try and do this I get message "Faxing and e-mailing only possible for standard text in SAPscript". In feature WPROC I am set up to use RTF. Is there no way to send RTF emails? Do I need to create SapScripts for anything that I may possibly want to email?
    Thanks
    Tom

    Apparently only able to carry this out in SAPScript

  • Pixel by Pixel Scan

    Hi all.
    I'm messing around trying to make a simple 2D game. Currently, I have a few sprites on the screen and collision detection working between them. My sprites have transparent backgrounds and the collisions occur when the sprites bounding boxes contact each other but unfortunately this means that things like missiles explode when they hit the bounding box of a ship rather than the ship itself.
    I want to perform a pixel by pixel scan of two sprites once a collision between them has been detected and allow their transparency to overlap until they hit 'solid' color. Basically I want my missile to explode when it hits my ship, not when their two transparent boxes hit each other.
    Anyone have any ideas how I would do this? I've used C++ APIs which have these functions built in but I have no clue as to how to do it in Java. Please help!
    Thanks.

    Heres some code from what I use.
      BufferedImage bi   = new BufferedImage(800, 500, BufferedImage.TYPE_INT_ARGB);
      public static byte[] getAreaCollisions(BufferedImage bi, int minX, int maxX, int minY, int maxY) {
        byte[] collisions = new byte[(maxY - minY + 1) * (maxX - minX)];
        int numCollisions = 0;
        for (int i = maxX; i > minX; i--) {
          for (int j = maxY; j > minY; j--) {
            if (Util.getAlpha(bi.getRGB(i, j)) > 0) {
              collisions[numCollisions++] = 1;
            } else {
              collisions[numCollisions++] = 0;
        if (collisions.length == 0) {
          System.out.println(minX + " " + maxX + " " + minY + " " + maxY);
        return collisions;
      public static int getAlpha(int pixel) {
        return (pixel >> 24) & 0xff;
      }May not be the best code, but it works :)
    CoW

  • Pixel by pixel

    Hi to every one..
    m new at j2me and at this forum too... and have started working on face
    recognition in j2me..
    but for now i want to do a pixel by pixel matching of two images..
    can i do it with immutable images? or necessary to do it with mutable ones?
    and one more question plz..
    if i've displayed the image like this
         image = Image.createImage("/randy_orton.png");
              imageItem = new ImageItem(null, image,
                        ImageItem.LAYOUT_NEWLINE_BEFORE
                        | ImageItem.LAYOUT_LEFT
                        | ImageItem.LAYOUT_NEWLINE_AFTER,null);
              form.append(imageItem);
    how can i now get the pixels of it or bytes of this image..
    plz gime ur suggestions ..
    thanks
    a small piece of code with a bit of discription would be of greater help..
    thanks in advance,,

    i went thorugh that API ahve searched some more things as well.. I have listened about the getRGB() and getPixels methods for it.. If you found a getPixels method, you're looking at the wrong API. I told you to
    Read the API for javax.microedition.lcdui.Image
    Not any of the classes in java.awt.image.
    but dont know how to use those...Do you know what an array is? How to access and assign values of array elements? If not, then go back to basics and go through some tutorials. Start here:
    {color:#0000ff}http://java.sun.com/docs/books/tutorial/{color}
    db

  • Pixel-by-pixel graphics

    I'm working on a bioinformatics project that will use java. My data will be represented pixel-by-pixel, where the color of that pixel will represent of three variables in the dataset. The x and y dimensions are used for two other variables.
    I've been looking through the Java 2D API and tutorials, and there doesn't seem to be a tutorial on pixel-by-pixel specification. Everything seems to be discussing shapes and lines instead.
    In the end, I want a JFrame to pop up, draw the data to the screen, save the graph as a lossless, 8-color picture file, and terminate. Eventually, I hope to have thousands of these files, and I want to animate a change in the data over thousands of generations.
    But first things first... how do I deal with pixel-by-pixel graphics generation?

    g.setRGB(int x, int y, int rgb) where g is the graphics context of a BufferedImage, for example
    buf = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
    Graphics g = buf.getGraphics();
    g.setRGB(x, y, rgb);
    //or//
    g.setRGB(x, y, new Color(r, g, b).getRGB());
    have fun!

  • How to adjust the green (starting) and the red (end) rectangles pixel by pixel (top, bottom, left and right) by changing the number of pixels in ken burns.

    How to adjust the green (starting) and the red (end) rectangles pixel by pixel (top, bottom, left and right) by changing the number of pixels in ken burns. Help please.

    If you look closely at the top of the canvas pane, as you move either of the boxes (green or red) there is an indication of pixel positions... "top, bottom, left, right," and "scale."
    Admittedly, it doesn't seem as if you can "enter" the dimensions with your keyboard, however, as you move the boxes, you have a real time indication of the boxs' locations.
    (I couldn't take a screen shot, as you have to actively move the box with a mouse or other input device... thus, I could not also take a screen shot with same device.)
    I hope this helps.

  • Input to output (pixel by pixel) problems

    I'm at the start of creating a simple plugin. My aim is to put everything from input to output but pixel by pixel. I'm using a CCU example for that, but this causes problems.
    Here's my code:
        PF_EffectWorld *inputP = &params[0]->u.ld;
        PF_Pixel8 *inputPix = (PF_Pixel8 *)inputP->data;
        PF_Pixel8 *outPix = (PF_Pixel8 *)output->data;
        for (int i=0; i<output->height; i++)
            for (int j=0; j<output->width; j++)   
                *outPix++ = *inputPix++;
    My original footage looks like this:
    And after using my code it looks like this:
    After adding the bold line everything works (why do I have to use that line?):
    for (int i=0; i<output->height; i++)
            for (int j=0; j<output->width; j++)   
                *outPix++ = *inputPix++;
            for(int k=0;k<4;k++) inputPix++;
    But when I'm trying to use the plugin again on the same footage it looks like this:
    Am I missing something? What causes that? When I use the callback funcion everything works fine, but I have to do that using the above way 'cause I have to have access to every pixel of the footage.
    Thanks in advance, David

    It is called gutter or row padding, each row may contain more pixel than the actual width. You can check for this with the rowBytes value of inputP.
    The CCU example already compensates for this, so look there for more information:
    in_gutterL        =     (inputP->rowbytes / sizeof(PF_Pixel8)) - inputP->width,
    out_gutterL        =    (outputP->rowbytes / sizeof(PF_Pixel8)) - outputP->width;
    // At the end of each row, account for the gutter
    // (this number can vary by platform and for other reasons)
    if (yL >= 0 && yL < inputP->height){
        bop_inP    += in_gutterL;
    bop_outP += out_gutterL;

  • Help setting the movement to pixel by pixel

    Good day fellow designers. I'm having a "not so good" situation. I hope you can help me guys. It's all about moving an selected object pixel by pixel.
    I have this object selected on photoshop. And I want to move it pixel by pixel. So what I did is I selected it then press the arrow keys. In photoshop,
    usually, this will make the object move pixel by pixel. But in my illustrator however, it's kinda different. It moves at least 3 pixel by 3 pixel. It's not
    accurate. I already tried playing with illustrator's preferences but still no good. I know it's just around there somewhere.
    Maybe someone can help me with this? Thanks and have a good day ahead! Cheers!

    Hmm, I already got that tweaked... But it still skips a few pixels when I move it. A solution that I currently have right now is move it via mouse. It gets
    the job done but the movement via arrow keys helps a lot specially when my workspace is starting to get laggy.
    EDIT :
    I already got it figure out. And yup, it's the keyboard increment. I got used to 1px that I've forgotten that I can also input much lower than 1px. I tried
    0.25px and it worked! : )
    Thanks mate. Cheers! : )

  • Dispay an image pixel by pixel

    Hy! i want to read an image, bmp or jpg and then display it on the screen pixel by pixel....can you help?
    thanks!
    Message was edited by:
    zzirna

    http://forum.java.sun.com/thread.jsp?forum=31&thread=313033
    could prove to be of some interest

  • Cursor ove, pixel by pixel

    I'm a novice at this, so bear with me. In older Macintosh systems there was a program called "Easy Access." At that time, this program allowed for a keyboard function that allowed you to move the cursor pixel by pixel (a benefit for unsteady arthritic hands). The command was: Shift-Command-Clear (from the numeric keypad). Then the zedro key activated this function, and the period key cancelled it. The up and down arrows on the numeric keypad then moved the cursor up or down, and the left and right arrows moved the cursor left or right. does this function still exist, and if so, how do I use it? I may have gotten the older commands mixed up, but would appreciate any help with this.

    I have checked the Universal Access options, but I don't see anyting that specifically relates to what I want to do. I would like to use the up, down, left, and right arrows on the keyboard to move my cursor one pixel at a time in any of those directions. Perhaps I have missed something, but I don't see that capability. any suggestions?

  • Pixel Bender - Oil Paint Module Crashes Photoshop?? Any ideas?

    I have downloaded and intstalled pixel bender for PSCS5. It works well except for the oil paint module.
    Can't move sliders. Every time I use it, Photoshop crashes!!! Any ideas???
    Thanks, Joe

    Samantha,
    I have not had the problem with any other filter. Sorry I do not have a 
    crash log.
    The problem occurred several times, but recently I have not been able to 
    recreate it - in other words,
    it now seems to be working. I'll let you know if anything changes.
    For your information I am using 32 bit Photoshop CS5 on a Windows XP 
    Platform.
    Joe
    In a message dated 8/9/2010 3:29:05 P.M. Central Daylight Time, 
    [email protected] writes:
    Hi,  Joe.
    First, thanks for downloading the plug-in. I believe you may  have hit a
    bug we are planning to address shortly in an update. I'd like to  confirm my
    suspicion, though, and ask if you have been able to re-create the  crash
    using any other filters. One of the issues were addressing in our next  release
    is actually a UI problem and not specific to the Oil filter. If you  have a
    crash log, I'd be interested in checking the stack,  too.
    Let me know either way; if it's not the issue I'm thinking  of, I'd like to
    investigate your problem.
    Thanks  again,
    samantha

  • Pixel by pixel image manipulation- java

    Hey guys, i need to write a bit of code that looks at 3 images, assesses which pixels in ALL 3 are grey, and then redraws a new image consisting of the old ones, but grey only showing where all 3 have grey.
    The inputs are mays with grey overlays, so therefore the output pixels should be the same UNLESS the pixel was grey in all 3.
    I know its to do with arrays but im not a very good programmer and i need to get this done. Ive written the rest of my program, is anyone able to write this simple code? My problem is that i dont really know how to create an image using an array, plus also i know the pixel colours are stored awkwardly too. Ive only been programming in java for 4 weeks!

    The BufferedImage class is really good at creating images from an array. I don't know what a may is, but if you had an array of integer values in the format {a, r, g, b, a ,r, g, b}, it would be as easy as this:
              BufferedImage b = new BufferedImage(5, 5, BufferedImage.TYPE_4BYTE_ABGR);
              b.getRaster().setPixels(0, 0, 2, 1, new int[] {128, 64, 32, 16, 128, 75, 50, 25});Hope this helps.

  • Scaling two objects to match exactly pixel to pixel.

    I have two art objects on two layers. I want to match to the pixel the two objects that otherwise could be exactly the same but one layered object was imported slightly smaller. The scale tool has good scale handling, I just want to measure the tool spots to the pixel to gain an exact scale size factor and match sizes.

    If they could be the same  size what caused the scale difference. Were the images taken with or different cameras, or different focal length or angle are you sure only the scale is off.  That the perspectives and sizes of the objects are the same. Photoshop has a measure tool just remember perspective, angle, axis all effect the measurements size.

Maybe you are looking for