Background image for the Drawing Application

Hi all

I'm trying to understand the following: how to add a background image to my drawing application. I have a drawing application that is based on the example of gesture application.

What is done currently is:

case GESTURE_SWIPE: {
            gesture_swipe_t* tap = (gesture_swipe_t*)gesture;

            int bg[] = { SCREEN_BLIT_DESTINATION_X, swipe->coords.x,
            SCREEN_BLIT_DESTINATION_Y, swipe->coords.y,
            SCREEN_BLIT_DESTINATION_WIDTH, 10,
            SCREEN_BLIT_DESTINATION_HEIGHT, 10,    SCREEN_BLIT_COLOR, 0xffffff00, SCREEN_BLIT_END };
            screen_fill(screen_ctx, screen_buf[0], bg);
            screen_post_window(screen_win, screen_buf[0], 1, rect, 0);

            fprintf(stderr,"Tap x:%d y:%d",swipe->coords.x,swipe->coords.y);
            break;
        }

Whenever a movement is recognized, I simply 'draw' a box in this area. Given that the gesture is wide, many boxes are then created after another, therefore, create a line.

My question is, since I am that based on the example of application of gesture, where only one screen is used (I intend to leave it as a screen), why my "design" does not appear on the background image already in place?

The sample application gesture used this function to load the image:

int
load_image(screen_window_t screen_win, const char *path)
{
    img_decode_callouts_t callouts;
    img_lib_t ilib = NULL;
    img_t img;
    int rc;

    rc = img_lib_attach(&ilib);
    if (rc != IMG_ERR_OK) {
        return -1;
    }

    memset(&img, 0, sizeof(img));
    img.flags |= IMG_FORMAT;
    img.format = IMG_FMT_PKLE_XRGB8888;

    memset(&callouts, 0, sizeof(callouts));
    callouts.setup_f = decode_setup;
    callouts.abort_f = decode_abort;
    callouts.data = (uintptr_t)screen_win;

    rc = img_load_file(ilib, path, &callouts, &img);
    img_lib_detach(ilib);

    return rc == IMG_ERR_OK ? 0 : -1;
}

Where decode_setup and decode_abort are:

static int decode_setup(uintptr_t data, img_t *img, unsigned flags)
{
    screen_window_t screen_win = (screen_window_t)data;
    screen_buffer_t screen_buf;
    int size[2];

    size[0] = img->w;
    size[1] = img->h;
    screen_set_window_property_iv(screen_win, SCREEN_PROPERTY_BUFFER_SIZE, size);
    screen_create_window_buffers(screen_win, 1);

    screen_get_window_property_pv(screen_win, SCREEN_PROPERTY_RENDER_BUFFERS, (void **)&screen_buf);
    screen_get_buffer_property_pv(screen_buf, SCREEN_PROPERTY_POINTER, (void **)&img->access.direct.data);
    screen_get_buffer_property_iv(screen_buf, SCREEN_PROPERTY_STRIDE, (int *)&img->access.direct.stride);

    img->flags |= IMG_DIRECT;
    return IMG_ERR_OK;
}

static void decode_abort(uintptr_t data, img_t *img)
{
    screen_window_t screen_win = (screen_window_t)data;
    screen_destroy_window_buffers(screen_win);
}

To the help of my function above (from case Gesture_Swipe), should not "boxes appear on the background image because it replaces the buffer by the loading of the image? What I see is the location of the image and the x and y as messages form the debugging process.

Previously, that used to work, is another loading image, I would create a fill of WHITE screen by hand (like a whiteboard for example). It's used to work. However, with fiasca image I don't see anything. Can someone help me with what I do?

Thank you

A27med

Apparently, all I did was fill the screen with a WHITE background and then load the image in the main. This solved the problem for me

Tags: BlackBerry Developers

