painting by pushscreen vs appeal explicit with graphics

I try to get the 'screenshot' of the screen without using the Display.getScreenshot () method well.

I have BitmapTestScreen that overrides the paint method and simply draws a bitmap on the screen

public class BitmapTestScreen extends MainScreen
{

    Bitmap img;
    /**
     * @param img               Img to draw to the screen
     */
    public BitmapTestScreen(Bitmap img)
    {
        this.img = img;
    }

    protected void paint(Graphics g)
    {
        g.drawBitmap(0, 0, img.getWidth(), img.getHeight(), img, 0, 0);

    }
}

When I try to do the following:

     Bitmap scrImg = new Bitmap(Display.getWidth(), Display.getHeight());
        MotionableScreen scr = new ScreenTwo();

        Graphics g = new Graphics(scrImg);
        scr.paintPUB(g);

        pushScreen(new BitmapTestScreen(scrImg));

I get a blank screen... The MotionableScreen is simple and essentially provides the paint as painPUB method

public abstract class MotionableScreen extends FullScreen
{

    public void paintPUB(Graphics g){
        super.paint(g);
    }

}

But if I do:

this.pushScreen(new ScreenTwo());

I get the drawing good screen.

The question is what I'm doing wrong then that if I come to a graphics object, I get a blank bitmap that is the screen is not fired?

Thank you

Max.

Solved... You will need to call the doLayout() before calling in the paint (...).

Tags: BlackBerry Developers

