Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Developer
New Developer
Posts: 22
Registered: ‎08-17-2009
My Device: Not Specified

Image overlay on Video preview window - Camerademo sample.

I am trying to do a very simple thing turning out to be not so simple?

 

I just need to put a static transparent image on top of the preview area. The image has two distinct marks on it, the users while capturing shall see through top layer and adjust the lens with help of these markers.

 

 

I tried it following ways as both CLDC and MIdlet  but when the preview appears it just put the image behind. I could see the image on the edages on the preview area.

 

1.  Drawn the image at the same point of preview box on MainScreen class paint event

2.  Put a bitmap at the same point of preview box

3.  Run a delay thread and put a bitmap at the same point of preview box after the preview appears.

4.  Created a custom 'Field' class and tried to get the preview feed on it - but that one errors out on getting feed.

 

 

I just need preview box behind and a static transparent image layer on top it. 

 

Any pointer would be a great help.

 

 

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Image overlay on Video preview window - Camerademo sample.

This question has been asked before.  You might find it if you search the forum.  The reply, as I remember it from Mark Sohm was along the lines of "Drawing over the preview area is not supported". Sorry.

Highlighted
New Developer
New Developer
Posts: 22
Registered: ‎08-17-2009
My Device: Not Specified

Re: Image overlay on Video preview window - Camerademo sample.

I feel bit sick to hit the Aceept as sol. button.. Wow. so take snaps at regular intervals like 10 mil sec. and spoof the user as if it was the real preview?

New Contributor
Posts: 6
Registered: ‎11-14-2010
My Device: Not Specified

Re: Image overlay on Video preview window - Camerademo sample.

Hi,

 

Has someone been able to add an OverlayControl to the camera viewfinder of a BlackBerry 6 device?

I am on how to do this. I have see this bit of code which is similar to what I want to do, but

 

Image outerFrame = Image.createImage("/outerFrame.png");

Image innerFrame = Image.createImage("/innerFrame.png");

OverlayControl overlay = myMediaProcessor.getControl ("javax.microedition.media.control.imageeffect.OverlayControl"); overlay.insertImage(innerFrame, 0,0,1); // order = 1

overlay.insertImage(outerFrame, 0,0,0); // order = 0

 

I can’t get to create “myMediaProcessor” the MediaProcessor.

 

What I want to do is make the viewfinder full screen [which I have done] and put an image overlay with a 20 pixel border around it. Also I need to add some small images on top of the viewfinder [similar to how the BB 6 camera controls on screen]

 

I have been at this for a while with no success, so any help or guidance would be much appreciated.

 

Thanks in advance!

Jay.  

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Image overlay on Video preview window - Camerademo sample.

Doesn't my previous Post on this Thread apply to your question too?

Developer
Posts: 1,055
Registered: ‎01-25-2009
My Device: BlackBerry Bold 9650/BlackBerry Torch 9800

Re: Image overlay on Video preview window - Camerademo sample.

Peter,

 

Doesn't OverlayControl in 5.0+ give them what they need?

 

http://www.blackberry.com/developers/docs/5.0.0api/javax/microedition/amms/control/imageeffect/Overl...

Jerome Carty - Follow jcarty on Twitter@jcarty | #webworks-dev / #BlackberryDev on irc.freenode.net | My Apps
Click "Accept as Solution" if post solved your original issue.. Give like/thumbs up if you feel post is helpful
New Contributor
Posts: 6
Registered: ‎11-14-2010
My Device: Not Specified

Re: Image overlay on Video preview window - Camerademo sample.

Thank you everyone for the comments.

 

At least can I draw 2 lines over the viewfinder so the users can centre the object better?

 

If yes please give me some guidance on how I can achieve this.

 

Thanks in advance.

Jay.

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Image overlay on Video preview window - Camerademo sample.

Jerome,

 

Thanks for that, I have never used or noted that class. 

 

Everyone, please ignore my posts on this Thread if running OS 5.0 or later.....

Developer
Posts: 1,055
Registered: ‎01-25-2009
My Device: BlackBerry Bold 9650/BlackBerry Torch 9800

Re: Image overlay on Video preview window - Camerademo sample.

Jay,

This should be possible. You should be able to do it dynamically by creating an image, drawing your rectangle within it then adding it to your OverlayControl. You can also create the image beforehand then resize it based on screen size.

I've never used it before but what I stated should work.
Jerome Carty - Follow jcarty on Twitter@jcarty | #webworks-dev / #BlackberryDev on irc.freenode.net | My Apps
Click "Accept as Solution" if post solved your original issue.. Give like/thumbs up if you feel post is helpful
Developer
Posts: 1,807
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.3.2.858, Z10 (STL100-3)-10.3.1.2576, Z30 (STA100-5)-10.3.1.2582, Passport (SQW100-1)-10.3.1.2576, PlayBook (16GB)-2.1.0.1917
My Carrier: Verizon

Re: Image overlay on Video preview window - Camerademo sample.

I think OverlayControl is one of the controls that doesn't work (as in not implemented).

---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.