Overlap two images, works in plain java, not in BlackBerry JDE 5

I have a simple java swing app that takes two images and overlaps each other. While trying to port this into JDE5, I released there is no BufferedImage class in BB api but a similar Bitmap class. Problem is that the blend function ported to BB can't produce a overlapping image. It shows a blank white screen.

/** The extension of the pictures to be saved */ private static final String EXTENSION = ".bmp";

/** A counter for the number of snapshots taken */ private static int _counter; Bitmap image1,image2; BitmapField imageField; /** A reference to the current screen for listeners */ private ImageScreen _imageScreen;

/** * Constructor * @param raw A byte array representing an image */ public ImageScreen( final byte[] raw1,final byte[] raw2 ) { // A reference to this object, to be used in listeners _imageScreen = this;

// Create the CANCEL button which returns the user to the main camera // screen without saving the picture. ButtonField cancelButton = new ButtonField( "Cancel" ); cancelButton.setChangeListener( new CancelListener() ); hfm3.add(cancelButton);

Re: Overlap two images, works in plain java, not in BlackBerry JDE 5

The code looks fine, can you confirm that if you displayed the Bitmaps, pre-blend, that they show up properly?

---Spends time in #blackberrydev on freenode (IRC)----Three simple rules:1. Please use the search bar before making new posts.2. "Like" posts that you find helpful.3. If a solution has been found for your post, mark it as solved.--I code too much. Well, too bad.

Re: Overlap two images, works in plain java, not in BlackBerry JDE 5

You don't need to post the images if you don't need to, I just wanted to make sure that the images that you are trying to blend display properly. I can't right now but I will try the code later, everything seems perfect.

---Spends time in #blackberrydev on freenode (IRC)----Three simple rules:1. Please use the search bar before making new posts.2. "Like" posts that you find helpful.3. If a solution has been found for your post, mark it as solved.--I code too much. Well, too bad.

Re: Overlap two images, works in plain java, not in BlackBerry JDE 5

Good news, I figured it out. I think it might be a bug in the simulator because your images don't have alpha but take alpha into account in your blend function.

---Spends time in #blackberrydev on freenode (IRC)----Three simple rules:1. Please use the search bar before making new posts.2. "Like" posts that you find helpful.3. If a solution has been found for your post, mark it as solved.--I code too much. Well, too bad.

---Spends time in #blackberrydev on freenode (IRC)----Three simple rules:1. Please use the search bar before making new posts.2. "Like" posts that you find helpful.3. If a solution has been found for your post, mark it as solved.--I code too much. Well, too bad.

Re: Overlap two images, works in plain java, not in BlackBerry JDE 5

There are various forum posts about how to do manual scaling. As for the scaling argument in createBitmapFromBytes, it is a scale value not a constant. If you figure out the scale that the bitmap needs to be adjusted to then you can use the scale value.

---Spends time in #blackberrydev on freenode (IRC)----Three simple rules:1. Please use the search bar before making new posts.2. "Like" posts that you find helpful.3. If a solution has been found for your post, mark it as solved.--I code too much. Well, too bad.