Screenshot method

Hi all

I use the following code to capture screen:

Bitmap image = new Bitmap( 64, 64 );                             Display.screenshot( image, 0, 0, 64, 64 );

I then use:

image.getType () which returns 197: ROWWISE_16BIT_COLOR

But if I had to use

Bitmap image = new Bitmap( 64, 64, Bitmap.ROWWISE_16BIT_COLOR );Display.screenshot( image, 0, 0, 64, 64 );

He throws an IllegalArgumentException saying that is not supported

Can someone explain this?

Certainly if the created image is going to be a ROWWISE_16BIT_COLOR, then you can create a bitmap image in ROWWISE_16BIT_COLOR for the screenshot to use?

According to the documents of the developer, the first parameter is the type where you should type and not in the last...

Bitmap(int type, int width, int height)

Given that the first parameter is 64, it shows that there is an illegal argument...

See you soon...

Tags: BlackBerry Developers

Similar Questions

  • Display.screenshot does not behave as expected

    Hello

    The Display.screenshot method doesn't seem to work as expected. When I call this method, I got the dialog box asking the user or not to allow a screen capture to take. If the user selects Hello but leaves theDo ask not agai box unchecked, the screenshot is not taken. If, however, select 'allow' and check the box "Do not ask again" the screenshot is taken. Maybe that's a problem with the dialog box?

    Here is my code below-
    try {}
    Display.screenshot (this.bitmap, 0,0, Display.getWidth (), Display.getHeight ());
    }
    /**
    * If the user does not have a screen capture taken just display the General image
    */
    {} catch (ControlledAccessException cae)
    This.Bitmap = Constants.BACKGROUND_IMAGE;
    }

    Depends on how you code.

    Personally I d code it as follows:

    (a) have an indicator of persistent screenshot with three States

    0 - does not define

    -1 can't screenshot

    1 is allowed to the screenshot.

    Check this box if you are about to make a screenshot.  In this case - 1 indicate to the user that they have disabled this function be selected permissions.  If it's 0 or + 1, check the permissions API to see if you are allowed to do.  If you are, then set the value to 1 and do.  If you're not, tell them that they need to enable and display the permissions API.  When that is saved, check again.  If they helped him, set the indicator 1 and continue.  If they don't have not enabled it, it the value - 1 and tell them that you can't capture screens because they were disabled.

    Not sure which covers all cases, but you get the idea.

    Ok?

  • How close or minimize the menu box using Display.screenshot ()?

    Hello

    Did someone help out me in finding what way I can minimize or close the menu box while I take the screenshot of any screen?

    The problem is when I select the menu item Printscreen, the Display.Screenshot () method runs, and it takes the screenshot including the menu box that I opened for the selection of the menu-item (Printscreen).

    So, how to remove that box of Menu before you take the screenshot?

    Please answer

    Thank you.

    You might find some useful options in this thread;

    http://supportforums.BlackBerry.com/T5/Java-development/context-menu-coming-in-screenshot-by-using-D...

  • Display.screenshot cause ControlledAccessException

    I developed an application that involves taking screen shots, using the Display.screenshot () method. It works very well in the Simulator, but I just tried to start a 8120 unit, and a ControlledAccessException is thrown by the method of screenshot. Cod files are signed with keys of the RIM and the device works OS 4.3.0.94, then as far as I can see that the method must be available. I get a lot of messages from the device by not saying "No sig 0 x 33" but as far as I know who is an in-house code of RIM signing key so I don't think that has anything to do with it. Does anyone know why it does not work on the device, but on the Simulator?

    You should check the effective permissions on the device.  Some of them may default on refuse, even if the application is signed.  This is because they represent a significant security risk on the device, event Injection (injection of keys) is one and so is browser filtering.  This may also be true for the screenshot on some devices.

    To check this setting for your application, go to Options-> advanced-> application Options and look for your application.  Once you find your app click menu and change the permissions.  Make sure of course not of them are defined on refuse, specifically screenshot under Interactions.

  • Take a full scene of screenshot resizing

    Inside of a Swing application, I have a jfxPanel to create graphics. Now I want to save a screenshot of the card but always when I call < node > .snapshot (new SnapshotParameter (), null) the whole graph is getting resized (smaller). The result of the screenshot is the small stage. What can I do to prevent this?

    Here is the configuration of scene (leftPanel is the jfxPanel):

    Platform.runLater (new Runnable() {}

    @Override

    public void run() {}

    Root StackPane = new StackPane();

    leftPanel.setScene (new Scene (root));

    }

    });

    And here's the code for snapshot:

    String filename = mediaCacheString + File.separator + actDateString + ".jpg";

    File final outFile = new File (filename);

    Platform.runLater (new Runnable() {}

    @Override

    public void run() {}

    StackPane stackPaneLeft = leftPanel.getScene () .getRoot () (StackPane);

    Snapshot of WritableImage = stackPaneLeft.getChildren () .get (0) .snapshot (new SnapshotParameters(), null);

    BufferedImage, bufferedImage = new BufferedImage (leftPanel.getWidth (), leftPanel.getHeight (), BufferedImage.TYPE_INT_ARGB);

    saveImage (snapshot, bufferedImage, outFile);

    SwingUtilities.invokeLater (new Runnable() {}

    @Override

    public void run() {}

    Save the screenshot as a file on the server

    }

    });

    }

    });

    Yes, I have. The screenshot itself is then the right size, but the stage is resized.

    In the meantime, I found the solution. When an object of the scene is created without any size as parameter the default size is 500 x 400. This size does not matter unless you create a screenshot (maybe it's a bug of the screenshot method, but I'm not sure). That stage is resized to 500 x 400. To avoid this, you must recreate the scene with the right size on each resizing the jFxPanel. I don't know if there is a better way to do this, but I found nothing.

    Now the labour code:

    private void createScene() {}

    Platform.runLater (new Runnable() {}

    @Override

    public void run() {}

    Root StackPane = new StackPane();

    Scene = new Scene (root);

    scene.widthProperty () .addListener (new ChangeListener() {}

    @Override

    public void changed (ObservableValue ov, number t1 t) {}

    value of double type = t1 (double);

    Root StackPane = new StackPane();

    Scene = new scene (root, value, leftPanel.getHeight ());

    leftPanel.setScene (scene);

    }

    });

    scene.heightProperty () .addListener (new ChangeListener() {}

    @Override

    public void changed (ObservableValue ov, number t1 t) {}

    value of double type = t1 (double);

    Root StackPane = new StackPane();

    Scene = new scene (root, leftPanel.getWidth (), value);

    leftPanel.setScene (scene);

    }

    });

    leftPanel.setScene (scene);

    }

    });

    Platform.runLater (new Runnable() {}

    @Override

    public void run() {}

    Root StackPane = new StackPane();

    Scene = new Scene (root);

    scene.widthProperty () .addListener (new ChangeListener() {}

    @Override

    public void changed (ObservableValue ov, number t1 t) {}

    value of double type = t1 (double);

    Root StackPane = new StackPane();

    Scene = new scene (root, value, rightPanel.getHeight ());

    rightPanel.setScene (scene);

    }

    });

    scene.heightProperty () .addListener (new ChangeListener() {}

    @Override

    public void changed (ObservableValue ov, number t1 t) {}

    value of double type = t1 (double);

    Root StackPane = new StackPane();

    Scene = new scene (root, rightPanel.getWidth (), value);

    rightPanel.setScene (scene);

    }

    });

    rightPanel.setScene (scene);

    }

    });

    }

  • Screen.Paint see the empty bitmap

    Hello

    I'm doing a transition screen animation but I can't find a way to do the same thing, doLayout method is. I work with OS 4.5 on Curve 8300 and the doLayout method does not exist in the API.

    I tried updateLayout, invalidateLayout doPaint and nothing works. I don't want the screen to be visible before the end of the transition, so I can't use the Display.screenshot () method.

    Here's the method I use. Graphic design is a part of a bitmap. With OS 4.1, I was super.doLayout just before the first method of painting.

    public void getScreenShot(Graphics graph) {     super.paintBackground(graph);       super.paint(graph); }
    

    Hello again,

    I found a solution to my problem. Simply put this part of the code before super.paintBackground (graphics);

    if (super.getWidth() == 0) { super.layoutDelegate(Display.getWidth(), Display.getHeight());}
    
  • Method of screenshot?

    Is it possible to make a screenshot on the Palm Pre and then send it as an emial - as does the iPhone when you press the power and home buttons at the same time?

    Thanks, Carson

    Hey Carson,.

    I saw this solution in another post.  I hope that you get in the right direction.  I tried it and it worked as described

    "You can take a screenshot of what is on the screen by pressing the orange key + SHIFT + P at the same time." It creates a screenshots folder in Photos and save the image. Also find you the image in the USB partition when you connect pre as a USB key. »

  • Method for screenshot InDesign files

    Anyone know the best way to take screen captures to an InDesign file. I tried several ways but am not please with the resolution that I get. How I did it so far is capture the screen (with print screen), then crop out that I don't need in Photoshop. Then I save it as a. GIF and place it in InDesign. The. GIF eventually became the double of what it was like a .psd and the resolution isn't there. I have to use hitch instead of what I do? Would help it?

    Any help would be greatly appreciated.


    Thank you

    Robyn

    A time back I needed a good OCR scanning program, so I bought ABBYY reader. With this program, they have included a program called ABBYY Screenshot reader. I think you can buy this as a standalone program if you do not have the OCR reader.

    The screenshot can be used to capture a part any one screen. It is located at the top of any page that you have open and you just to use the tool and draw a box around what you want to capture. Then, you can choose several options on what format you want as EVS. As .pdf, .jpg, .tiff, .doc, .xls, and several others. If you have the OCR program, you can also save it as a screenshot can be changed. OCR in ABBYY reader is probably one of the best in the world, if not THE best.

    I believe you can get a free trial to see how it works and get also more low prices on specific modules according to what you need.

  • Screenshot problem

    I upgraded to ios10 and now cannot get a screenshot using the previous method after pressing the two buttons...  All solutions?

    Yes use the home button and the volume on the side of the phone at the same time

  • IOS 10 - unable to take "Screenshots".

    Upgrade to IOS 10 on iPhone mini iPad and 6 4. Unable to take the "screenshot" on each device. Using the old method, brings back me to the homepage. You do not find answer to Apple? Any ideas?

    Try to keep the sleep button and then press the home button. Do it somehow quickly so that you do not put the unit in standby now button too long sleep.

    IT works fine for me as you can see here.

  • Take a full screenshot?

    I tried the print screen method etc. windows button and only got part of my screen. How can I get a complete screenpic?

    The addon tools all take only shots of the webpage, not the entire screen.
    

    See:

  • Portege Z30T - Confused on partitions and recovery methods

    A few weeks ago, I bought a new PORTEGE Z30T-A PT24CE and upgraded to Microsoft Windows OS Version 8.1 Pro 6.3.9600 with its CDs. (it came with Windows 7 pre-installed)

    I have two questions that confuse me:

    1-) first of all, I got the laptop I upgraded to 8.1 win by a DVD burner. And I remember this time, he made a picture to copy at the end of the Windows installation. And then another reason I reset phone option "DELETE EVERYTHING AND REINSTALL WINDOWS. But SSD partition recovery recovery (since I don't use any DVD).

    My first question is: does make a difference to reset the PC from DVD of the TOSHIBA (which takes longer) than the reset of the image on the hard drive. I ask because if there is difference, I'll try new DVD reset.

    2-) when I check 256 GB SSD disk management I see the following disk partition (check the image below):
    [partition|postimg.org/image/57i99hsgr/]

    Here, there are the OEM partition and the recovery Partition. What is the difference between these two? Should I have them both? They occupy too much space each more than 8 GB.

    In regard to point 1)

    What software did you use to create the image after the update 8.1 Win?

    The fact is that the Toshiba recovery image was preinstalled on the laptop and recover the laptop using the recovery media (disk or USB key) or by using the procedure of recovery Toshiba HDD would reset the computer laptop back to the factory settings; on the same State as at the first day of the purchase.

    If you want to use another method of recovery or image, you reset draw the laptop to the State when the image was created.

    In regard to point 2)
    Unfortunately, somehow the link to the screenshot does not work
    However, as I said above: the Toshiba HDD recovery procedure redefines the laptop to factory settings and the recovery of image files is placed on a separate partition.
    This partition is very important to perform HARD drive recovery and create additional recovery media.
    This was the case for pre-installed Win 7 OS!

    The other partition may be created by Windows system after Win 8.1 install.
    I'm also a little confused about the image created...
    It would also be possible that this OEM partition is related to the image that you created after the installation of Win 8.1.

    In any case... it would be useful to know all the steps you did the upgrade...

    by the way: I also recommend you read some threads/posts on the topic of recovery here in the forum... This should help you understand the whole process

  • To access the properties of an Error Message When you use the DisplayRunTimeErrorDialogEx method

    I have a reminder that displays the standard runtime error dialog box using the method Engine.DisplayRunTimeErrorDialogEx of custom error. http://zone.ni.com/reference/en-XX/help/370052H-01/tsapiref/reftopics/engine_displayruntimeerrordial....  The parameters of this do not allow me to specify information about the error message available (via the properties of the stage of the appeal of error).  However, when built-in bed in treated TestStand display dialog runtime error through its methods of error handling he managed to fill in the details about the error.

    Anyone know how I can fill in the details and the error code from the dialog box fields when you use the DisplayRunTimeErrorDialogEx method to call it? See attached screenshot by one example of what I get when I use this method.

    Kind regards

    David

    Doug is correct; each sequence in the call stack has its own sequence context, so if you just "ThisContext" for the sequence context parameter, you provide the framework for the error callback, which has no error.  To access the context of the sequence that wrong, you use the caller property to get to the next level in the call stack, for example:

    RunState.Engine.DisplayRunTimeErrorDialogEx ("error Dialog", ThisContext.Caller, 0, False, False, False, False)

    I hope this clarifies!

  • Reach target FIFO / missing error methods

    In my project, there are two FPGA vi and 4 pairs (reading and writing) of FIFO extended target that are used to pass data between the two vi.

    A vi FPGA (named rs232.vi) writes the data it obtains from a port RS232 to READ FIFO; also, it reads data ENTRY FIFO and transmits to the ports.

    The second vi FPGA (named griffin commands.vi) writes data to WRITE FIFOs and reads data from READ FIFOs. There is no other vi in the project.

    When I try to run either of the vi, I get an error about missing methods to FIFOs. For example, when I run rs232.vi, I get an error requiring a reading memory FIFO so that the read method (see the image named side rs232) and who should write FIFOs have Scripture metod presend on the vi block diagram. However, these 'missing' methods are present in the second FPGA (as I described above). The same type of error appears when I run the second.vi.

    Why the compiler can't see I have all the methods; However, they are in 2 separate vi? How can I avoid this error?

    SophieJS wrote:

    Why is - a VI is not the top level vi?

    It would be nice too, as long as one of them call each other. I don't see in your screenshot, however.

  • What is the most modular method to create a 'plan' generated automatically?

    I have a 'plan' that I am currently building a test at the beginning. My "plan" consists of 3 levels of the Organization; the unit, the Group and the arrangement.

    There are a few types of units that I intend to create, but I'm looking for only a few basic methods; I can shake the details in regards to specific controls, resizing, positioning, etc.

    There may be<= 4="" units="" per="">

    There are 4 positions in each arrangement; one for each possible unit.

    There may be<=20 groups="" in="" the="">

    There is only a single arrangement; the arrangement is the entire floor plan.

    Each unit is composed of some Boolean LEDs, progress bars, graphs of waveform and digital indicators.

    Each group is simply an arrangement of units; with an indicator of string as a label.

    The arrangement (floorplan itself) is just an arrangement of groups.

    I considered simply create typedefs for each control so that I can change or resize each if necessary control and have the changes automatically cascading, but is there a way for me to create a typedef for each unit, although it contains several controls? Within the unit, all controls will have a size and position, so it would be nice to be able to resize and rearrange the controls in the unit and have all these changes cascade to all units. It would also avoid having to define the positions of each control for each unit (I could just define the position of each unit).

    I've attached a screenshot of the arrangement (floorplan) .jpg because it currently displays. You can see that inside, there are 8 groups (labeled SX #) and 4 groups of different type (labelled RC #). Within each group, SX, there are 3 units (with a color box gray placeholder where a 4th unit could display).

    I know my questions can be very basic and obvious to experts on this forum, but I have very little training LV, so I am left to my own here.

    Thank you for taking the time to read my message; I hope it is at least as clear as mud.

    You can create a definition of a cluster type and a cluster can contain several data types.  That answer your question?

Maybe you are looking for