The need of the canvas in cascades

This is my first Cascades of learning days, and, in my humble opinion, the presence of a custom Painter on Framework library easy view/stage stunts is an important thing for many developers. QtGui are QGraphicsItem, QGraphicsScene and QGraphicsView classes that make our lives easier. OpenGL and libscreen cascading is like killing flies with shots!

Very low level libs for image manipulation! Image and ImageView classes are too simple for that.

A canvas and QPainter mechanism is required on the Cascades.

Thank you.

Actually the same question has been asked in this thread: http://supportforums.blackberry.com/t5/Cascades-Development/Using-QPainter-on-QImage/m-p/1753995

Note that the stunts forum is more appropriate at this stage for issues related to the Cascades. (For those who didn't know no had been created.)

Tags: BlackBerry Developers

Similar Questions

  • Creating a spike in "panorama"... need advice on the size of the canvas

    Hello... I want to make a panorama style shot of my article in my house. I think that the shot doesn't consist of 3 pictures, no more. My question is what size should I make the canvas if the photos are 2848 x 2136? They will be stuck with an older camera I'm pulling in 6.3 megapixels. Thanks for the help.

    First create a new empty file - use the file... New... PhotoMerge Panorama, then choose the photos that you want to use, and then select "blend the images.  PSE will automatically create the photo panoramic full size for you and you won't have to worry about the size of the canvas.

    Ken

  • Resize an image to fill the canvas size according to height?

    Hi guys,.

    Is it possible to resize a picture to fill the canvas size according to height?

    Currently when I place an image, it fits on width, being a landscape on a canvas portrait image I need to fill the height.

    Any suggestions on the best way to do it, maybe an action?

    Thank you

    Gavin

    If the image containing or the picture may vary in dimensions/dimensions a Scripting approach would seem prudent.

    In the contrary case, a conditional Action may be enough.

  • When is it best to use the canvas and when is it best to use OAM?

    I'm still struggling with this issue.  I have asked before here and am still not clear on what follows.

    You have created something in 2015, CC animate and you want to put it on a page of HTML using Dreamweaver.

    How do you decide if you want to use the canvas or OAM?  This question suggests the need for some kind of a list control page or help help users to this decision.

    Are there certain advantages or disadvantages of each approach?  If so, what are they?  It lends itself to some of the features that the other does not?

    And while the insertion of OAM with Dreamweaver is covered with a document Adobe online, it seems that a help document comparable to the insertion of the canvas in Dreamweaver is not available.

    Animate CC 2015 is a powerful tool to create experiences online on the web.  It would be helpful to have clarity on these issues.

    Please notify.

    Thank you.

    Hello

    Would like first to explain what the OAM file. OAM file is nothing more than a set of HTML files (files of canvas that you publish by selecting javascript/html in publication settings) which is recognized by adobe Dreamweaver, Muse and InDesign applications. OAM file in Adobe Applications using registers an addition of works as Adobe applications place automatically creating directories and the required codes.

    Please see the link below which explains how to insert OAM file in Dreamweaver.

    Export files of CC OAM animate to Dreamweaver and Adobe Muse | Adobe Dreamweaver CC tutorials

    Please do not hesitate to come back to me, in case you need more information on the same.

    Kind regards

    Vivek

  • Rendering of the canvas deteriorates proportionately with the size?

    Can someone explain to me how I can avoid the drop in performance of drawing on a canvas, as its size grows?
    What is the reason for this?

    Run even on a canvas runs more slowly, as the canvas size.

    It also seems that, despite "dirty zone" rendered using JavaFX technology, rendering the scene becomes slower as the size of nodes increases (e.g.: the canvas).
    even if most of it is off-screen. Speed is acceptable when the canvas completely fills my screen size, then the entire screen should already be redrawn.
    but as I increase the size, so the node/canvas already extends outside of the window, made performance continuously decreases as the node expands.

    It is corrected, when setCache (true) is applied.
    However, this does NOT improve drawing performance on the Web, where low latency is essential for a painting application.
    Who seems to be involved, as the documentation advises NOT to Cache, if the node changes frequently.
    Surprisingly then, still cached to True on the Web currently drawn on, more CacheHint = SPEED, seems to improve a little speed.

    Anyway, back to the question: why is based on a painting becomes slower with the size, although the same race, covering the same amount of area, is performed?

    My apologies if I seem confused or repeated myself, I am extremely tired. Thank you in advance and good night.

    It's a beautiful Shindoh descriptive answer.  You have a talent for this sort of thing.

    Reproduce your problem

    Your application does not work even on my machine (Java 8u5, Win 7, 64 bit, ATI Radeon HD 4600), except if I drop the size of the canvas to 8Kx8K (probably because I use an older graphics with capabilities of textures limited).  I drop the size of the canvas, I noticed improvements in performance that outline you, 8 k is really slow to update and pretty unusable at 1 K being quite catchy.

    The exception I get a canvas of 10Kx10K is =>

    java.lang.NullPointerException

    to com.sun.javafx.sg.prism.NGCanvas$ RenderBuf.validate (NGCanvas.java:199)

    at com.sun.javafx.sg.prism.NGCanvas.initCanvas(NGCanvas.java:598)

    at com.sun.javafx.sg.prism.NGCanvas.renderContent(NGCanvas.java:575)

    at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:2043)

    at com.sun.javafx.sg.prism.NGNode.render(NGNode.java:1951)

    at com.sun.javafx.sg.prism.NGGroup.renderContent(NGGroup.java:225)

    at com.sun.javafx.sg.prism.NGRegion.renderContent(NGRegion.java:575)

    at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:2043)

    at com.sun.javafx.sg.prism.NGNode.render(NGNode.java:1951)

    at com.sun.javafx.tk.quantum.ViewPainter.doPaint(ViewPainter.java:469)

    at com.sun.javafx.tk.quantum.ViewPainter.paintImpl(ViewPainter.java:324)

    at com.sun.javafx.tk.quantum.PresentingPainter.run(PresentingPainter.java:89)

    to java.util.concurrent.Executors$ RunnableAdapter.call (Executors.java:511)

    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)

    at com.sun.javafx.tk.RenderJob.run(RenderJob.java:58)

    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

    to java.util.concurrent.ThreadPoolExecutor$ Worker.run (ThreadPoolExecutor.java:617)

    to com.sun.javafx.tk.quantum.QuantumRenderer$ PipelineRunnable.run (QuantumRenderer.java:129)

    at java.lang.Thread.run(Thread.java:745)

    A few suggestions

    10Kx10K is a very large canvas.

    Creation of such a thing is a really a kind of brute force solution.

    I think that you would need to get smarter about manage you such situations.

    In my view, relying on the library to manage the optimization of these paintings is not the way to go.

    Of course, the library can handle OK, but your tests show otherwise, so you'll have to work on a different solution.

    What you can do, is take some knowledge of the specific area of your application to help optimize the use of the canvas so that you can get with a smaller canvas.

    For example, consider the technique involved in the drafting of an engine of tile in JavaFX. It is average for the rendering of graphics games such as Pokemon or Zelda on a canvas, old-school style.  There is a support data format that is the TileMap, there are control logic that keeps track of the coordinates of the currently visible TileMap and there is a rendering engine that makes just the coordinates of tile currently visible on the screen.  You can apply a similar approach to your application - this would allow you to limit the size of the canvas limited to just the size of the portion of the visible screen.  Of course the nature of TileMaps make them especially well optimized for this approach, so the solution is not directly transferable to your application.

    Another project that demonstrates rendering an area almost infinitely great is the Grezi project that defines a JavaFX zoomable user interface, although it uses the SceneGraph and not canvas for this.

    The question may be "why should I should I put the extra mention, more complex logic in my code to draw effectively on a canvas? ' that is ' Why can't the library take care of these things for me?  I think the answers are:

    1. the current implementation of the Web on various platforms may not completely optimized for the treatment of the dirty area and overflow in the visible region to the areas off the screen.

    2. the implementation of the Web cannot make use of any domain specific design optimizations that your application may be familiar with.

    3. you qualify for an architecture of MVC type for your design in any case.

    4. the needs of canvas to deliver a very versatile solution that makes it work well in many situations, but may be not optimal for your particular situation.

    See for example-online the best optimizer is between your ears.

    You might want to try another option is to use the SceneGraph instead of a canvas.  The optimization of the library around the larger scene graphs and area sale/offscreen surface treatment can be more effective in the case of SceneGraphs compared to paintings, particularly in the case of graphs of scene quite sparsely populated.

    No matter what you do, if you want to render the box for 4 K screens, I think that JavaFX (and even some of his other computer pipeline components such as native libraries, drivers graphic, material interfaces screen etc), are not particularly well optimized for the treatment of these high resolutions at the moment.  This is likely to change over time, but expect problems of teeth if you try to make these resolutions at the moment.

    Another thing that I remember is that, to a lesser degree, JavaFX makes often content to the textures on a video card.  Most video cards have some sort of limit to the maximum size of texture and when this limit is reached, to do a layer of additional conversion somewhere in the library code that maps the content to several textures video card and when this way of rendering is called, things slow down significantly.  This limit may be generally around 8Kx8K 4Kx4K (I'm not sure).

    My guess is that this is probably not the answer you wanted ;-)

  • Export all the layers in png in Photoshop, including those outside the canvas area

    I use the script, but if some of my layers are outside the canvas, it removes those the only visible part.

    But we need everything in the layer in png, so is visible in the Web or it is outside.

    Best,

    Gunjan

    Use activeDocument.revealAll (); then export all your layers.

  • Can I resize a layer automatically to fit the canvas?

    Is it possible to scale automatically a layer selected so that it fits the canvas of a PS document? I need to paste several images at high resolution in a small canvas and for the moment the only way I know to resize images to fit the canvas is for them the scale manually by using the free transform. I googled around and two suggestions for an automated process do not work for me: I tried the "automate > picture Fit ' order and absolutely nothing happens and I also have the option"resize the image over the place"checked in my general preferences, but the pasted image is continue to arrive to the size (maybe who works for images placed and not glued).


    I use Photoshop CC 2015.

    Another script to try:

    Shape to the script of canvas layer

    http://www.mixingonbeat.com/phpBB/viewtopic.php?f=103&t=8837

  • The canvas rotation?

    Which versions of Photoshop Elements supports the canvas Rotation tool? (If there is no PE that supports the tool, want someone to recommend me to another product from Adobe that "can't" stand?) A reason I ask this, is because I am a user of graphics tablet and it has come to my attention than most others I know who use other arty programs to design their comics of web graphics. Have some form of rotation of the canvas tool. Makes things ten times more for the traditional artist doing their job without doubt. But another reason, I want to know because I've been sticking with Photoshop Elements 8.0 since... For like... Forever at least. And again - I feel forced while his time, I took what was my PE 8.0. And then big step towards upgrading EP 13.

    I would have thought PE8 can rotate the canvas/image, but I can't test it because I don't have it.  In PSE10, 11, 12, 13 & TI is done by going to:

    Image > rotate

    you will see options for 90 left, 90, 180 and custom ===>> these are very simple, but you can also get a lot more options.  It's just a matter of the use of each of them and see that it fits your needs.  I don't know it can be done otherwise, a graphics package is useless if it can't do simple things like the rotation of a picture or an image layer.

    To rotate the entire canvas, simply select the entire image and then try to turn it.  Make sure that you have performed the copy of the image, just in case you're wrong.

    Good luck.

  • Photoshop can change the size of the canvas for very accurate measurements

    I need the exact measurements for the size of the canvas that needs to be 704,55 mm wide. I noticed that when I create a new document and insert this size for the width of the document it takes 704,51 mm if I check the size of the canvas under Image > canvas size. No explanation as to why it changes the size of the canvas to very exact dimensions?

    Thank you

    An image cannot be fractions of a pixel. Imagine that you have an image that has a resolution of 3 ppi. It's less than an inch to 3 pixel image. Now, you mean a size of 0.5 inch canvas. This would mean an image composed of 1.5 pixels, which is impossible. The image must be rounded to the nearest one who welcomes a whole pixel. You can either simply decide that it is good enough (it is usually), or use a resolution so that the size of your canvas has more pixels that can be divided into your desired size, then maybe you can be able to adjust your resolution exactly to the size of your canvas.

  • How can I make an imported picture smaller without changing the size of the canvas?

    After downloading the free icons, I used the method drag-and - déposer to put the icon of my choice on a blank canvas of 313 x 188 pixels. The image is larger that I need it to be, so I need to make the image smaller while keeping the size of the canvas to 313 x 188 pixels. I tried several things after Google search, but have had no luck. Help; I'm still learning! Thanks in advance!

    CTRL/cmd-T will show the transformation. Then just drag the handles to resize - hold down the SHIFT key to constrain the proportions.

  • Script in Photoshop Actions for the canvas size?

    I have a variety of sizes of illustrations I want to post on my site;  that would take much less time if I could add a white border in Photoshop Actions by increasing the size of the canvas by 1/4 inch.  Thanks for your suggestions, BAB.

    Save a step size of canvas.  Leave the anchor point at the Center. Check relative and the value of 1/2 inch in width and height.  Photoshop will calculate the number of pixels needs to add to increase the width and height 1/2 "and add 1/4-inch canvas on all sides.  If there is a background layer in Photoshop the extra pixels will be 100% opaque and the color can be set in the canvas size dialog box. Can be set to the color of the background sample.  If there is no background layer, the added canvas will be empty.

  • Performance of the canvas

    I've been testing the performance of canvas on a very fast machine (quad core Xeon) by recent NVidia graphics cards, but I am unable to make the video full screen 1920 x 1080 with this configuration using the Web.

    It's simply too much hope for or am I missing some obvious performance enhancements?

    Here's the code I used:
    import java.nio.ByteBuffer;
    
    import javafx.application.Application;
    import javafx.scene.Scene;
    import javafx.scene.canvas.Canvas;
    import javafx.scene.image.PixelFormat;
    import javafx.scene.image.PixelWriter;
    import javafx.scene.image.WritablePixelFormat;
    import javafx.scene.layout.BorderPane;
    import javafx.stage.Stage;
    import uk.co.caprica.vlcj.component.DirectMediaPlayerComponent;
    
    import com.sun.jna.Memory;
    import com.sun.jna.NativeLibrary;
    
    public class VLCDirectTest extends Application {
    
      public static void main(final String[] args) {
        Application.launch(args);
      }
    
      private DirectMediaPlayerComponent mp;
    
      @Override
      public void start(Stage primaryStage) throws Exception {
        NativeLibrary.addSearchPath("libvlc", "c:/program files (x86)/videolan/vlc");
    
        BorderPane borderPane = new BorderPane();
        final Canvas canvas = new Canvas(1920, 1080);
        borderPane.setCenter(canvas);
        System.out.println(">>> " + canvas.getGraphicsContext2D().getPixelWriter().getPixelFormat());
        Scene scene = new Scene(borderPane);
        final PixelWriter pixelWriter = canvas.getGraphicsContext2D().getPixelWriter();
        final WritablePixelFormat<ByteBuffer> byteBgraInstance = PixelFormat.getByteBgraInstance();
    
        mp = new DirectMediaPlayerComponent("RV32", 1920, 1080, 1920*4) {
          @Override
          public void display(Memory nativeBuffer) {
            ByteBuffer byteBuffer = nativeBuffer.getByteBuffer(0, nativeBuffer.size());
            pixelWriter.setPixels(0, 0, 1920, 1080, byteBgraInstance, byteBuffer, 1920*4);
          }
        };
    
        mp.getMediaPlayer().playMedia("L:\\test-movies\\2012.mkv");
    
        primaryStage.setScene(scene);
        primaryStage.show();
      }
    }
    It works, but it hickups and distorts a lot when it hickups. Lower the resolution of 1600 x 900 to say, it is almost smooth. Lowering still gets the expected 24 frames per second.

    Try to use IntBuffer, it's get-buffer possible bytes converted per pixel. I think if the pixel format and the width of the scan line corresponds,
    System.arraycopy (...) is used instead of a loop / conversion on each pixel. It should be enough to download full HD of 25 frames per second.

    There is also no need to use the node of the Web, you can use WritableImage.getImageWriter () .setPixels () with IntBuffer.
    It is possible that the canvas node distributes all the draw lots / pixel in the render thread events and copy the array / buffer again.
    I'd be curious what performance you get.

    And well, I didn't know you could so easily integrate VLC =)

    -----

    PS:
    Oh too bad for me that the WritableImage has a 'ByteBgraPre' (premultiplied) PixelFormat. Then
    imgWriter.setPixels (0, 0, w, h, PixelFormat.getByteBgraPreInstance (), pixels.asByteBuffer (), w * 4);
    was a little better than:
    imgWriter.setPixels (0, 0, w, h, PixelFormat.getByteBgraInstance (), pixels.asByteBuffer (), w * 4);
    For opaque, premultiplied images is not serious anyway. I managed to get 45 fps with upload of 1920 x 1200 pixels.

    Published by: Fatima Sep 2, 2012 09:34

  • Can touch PS change the canvas size?

    Subject says it all.  Sometimes I need to change the size of the canvas, essentially making the bars that I would fill a color.  PS touch it?

    Thank you.

    You can increase the size of the canvas using the crop image tool under the & button.

    If you enter a size larger than the size of the original image, it will create a transparent border of the image that you can fill with a color of your choice.

  • Two images side by side on the canvas?

    Hi, I need to put two images side by side on a canvas, I created the canvas, but I cannot insert the pictures. I use CS6. Who can help me please?

    Thank you!

    the reason why you can't copy it is because it is NOT selected. (use the selection tool to select the option - then your menu will be NOT grayed out.

    a PSD file will copy very well (but if it has more than one layer - only the selected layer will be copied)

    also re: post #3 there is no need to unlock the layer - because - pasting in an existing document will stick (by default) in a NEW layer

  • Export layers to files: how to keep the size of the canvas

    Hello

    I need to export hundreds of layers of PNG files.

    Unfortunately, the Script cultures on the edge of the layer for each file has different dimensions. How to keep the size of the canvas of the PSD in the exported files?

    Thanks for your help

    PS-Version: MacOS, CS 5.1

    trim to untick if this does not work then

    http://www.filesresidence.com/file/acf00llbo09pg# , try this version it can do what you want.

Maybe you are looking for