Similar Questions

  • Need help with graphics

    Hi all

    I'm experimenting with graphics api.

    Although I used it until I'm still not very confident on this subject. So, I want to build a strong foundation in this area. I looked online but couldn't find something really useful and what explains the basics.

    For my first mission I want to draw a rectangle in the middle of the screen. Now, for this I used a verticalfieldmanager and I replaced its sublayout method.

    In the sublayout method, I use the getgraphics() method to create the instance of the graphics class. Now, type the following lines:

    g.drawRect (width/2, height/2, 70, 30);

    g.fillRect (width/2, height/2, 70, 30);

    Super.paint (g);

    setExtent (width, height);

    but all I get is a white screen... can't use a graphical object directly in a fieldmanager? do I have to draw the rectangle in a separate field (perhaps a labelfield), then add it to the fieldmanager?

    as you can see my bases regarding the user interface graphics and custom api are not very good and that's why I need all the help I can get here.

    Thank you!!

    For one you super.paint () to call after you did you paint that will erase everything you have done. There is no need to call super.paint () If you make your own custom paint job.

  • Satellite A300-146 - cannot play games with graphics

    I have Toshiba Satellite A300-146, model No.: PSAJ0E, 1 GB of RAM, Intel Dual core 1.87 processor, chipset Mobile Intel (r) 965 family.

    I can play some games like hitman silent of assasin on fullscreen and with graphics.

    But the problem is that a game could not open correctly IE after you open the game, he becomes 16-bit or not graphicsless. I tried these games = need for speed - pursuit and need for speed - undercover, the same problem occurs. I tried in windows XP and Vista.

    We all know Roadrash. I played this game in computer III pentium no value correctly... but I can not play in my laptop...

    Please help me to recover from this problem with the graphics.

    Sul

    Hello!

    Check the system requirements for the game. Satellite A300 is not a high-end gaming laptop and maybe some new games couldn't work on this laptop.

    Maybe you need to reinstall your laptop with the Toshiba recovery disc. I put t have another idea so try and post your result.

    Good bye

  • HP pavilion f002sm 17: hp pavilion 17 f002sm problem with graphics card

    OK Hi again, you help me with my problem with graphics card yesterday I install the driver for my laptop and I can play games, but I I look for tools of diagnosis and is in writing which is r5 graphics card which is built on my laptop and I have A7 graphical please help amd a8 6410 win 7 32-bit

    Hi @zumzo ,

    I understand that you have installed the driver and it works fine.  When you checked the diagnostics you became confused because it says graphic R5 but you R7.

    According to the specifications of your laptop you have AMD Quad - Core A8 - 6410 APU with graphics Radeon R5 (2 GHz, 2 MB cache).

    Here is a link to the 17-f002sm HP Pavilion Notebook product specifications to confirm this information. I hope that this eliminates any confusion.

  • ordered a pavilion with graphics card upgrade, upgrade used only 16-bit location

    ordered a pavilion with graphics card upgrade, upgrade used only 16-bit location. I want to connect a second monitor, can I use the parent connections card currently have coverage through them that say "do not remove"?

    Hello

    If you use an adapter, then you have the choice on the end to use the adapter based on the adapter that you use. Buy cable HDMI to DVI and save frustration adapter problems and possible.

  • Resizing of bitmaps with Graphics.drawTexturedPath - bad ratio

    Hello

    I used to resize bitmap images (to have the similar physical size on different phones) in my project with the following code - found in this thread:

    Without creating an encoded image bitmap image resizing

        public static Bitmap resizeBitmap(Bitmap image, int width, int height)
        {
            int imageWidth = image.getWidth();
            int imageHeight = image.getHeight();
    
            // Need an array (for RGB, with the size of original image)
            int rgb[] = new int[imageWidth * imageHeight];
    
            // Get the RGB array of image into "rgb"
            image.getARGB(rgb, 0, imageWidth, 0, 0, imageWidth, imageHeight);
    
            // Call to our function and obtain rgb2
            int rgb2[] = rescaleArray(rgb, imageWidth, imageHeight, width, height);
    
            // Create an image with that RGB array
            Bitmap temp2 = new Bitmap(width, height);
    
            temp2.setARGB(rgb2, 0, width, 0, 0, width, height);
    
            return temp2;
        }
    
        private static int[] rescaleArray(int[] ini, int x, int y, int x2, int y2)
        {
            int out[] = new int[x2*y2];
            for (int yy = 0; yy < y2; yy++)
            {
                int dy = yy * y / y2;
                for (int xx = 0; xx < x2; xx++)
                {
                    int dx = xx * x / x2;
                    out[(x2 * yy) + xx] = ini[(x * dy) + dx];
                }
            }
            return out;
        }
    

    My problem with the code was that it was quite slow - larger images would take almost a second (!) on the older phones (8830) scale.  It did not prevent UI - I have the code running in a separate Thread - but it has considerably delayed showing the image on the screen.

    Recently, I started to experiment with Graphics.drawTexturedPath and I really like this method.  However, I found a weird problem while reducing images.  For example, I need to put a picture of 48 x 48 up to 42 x 42.  The most important parameters for the scale are dux and dvy (of the four walk coordinates vector only these two are zero).  So now my code object looks like this:

    XYRect area = getExtent();
    // ourBgImage is the unscaled Bitmap - our background image
    int imageWidth = ourBgImage.getWidth();
    int imageHeight = ourBgImage.getHeight();
    int[] xPts = {0, 0, area.width - 1, area.width - 1};
    int[] yPts = {0, area.height - 1, area.height - 1, 0};
    int dux = (int) ((((long) imageWidth) << 16) / area.width);
    int dvy = (int) ((((long) imageHeight) << 16) / area.height);
    // Keep aspect ratio and make image fit fully
    dux = dvy = Math.max(dux, dvy);
    g.drawTexturedPath(xPts, yPts, null, null, 0, 0, dux, 0, 0, dvy, ourBgImage);
    

    which is a little shorter and much more fast-work (especially on older phones as 8830).

    However, the image is truncated on the right and down - looks like two pixels are missing on one of these two parties.  This was not the case with the old algorithm. I am specifying all the wrong settings?

    Final nail in the coffin of drawTexturedPath:

    I decided to check how drawTexturedPath resizes checkerboard (mainly the scale down).  And the results are pretty ugly - it seems to use the algorithm "nearest neighbour" without any means.  The project with which I tested it is attached.  Once you have it running, use Alt + move to shrink and Alt + down to stretch.  Observe the results.

    The decision is, of course, to remove this method and resize Bitmaps the old way

  • having problems with graphics acceleration in lightroom with card amd 2015 running drivers latest

    having problems with graphics acceleration in lightroom with card amd 2015 running latest drivers. It crashes every time that you do something to make anything with acceleration for example. develop module or turn it off

    Version of Lightroom: CC 2015.1 [1025654]

    License: Creative Cloud

    Operating system: Windows 7 Ultimate Edition

    Version: 6.1 [7601]

    Application architecture: x 64

    System architecture: x 64

    Number of logical processors: 6

    Processor speed: 2.8 GHz

    Built-in memory: 16383,3 MB

    Real memory for Lightroom: 16383,3 MB

    Real memory used by Lightroom: 841,5 MB (5.1%)

    Virtual memory used by Lightroom: 853,0 MB

    Memory cache size: 261,4 MB

    Maximum thread count used by Camera Raw: 6

    Camera Raw SIMD optimization: SSE2

    System DPI setting: 96 DPI

    Composition of the Bureau enabled: Yes

    Exhibition: 1) 1600 x 900, 2) 1600 x 900

    Entry types: Multitouch: no, built-in touch: No, built-in pen: no, touch external: No, external pen: no keyboard: No.

    Graphic processor News:

    AMD Radeon HD 6800 Series

    Check the supported OpenGL: past

    Vendor: ATI Technologies Inc.

    Version: 3.3.13397 context 15.200.1046.0 the base profile

    Renderer: AMD Radeon HD 6800 Series

    LanguageVersion: 4.40

    The application folder: C:\Program Files\Adobe\Adobe Lightroom

    Library path: K:\hdd\photos\Lightroom\Lightroom Catalog.lrcat

    Settings folder: C:\Users\nathan\AppData\Roaming\Adobe\Lightroom

    Plugins installed:

    (1) Behance

    (2) substantive canon Plugin

    (3) Facebook

    (4) Flickr

    (5) irista

    Config.LUA flags: None

    Map #1: Seller: 1002

    Feature: 6738

    Subsystem: e178174b

    Revision: 0

    Video memory: 1011

    AudioDeviceIOBlockSize: 1024

    AudioDeviceName: Speakers (Corsair Gaming H1500 helmet)

    AudioDeviceNumberOfChannels: 2

    AudioDeviceSampleRate: 44100

    Build: not initialized

    Direct2DEnabled: false

    GPUDevice: not available

    OGLEnabled: true

    You can disable the GPU manually by changing the preferences file to LR with a text editor such as notepad and change the line useAutoBahn = true to useAutoBahn = false.  You do not want to do with LR does not.

    On Windows, the LR file is located here:

    C:\Users\- yourusername -\AppData\Roaming\Adobe\Lightroom\Preferences\Lightroom 6 Preferences.agprefs

    You could make a backup copy of a file agprefs on your desktop, firstly, in the case where mess you something.

  • Publish reports migration with graphic functions.

    Hi guys,.
    I'm working on the relationship between 10g and 11g migration and I have a problem with the reports that contains a chart. They give the following error when I run them against the report of 11g Server (they work very well against the server 10g with on all issues)

    The report stopped with the error:
    REP-56048: engine rwEng-1 crushed., job Id: 24.

    I searched on Google for a solution to fix them, the closer, I found was install Oracle Graphics 6i engine in a House separate from the Oracle, but this has been said for 9i and 10g, you can find that in the oracle document below:

    http://www.Oracle.com/technetwork/middleware/reports/graph-FAQ-with-style-094084.html#Q101

    Do anyone knows if I can 6i engine install Oracle Graphics in a separate Oracle 11 g House too?, so that they work at least, if not to change those that exist?

    Thank you
    Sona.

    Hello Sona,
    Unfortunately installation chart 6i to one OH for 11g will not work. This option is possible as long as 10g as a temporary option during migration to the BI beans new chart features in gr 10, 2 and 11 g.

    Reference
    http://www.Oracle.com/technetwork/middleware/reports/graph-FAQ-with-style-094084.html

    Migration Oracle Graphics graphics 6i

    How can I migrate my Oracle graphics cards to the new chart format in reports of Oracle9i or Oracle10g reports?

    Oracle9i Release 1 go, graphical reports from Oracle was desupported. Reports of Oracle9i and Oracle10g use BI beans to generate graphs. Because of the underlying technology, there is no way to direct migration of Oracle Graphics to the bean BI graphing functionality. Therefore, the user will need to rewrite all their new graphics with the graphic Wizard in Report Builder.

    Top of Page

    Can I still use my Oracle Reports Developer 6i existing reports with graphical charts Oracle Oracle reports?

    As stated in the declaration of the Oracle reports, Oracle Graphics is no longer ships with Oracle Reports. However, as part of the migration route, you can still run Oracle Oracle reports graphic graphics if you install Oracle 6i graphics engine in a separate Oracle home. You must only maintain graph Oracle 6i as a temporary measure while redesign you your new charts using the chart wizard. For more details on configuring Oracle to use Oracle Graphics 6i, see Migration of graphics in the Oracle9i Application of Oracle9iAS version 1 (1.0.2.2.x) Server Migration manual version 2 (9.0.2).

    Top of Page

    Can I change or add diagrams of 6i, Oracle Graphics to my reports with Oracle9i reports or reports from Oracle 10 g?

    N ° you must have a separate installation of Oracle 6i graph generator to change your existing graphic Oracle 6i graphics since Oracle Graphics is not delivered with Oracle Reports. We strongly recommend that you migrate your cards to the new standard in the Oracle reports.

    Thank you, RZ

  • MovieClip sprite vs drawing with graphics

    Hello! I have a program that dynamically draws a polygon anywhere where the user clicks on the screen. (using lineto, moveto) However this polygon is always behind the other symbol of objects on the screen even if his last added in the childlist is. Is there a problem with the depth when you draw symbols vs drawing with lines? How can ensure me that my smart object will display in the face?

    Thank you

    Will be

    OK the problem is that you have the graphics in the main class through the polygon class to draw

    which works great but all the objects in the main class, if they are added before or after the polygon will appear above any line draw

    to work around this problem

    change the DrawPolygon() function do not take a target

    so

    public void DrawPolygon() (x: Number, y: Number, sides: uint, RADIUS: Number, angle: number = 0): void

    adjust the call to this function in hand in the appropriate form

    then in DrawPolygon() instead of references to target just replace them with graphics this will draw on the contrary to the purpose of polygon graphics

    Note You can put calls Graphics.Clear and graphics.lineStlye early DrawPolygon() so

    We can then remove the clear and graphics.lineStyle calls in your main class

    hope that makes sense

  • Creating visible buttons with graphics

    After you have created the button with graphics.

    Button layer... See the CIRCLE, MORE white poster, down the place of show, STRUCK by the black circle.

    Can you tell me it's OK because after I add layer to ActionScript still getting errors.

    I want to assure you that I have up to this point.

    a big thank you to you guys who helps others

    What you are doing inside the both graphic key have no impact on issues relating to the code.    The CLICKED image specifies only the clickable area for the button, it is not an image that is displayed at any time.  It is usually used if the clickable area must be different from that of the top lowest areas.

    If you get any errors, you must copy and paste errors in your ad and view the code associated with them.

  • With the help of NumberFormatter with graphics

    I try to use the NumberFormatter with graphics (with the HTTPService data source)

    The numbers are used for the x-axis or the linear axis, coming from an XMLList, i.e.

    "< displayName ="Project"xField="@hours mx:BarSeries ".

    How can I put a version formatted for @hours instead of just raw unformatted numbers? For example I want to insert a comma to show '12 000' instead of '12000 '.

    I have figured out how to make a function to format / change string variables, for example names etc., in a certain measure, but cannot get the numberFormatter to work.

    I created this function:

    < mx:NumberFormatter id = "numForm" useThousandsSeparator = "true" / >

    But I can't understand how to integrate it into the numbers in my DataGrid or on my paintings.

    I found a few web examples covering NumberFormatter...

    http://livedocs.Adobe.com/Flex/3/HTML/Help.HTML?content=charts_formatting_13.html
    http://livedocs.Adobe.com/Flex/3/HTML/Help.HTML?content=formatters_4.html
    http://blog.flexexamples.com/2007/12/13/rounding-numbers-in-Flex-using-the-NumberFormatter - class.

    .. but they are not access data from external sources, and I can't adapt the code for working with graphics.

    Any help would be much appreciated.

    M.

    This site is a good example to do it in a datagrid

    http://blog.flexexamples.com/2007/08/20/formatting-a-Flex-DataGrid-control-using-a-custom--Convertisseur element.

  • Mac Pro equipped with graphics cards

    (1) Apple certified repair done remarkable work or replacement of these cards, seemed as it did thousands due to schools, universities, colleges had all the problems that I did.

    (2) now did the-d option to initialize the data sent to Apple and have assigned Senior Adviser.

    (3) most recent problem is error codes and system dead slow on my second Mac Pro 6 hearts. Now, does not see my Amd hardware, which is extremely strange to say the least.

    (4) 2 weeks no words or calls returned Senior Advisor, still more serious delays to write make some income with new Mac Pro.

    (5) what did not work is not, the example is iMovie stutters sound.

    (6) final Cut Pro sound of of synk

    (7) k video from my new iPad Pro 4 who made 4 K video sent to dump not recognized on Mac Pro system after that reminder of graphics cards has been made.

    so waiting for words from Apple on the d option played 4 times.

    < published by host >

    Nope... but... all I can do is give you my experience. I got a G5 liquid that had major failure 3 times (was under AppleCare) and has been replaced with a Mac pro. I guess you have tried the usual, killer stuff pram resetting the PMU, trying to reinstall and update the operating system and various applications to this topic and all that, and... nothing. Apple does not read or respond to these forums, cmdrDenis, this place is strictly a user forum, and that's all. Save all your receipts, paperwork, document as much as you can and when you talk to Apple or an adviser, be polite, but pragmatic.  Screaming, yelling, Ranting and raving you will get very far.  If you go to apple.com/feedback and leave a comment there, someone can get back to you. Call the main line from Apple can be useful too, but about what, when and how

    I can't say. Apple * may *, in its sole discretion, replace a machine that has had too many major repairs, or repair, but it's Apple to do.  Maybe if you call your local Apple place, explain the situation calmly and kindly and ask to speak to another senior consultant or Manager, perhaps they can help you.

  • Satellite NB10t-A-101 - problem with graphics card Intel using Win 10

    After I upgraded to Windows 10, The graphics card worked fine, at least 4 months later, I saw that the Intel Graphics tray icon was missing when I went into device manager he had a small exclamation mark by it and said

    Your computer's system firmware does include enough information to properly configure and use this device.
    To use this device, contact the manufacturer to obtain a firmware or an update of the BIOS of your computer. (Code 35)

    Then, I looked a little further into the problem and found this:

    Problem code: 00000023
    The problem: the resources for this device in conflict with the MCFG table.
    C0000908

    I have not edited the PC somehow, any solution to this problem
    Specifications of the PC (if needed)

    Model - NB10t-A-101
    Processor - Intel Celeron n 2810 @ 2 GHz
    Graphics card: Intel HD Graphics.
    RAM - 4 GB

    (Another note: I need the last generic graphics driver for Windows 10,)

    If Win10 supports the Intel HD graphics chip, a driver will be available in Windows Update.

    Check if your HD from Intel is compatible:
    http://www.Intel.com/content/www/us/...000005526.html

  • X 360 HP spectrum: spectrum HP x 360 installed with graphics card leaves to be desired?

    In addition to his keyboard hard-to-read white alphanumberic and a serious problem of startup that has left me with without using the computer for several weeks, my x 360 spectrum carried out satisfactorily.

    However, I wonder why my computer program maintenance, on my system, always supports that "your graphics card must be upgraded." I bought the new laptop. Would not a decent graphics card have been included?

    It is not for laptops, in itself. It is a set of suggestions on how to speed up your computer. It is one of the gripes to this topic. Not too smart. Does not have a desk with a laptop computer.

  • HP G42 / G62 / CQ42 motherboard with graphics programs list switchable

    I need a list of hp spare hardware (motherboard)
    especially with switchable graphics, I need to replace my motherboard.

    Page 26 of the manual lists possible motherboards.

    Manual

    It is clear the specifications that you have this card right now:

    Map of system HM55 UMA 595182-001

    That would be the best advice:

    HD6370/1 GB discrete System Board (only for model 1.3) 631594-001

    Who would provide the best video if that's what you try to improve. In order to advise us, we need to know exactly what you're trying to accomplish with the upgrade.

    If it's 'the Answer' please click on 'Accept as Solution' to help others find it.

Maybe you are looking for