Similar Questions

  • Cascades: How to set the background image for the menu drop down and etc...

    Hello

    Is there an easy way to set the background image for the menu drop down and etc, current support only black as a background?

    Thank you

    Tom.

    Welcome to the forums!

    This is currently not supported unfortunately.

    I encourage you to save a feature for this request:

    https://www.BlackBerry.com/JIRA/secure/dashboard.jspa

    See you soon!

    Martin

  • How can I change the background image for the lock screen?

    Hi, I just bought a new laptop and I got Windows 7 installed in the store, and I would like to change the background image for the lock screen.  When I went to activate my account, I found out that it has already been activated, but I can't find the settings-> settings more PC in the lower corner on the right.  Thank you!

    Lock screen?

    Are you referring to the login screen?

    Or wallpaper?

    Right-click on your desktop and select Personalize.

    Office link is at the bottom left and use a win-7 theme.

  • What happened to the image field when you create a field of type of image for the Web application?

    What happened to the image field when you create a field of type of image for the Web application?

    The answer is that the point of the IMAGE has been changed to the MEDIA.

    Sorry, Ian, what research for this discussion, I got no results. All good and thanks for the carillon. Hope everything goes well.

    Mouma

  • Background image for the ObjectListField

    Hey all:

    I am trying to use a background image on a custom ObjectListField. The image is for each line, and in the method of substitution of drawListRow, I had graphics.drawBitmap (...). However, only the first line in the area is drawn, and him still ignored the code. So I was wondering if there is a way to make the background of the line drawn for each line. Why graphics.drawBitmap in drawListRow affects only the first line?

    Any help is appreciated, thanks in advance!

    Looking at the signature of drawListRow:

    drawListRow (ListField listField, graphics card graphics, int index, int y, int width)

    I suspect that you do not use this setting are in your call drawBitmap.  If you use this call:

    drawBitmap(int x, int y, int width, int height, Bitmap bitmap, int left, int top)

    Make sure you spend the fourth parameter (is) of drawListRow as the second parameter (y) drawBitmap.

  • Merge the background image for the delicate design?

    Hi again,

    Is it a good idea to merge the background image if I design using delicate design? I notice after as I merge the image in the background the merged image don't like too good after it was merged compared to before.

    Thank you.

    In what context? You want that image to all slides? Use a substance in this case, you can choose an image.

  • How can stretch a background image for the label?

    Hi all
    How can I stretch a background image in a label?
     public void start(final Stage primaryStage) {
                 final Label lbTest = new Label("My Test Label");
                 lbTest.setAlignment(Pos.CENTER);
                 lbTest.setTextAlignment(TextAlignment.CENTER);
                 lbTest.setStyle("-fx-background-color:red;-fx-background-repeat:stretch;-fx-background-position:center top;-fx-background-image:url(\"http://upload.wikimedia.org/wikipedia/commons/thumb/1/1c/BlueMarble-2001-2002.jpg/640px-BlueMarble-2001-2002.jpg\");");
                 final HBox hbox = new HBox();
                 hbox.setId("MyRootPane");
                 Button btnLeft=new Button("Left Button");
                 Button btnRight=new Button("Right Button");
                 hbox.getChildren().addAll(btnLeft,lbTest,btnRight);
                 final StackPane layout = new StackPane();
                 layout.getChildren().add(hbox);
                 Scene scene = new Scene(layout, 600, 320);
                 lbTest.prefWidthProperty().bind(scene.widthProperty());
                 lbTest.prefHeightProperty().bind(scene.heightProperty());
                 primaryStage.setScene(scene);
                 primaryStage.show();
        }
    This code does not work, if I deleted css - fx-background-repeat: stretching; the tense but background image he repeated, I want to leave the background image stretched and not repeated, it can be extended with the window resizing automatically.

    Try - fx-background-size: stretch;

  • How do I set the background image for the menu I have the DSP in Muse

    I design a layout and I want to bring converted of the PS to dream. Anyone know how I can do this.aa.png

    I am trying set high and the low image of the menu in muse.

    I would like to know how I can do better.

    Thank you

    Kristina

    Hi Kristina,

    You can disable the image that you have pasted above and also to create a toggled State for all menu items. In fact, there are 4 States: Normal, rollover, mouse and mouse down, but you will use usually two images because some States share the same image. Next, you need to use the menu widget and provide your cutting of images for all States in this widget. Check this link http://www.adobekb.com/building_your_first_website_pt4.html to this section all about:

    See you soon,.

    Mario

  • How can I use a JPEG file as a background image for my vi to 8.5

    Im working on a vi that I intend to help as part of an alarm system.  I would use a JPEG file of my house as a background image for the vi, or possibly to just display in a window on the control panel.  I've seen people use their own images before, but never looked at what it was.

    Im trying to use the 'read JPEG' file vi and the flattened pixmap 'draw' vi to achieve this.  The vi works, but nothing shows up on the front panel.  If I try to create a "new image" flag out of the flattened pixmap 'draw' vi, I get a blank white window on the front panel.

    Any advice?

    Thank you

    The image could be there just not to come to the right place in the image control. What is the control relative to the image? Must be a JPEG file or can you just copy as a bitmap to the Clipboard and paste it on the front panel? Can you put a photo and the unworking VI?

  • Background images for differnet resolutions

    Hello

    Is there a way to define a single resource (background image) via styles or any other approach that will have definition for all taken screen resolutions supported (BB10 has 3 resolutions defined with portrait/landscape modes = 5 bitmaps)?

    So, I can use this asset without success all the stuff in a code trying to find what the resolution is now and where - and then only - get a correct picture of the assets.

    There are a lot of messages in this forum, but none seems to describe exactly the same problem.

    Thank you

    If you talk to a background image for the application, you have to manage yourself. If you are talking about the splash screen, then you would list each boot image in the XML file.

    You can resize the image to fit the scene, then you might have a rectangular and square and then resized image depending on the scene according to the needs. If you don't want to resize, then you need an image for each resolution device and a naming convention, you could load dynamically depending on the size of the stage (bg_720_720.jpg, etc.).

    CSS may be able to help, since you can load different CSS at startup, but this would require still allows you to define a CSS for each change that you want to support. CSS will be more important when BB10 is available on the PlayBook, since the density of the screen is very different.

    Does that help?

  • How to add the background image to the screen

    Hi all

    I want to add the background image to the main screen how can I do it.

    On the main screen, I used

    -a manager of HorizontalFieldManagerField to view the bitmapField (horizontally).

    -a manager of VerticalFieldManagerField to view the bitmapField (vertically).

    already images of display screen (bitmap field) with Horizontal and Vertical Manager, but I also want to display the background image for the screen, how can I reach this help me please.

    Concerning

    Adkins

    Thanks for all the response, I tried and sloved logic here how I did

     VerticalFieldManager mainVerticalManager = new VerticalFieldManager(Manager.NON_FOCUSABLE|Manager.NO_HORIZONTAL_SCROLL|Manager.NO_VERTICAL_SCROLL){
                protected void paintBackground(Graphics graphics)
             {  
    
             }
             protected void sublayout( int maxWidth, int maxHeight )
             {
    
             }
            };
    
    then i added other to manager on to this
    

    My problem is sloved thank you for the reply

  • Background image in the header missing

    Can help you people? Our background image in the header (top dark blue strip) has disappeared from all our pages with the exception of the index page (which uses a blue picture dark with a white stripe at the bottom.

    Background image for the header is header-bg on all pages except index and does not appear all of a sudden.

    Bottom of header on the home page defined as page1 is header1-bg and works very well!

    I'm trying to clean up the code, no idea of last page edit made by my client. This AP happened before - but I don't remember what was the culprit.

    The site is https://micounties.org

    In Firefox 26, I can see from events.php, legislative.php, counties.php...

    https://micounties.org/images/header-BG.gif

    What browser do you use?

    Nancy O.

  • Change background image in the background of the next slide

    I received cela captivate 4 file from a colleague so I don't know what might have occurred before, but he is behaving strangely.

    For some of the slides, when I scrub the timeline, the background changes to what appears to be the background image for the slide that comes after it.  It is not a slide of motion capture.  Remove all of the buttons and keys/guests of the slide is fixed not.

    The only way I can fix this is by inserting a new slide and copy and paste the background image and the elements in the new slide.

    Someone has seen something like this before?  No idea why it happens or easier difficulty?

    Thank you!

    -Jeff

    Hello

    I guess you see what is described in the note below.

    Click here to see

    Maybe try the actions referred to in the note?

    See you soon... Rick

    Useful and practical links

    Captivate wish form/Bug report form

    Certified Adobe Captivate training

    SorcerStone blog

    Captivate eBooks

  • Background image in the Table prevents repeat

    Since CS4 has unfortunately removed the button background Image for the tables, I've found a workaround neat on the internet: s elect the cell, and then open the tag Inspector panel, click the attributes button and show the display of the list and click inside "bottom" and use the folder icon to access the background image.  However, I can't stop the image to repeat.  I tried everything I can think of.  Can someone help me?  No code answers, please.  Thank you!

    monelleny wrote:

    Can someone help me?

    Yes.

    No code answers, please.  Thank you!

    Well, in this case, the answer is no.

    Quite honestly, if you are able to get a response on the internet and using tags inspector to add a background image, you should be able to follow simple instructions to manipulate the CSS.

    To add a non-repetitive background image to a table cell (or anything, for that matter), you use CSS. Create a CSS class like this in the head of the page:

    
    

    Select the cell in the table and then choose background from the class menu in the property inspector.

  • have toshiba LL850 want to resize image for the background but have tried most things and still does not

    I have a Toshiba L850 and try to mount an image for the background.  Have you tried the resolution of the screen to pull the lever, but still does not.  Can someone go through the steps for me please.

    Hi June,

    What version of Windows is installed on the computer?

    The articles below show you how to change the background image and set the Position of the image in the Center that it adjusts automatically on the screen.

    Items are for Windows 7 The steps are similar to Windows Vista and Windows 8. However please let me know what version of Windows is installed on the computer and I'll give you the steps for this operating system. When the computer restarts, you'd be able to see the name.

    http://Windows.Microsoft.com/en-us/Windows7/change-your-desktop-background-wallpaper

    http://Windows.Microsoft.com/en-us/Windows7/change-your-desktop-background

    I hope this helps. Get back to us if you need more help.

Maybe you are looking for

  • Sun Java Runtime Environment 6 Update 18

    Sun Java Runtime Environment 6 Update 18 Sun Java Runtime Environment 6 Update 18JRE 6 Update 18The JRE is required to run applets and Java and JavaFX applications. This special release provides key fixes a few http://Java.Sun.com/javase/downloads/in

  • Keyboard for blackBerry Q10 q10

    There it is again. I have the second q10 of our representative of bell who is willing, as mine is again for repair. My loan is undergoing the same problem with the key "O". It is very sensitive, so if you spend just on the key and press them, 'o' app

  • The AEC on Highway-C & E code for windows, Android and iPhone

    Hello We have Expressway-C & E version 8.5.1 and Jabber client 10.6.2 CUCM version is 10.5 AEC on Highway-C & E does not work. For windows, I get a beep while shouting and nothing happens after you enter the code of the ACS. Any suggestion how to Col

  • KERNAL_DATA_INPAGE_ERROR (Spaceport.sys)

    I just did a clean install of Windows 8 on my laptop.  From the start, I get the error, then it restarts OK. What can I do? MY SYSTEM: Acer Aspire V3-771-6470, I-3, 16 GB, 240 GB SSD Crucial basic 500 GB HARD drive

  • Feedback: idea of the course from the inside

    I m trying to create a feedback on the last slide in the course.I would get the grade of the student for the course and maybe some comments that have student ideas?