Canvas to image in J9

Hello,
I would like to know if somebody knows like keeping canvas in an image.
In CDC and J9
Thanks

Ho to save a canvas as an image in J9 and CDC.
It seems that I already have resolute by means of the tool Jimi de Sun. Anyway I will thank for any new contribution.
Thanks

Similar Messages

  • Get canvas.toDataURL('image/jpeg') and convert base64 encoding to java.sql.Blob

    Convert canvas.toDataURL('image/jpeg') to java.sql.Blob.
    I am using oracle adf so I am able to action a backing bean from javascript and pass in parameters as a map. I pass in the canvas.toDataURL('image/jpeg') which I then try to decode in my bean. Using BASE64Decoder and the converting the bytearray to a file I can see the image is corrupted as I can't open the file thus converting the bytearray to blob is also a waste.
    Has anyone any ideas on base64 encoding from canvas.toDataURL to file or Blob?

    Use Case:
    A jsf page that enables a user to take photos using the HTML5 canvas feature - interact with webcam -, take photos and upload to profile
    1. I have created the jsf page with the javascript below; this pops up as a dialog and works okay and onclick an upload image, triggers the snapImage javascript function below and sends the imgURL parameter to the serverside managedbean
    <!-- java script-->
    function snapImage(event){
                    var canvas = AdfPage.PAGE.findComponent('canvas');
                    AdfCustomEvent.queue(event.getSource(),"getCamImage",{imgURL:canvas.toDataURL('image/jpeg'),true);
                    event.cancel();
    <!-- bean -->
    public void getCamImage(ClientEvent ce){
    String url=(String)ce.getAttributes().get("imgURL");
    decodeBase64URLToBlob(url);
    private BlobDomain decodeBaseB4URLToBlob(String url64){
                    BASE64Decoder de=new BASE64Decoder();
                    byte[] bytes=de.decode(url64);
                    File file=new File("abc.jpg");
                    InputStream in = new ByteArrayInputStream(bytes);
                    BufferedImage bImageFromConvert = ImageIO.read(in);
                    in.close();
                    ImageIO.write(bImageFromConvert, "jpg", file);
                    return createBlobDomainFromFile(file);
    ----problem---
    Accessing the generated jpeg file shows the image is corrupted, probably missing bytes or encode/decoder issues.and the blob image after uploading to database is saved as a binary stream which ondownload doesnt render as an image or anything i know of.
    Is there anyways of achieving the conversion without errors?

  • Convert Canvas to Image in sapui5

    Convert canvas to image using controller in sapui5,I have tried these codes but nothing works..Please help me.
    Here is my code:
    onOkCloseButton : function(oEvent) {
      var view = this.getView();
      var canvas = view.byId("canvas");
    var dataURL = canvas.toDataURL("image/png");
    // var window = window.open();
    // window.document.write('<img src="'+dataURL+'"/>');
    // window.location = (canvas.toDataURL('image/png'));
    // var dataURL = canvas.toDataURL();
    // $.post("http://localhost:31651/Registration_Card/index.html", { img : canvas.toDataURL() }) 
    // .done(function(data) { 
    //  alert("Image Sent to Server "); //on completion 
    // Canvas2Image.saveAsJPEG(canvas);
    // var oImgJPEG = Canvas2Image.saveAsJPEG(canvas, true);
    // Canvas2Image.saveAsPNG(canvas, false, 100, 100);
      oEvent.getSource().getParent().close();

    Ho to save a canvas as an image in J9 and CDC.
    It seems that I already have resolute by means of the tool Jimi de Sun. Anyway I will thank for any new contribution.
    Thanks

  • Rendering Canvas with Images - Display is flashing

    Hello everybody.
    I have created a Canvas within a Frame. This canvas contains many static pictures (.jpg and .png) and static texts. I also print out next to some of these images and static texts some values as strings using drawString.
    These values are changed depending on some calculations taking place.
    The problem is that the overall GUI is flashing periodically, and it does not look very nice.
    How can I render the whole GUI without these flashing problems?
    I write down my way:
    public class myCanvas extends Canvas implements Runnable
    public myCanvas()
    //This is a THREAD
            Thread t=new Thread(this);
            t.start(); //start it
    public void paint(Graphics g)
            //Static image and static text
            g.drawImage(image2, 1,5, this);
            Font font=new Font("Tahome",Font.BOLD,14);
            g.setFont(font);
            g.drawString("Value:",62,40);
    public void update(Graphics g)
            Font font=new Font("Tahome",Font.BOLD,20);
            g.setFont(font);
    // I 'd like to update only the values next to static image and static text from paint()
            g.drawString(cntTester+" bpm",148,42);
            cntTester++;
    public void run()
            //Firts wait for the images to fully load and paint
            try
                for (int i=0;i<4;i++)
                    mediaTracker.waitForID(i);
            catch (Exception ex)
      while (isPlay == true)
                try
                    Thread.sleep(2000); //2 secs
                catch(Exception ie)
                this.repaint(140,25,80,25); //Repaint specific sections
            }The above Canvas is instantiated within a Frame.
    I really appreciate nay help and guidelines.
    Regards,
    kalgik

    The flashing is really depends on the Thread.sleep() timeout.
    import java.awt.*;
    public class myCanvas extends Canvas implements Runnable
        //Declaration of variables
        private int cntTester=0; //It used only for test, to update values for parameters
        private MediaTracker mediaTracker;
        private Color colour;
        private Font font14;
        private Font font20;
        private Thread t;
        public myCanvas()
            colour=new Color(0x000000); //-> Black colour for letters
            font14=new Font("Tahome",Font.BOLD,14);
            font20=new Font("Tahome",Font.BOLD,20);
            this.setVisible(true);
            this.setBounds(2,2,235,315);
            init();
            //This is a THREAD
            t=new Thread(this);
            t.start(); //start it
       public void run()
            //First wait for the images to fully load and paint
            try
                for (int i=0;i<1;i++)
                    mediaTracker.waitForID(i);
            catch (Exception ex)
            while (isPlay == true)
                try
                    Thread.sleep(2000);//The flashing depends on this timeout (2 seconds).
                catch(Exception ie)
                myupdate();
                repaint(500,69,20,170,134); //repaint specific area of Canvas
        //I got rid of the overidden method update(Graphics g)
        public void myupdate()//Graphics g)
            cntTester++; //Simply increment the value of this variable
        public void init()
           mediaTracker = new MediaTracker(this);
            //Image Heart rate
            String imageHeartRateName="Images/Icons/HeartRate/heart-64x64.png";
            imageHeartRate = Toolkit.getDefaultToolkit().createImage(imageHeartRateName);
            mediaTracker.addImage(imageHeartRate, 0);
       public void paint(Graphics g)
            super.paint(g);
            System.out.println("Passing from [paint]");
            g.setColor(colour);
            //Heart rate:
            g.drawImage(this.imageHeartRate, 1,5, this);
            g.setFont(font14);
            g.drawString("Heart Rate:",62,40);//String , coordinates
            g.setFont(font20);
            g.drawString(cntTester+" bpm",148,42);//String , coordinates
    }

  • **Urgent**: GO_ITEM to pop-up CANVAS with IMAGE in Sun JRE gives error

    Our Forms 10g Environment is this: Forms [32 Bit] Version 10.1.2.0.2 (Production) using Sun JRE i.e. Java Plug-in 1.6.0_06
    Problem is that when we try to navigate to a canvas (from a Button) which has an IMAGE ITEM the form is exited. This happens in every form which has a canvas with an image.
    i.e. In Button, we have code: Go_Item('block123.button1'). Button1 is also in that pop-up canvas.
    Even GO_BLOCK gives the same result.
    If the image is in the same canvas as the button which has GO_ITEM code, then it works.
    Of course this whole things works fine in JInit. But we need to run in Sun JRE.
    Is this a Bug?? Any help would be greatly appreciated.

    christian erlinger wrote:
    Well, as you are on 10.1.2.0.2 I strongly suggest that you apply the latest Patchset (10.1.2.3) the latest CPU Patches and the latest merge Patches. A lot of focus related things are fixed in those patches.
    cheersI will do this and let u know thans.

  • Dropping image on canvas causes image to jump.

    When I drop an image on a canvas in AIR the image "jumps" a few pixels to several from the current mouse location.
    So if the mouse is at location (12, 12) and I drop the image it may appear at (10, 14), or (15, 20), or whatever. It doesn't appear to be a consistent offset like I would expect if this were caused by using global to local mouse position thing (but I'm not ruling that out anyway).
    Secondly, when I then drag to move the image on the canvas the drag proxy will again jump many pixels from the mouse cursor.
    Here is my mouse down handler:
                private function dragBegin(event:MouseEvent):void
                      var dragInitiator:Image = Image(event.currentTarget);
                    var ds:DragSource = new DragSource();
                    ds.addData(dragInitiator, "img");   
                    var dragProxy:Image = new Image();
                    dragProxy.source = event.currentTarget.source;
                    DragManager.doDrag(dragInitiator, ds, event, dragProxy);
    And the drop handler:
            private function dragDropHandler(event:DragEvent):void
                   var image:Image = Image(event.dragSource.dataForFormat("img"));
                   image.x = event.localX;
                   image.y = event.localY;
                   UIComponent(event.currentTarget).addChild(device);
    What am I doing wrong that is causing this jumping?
    Thanks,
    -Mark

    Hi,
    I think the only way to do this is to use a jsp with a servlet, where the servlet would create the image and send it over as a stream, while the jsp would call on the link of the servlet and display that image using the HTML <IMG> tag.
    So, if you have a servlet, lets call it PictureServlet.
    This is what you would do in your servet:
    // create that image and send it over from the doPost/doGet method of the servlet
    public void doPost(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
    response.setContentType("image/jpg"); // set the stream to be a JPEG image
    ServletOutputStream sos = response.getOutputStream(); // create the output stream
    BufferedImage bImg = createImage(); // this is where you write on your image using canvas and return it as a Bufferedimage
    ImageIO.write(bImg,"JPG",sos); // write the image to the stream as JPEG
    sos.close(); // close the output stream
    public void doGet(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
            doPost(request, response);
        } This is how you would get that image and display it in your JSP.
    <img src="../servlet/PictureServlet" name="pic">Note the path might be different, depending on the hierarchy of where jsps and servlets are stored on the server.
    I hope this helps,
    Val.

  • Would you mind to implement that when websites attempts to access image data on a canvas, blank image data can be returned?

    Issue: privacy (protection)
    Additional to cookies and so on, canvas imagedata is used to discover information about computers. Then Tor Browser Bundle (TBB) - Firefox ESR 24.7.0 automatically returns blank image data and shows option to switch it of and else.
    Would be nice to have this in Standard Firefox.
    Contained in TBB 3.6.3 en-us for Windows from torproject.org

    Thanks, someone else raised this issue a few weeks ago: [https://support.mozilla.org/questions/1011864 Why is FireFox allowing "Canvas Fingerprinting" to track me?]
    Since this forum focuses on the Firefox available today, a better place to make suggestions for changes to Firefox is the Feedback site: https://input.mozilla.org/feedback
    Also, a formal request for enhancement (bug) was filed in July: [https://bugzilla.mozilla.org/show_bug.cgi?id=1041818 Bug #1041818 – take steps to mitigate canvas fingerprinting].
    It's generally not helpful to add "me too" or "hurry up" comments to bugs, but you can register on the Bugzilla site and "vote" for them to be fixed. See:
    * [https://bugzilla.mozilla.org/page.cgi?id=etiquette.html Bugzilla Etiquette]
    * [https://bugzilla.mozilla.org/page.cgi?id=voting.html Voting]

  • How do I display Canvas Graphic image (Not Iconic button) from jar file

    Hi all,
    I am currently using Forms 10g.
    I have gone through the tutorials on how to add Button Icons into Jar files for web enables forms .....so far so good
    This however does not explain what I actually want to do... since "graphic images are by nature embeded in the for rather than referenced ......so here goes ..
    I have a forms 10g application where all the individual form modules/canvases display a big banner (covering top 20% of the screen). This was done by importing the image straight unto the content canvases. As you know this now becomes a "graphic Image" now embeded(& not referenced by file name) on the canvas. Also bear in mind that this is actually different from an "Image Item" which is a block object.
    I dont know if this is possible, but what steps do i follow to make the image part of a jar file as opposed to my current situation. Please let me know if possible or not so I stop waisting development time looking for answers :)
    Another question is how do i make this jar file a library object so that we can vary the image as we wish
    NB: one other trick which i can think of is to create a giant push button across the screen to display the image and then stick it in a jar file !
    Cheers
    css_jay99

    I don't know about embedded images imported in from the builder, but there is a way to use READ_IMAGE_FILE into a BLOCK.IMAGE_ITEM where the images are all in a jar file stored on the OAS.
    Metalink Note:137397.1 explains it in details.
    Tony

  • Canvas and image sizes

    When placing a frame onto a photo the canvas increases in size. The canvas area outside of the frame/ photo area is checkered and I have read on the forum that this means it is transparent, right? Is yes, then how do I get Photoshop to stop printing it out as a gray border?
    In the meantime I have been using the canvas resizing feature to reduce the canvas size. I use pixel mode so I can change it in fine increments. Is there a way of quickly making the canvas size the same as the image size? I see where the canvas size information is the same as the image but there is a checkered border around the image.
    Thanks for your help.
    Pete

    Marquee tool, then Image>Crop would be better.
    >how do I get Photoshop to stop printing it out as a gray border?
    Save as TIFF, PSD, PNG-24, or PDF, since those formats allow transparency. JPEG does not.

  • Fit Canvas to Image - larger or smaller

    I have hundreds of images being replaced with new versions that are slightly larger.
    Each is being opened in PS and the new image pasted in.
    I want to resize the canvas ... a single command, not get info a entering numbers ... to the now larger image.

    Image menu > Reveal All  will expand the canvas to the size of the new picture.
    Gene
    (Click on the correct button if this answers your question).

  • Canvas or image item ?

    Hi there,
    I m trying to download an image from a web server. Everything fine till now but my problem is in choosing form-->image item or use canvas for drawing image.
    As its said horizontal scrolling is not available with forms while with canvas we need to code it. Is forms-->image item available with midp 1.0 ?
    Please advice.
    Regards.

    hi
    my advice is if u want to put or disaplay only image its better you use form (High Level API) .If you want to do formatting thats if you want to choose spcific location or add some text with Image its better you use Canvas.
    because when you use form there are number of limitation with using form that it is not able to load tha image on the location that we want .With image item it gives some layouts but no othar alternative.but this is not the case with Canvas.

  • Save Canvas to Image

    Hi.
    I'm making a simple program that saves a Canvas to an image... But it will only save it in black & white.
    Can anybody help??

    Never mind, I figured it out.

  • Save canvas as image to the picture library using c#,xaml in windows 8.1

    Hi everyone,
    I am developing a small paint application in that I am using canvas as a drawing area. Now I need to save that drawing as an image to the picture library.
    How can I do this?
    Please help me.
    Thanks in advance

    Use RenderTargetBitmap to render your Canvas into a bitmap. Use BitmapEncoder to encode the bitmap as a JPG or png, then save it our with a StorageFile.
    See the sample at
    http://code.msdn.microsoft.com/windowsapps/XAML-render-to-bitmap-dd4f549f

  • Save Canvas to Image in Color.

    I have a simple program that saves a canvas. It works... but only in black and white. Does any body know how to save it in Color??

    I give up...
    If you're reading this, then you're too late, I've already left.
    -James

  • Background-image of a Design Studio 1.3 extension is not displayed when the control is  dragged on the canvas

    Hello,
    I have a Design Studio Extension with a background image which behave well in Design Studio 1.2.
    In Design Studio 1.3 when I drag the control into the canvas the image does not show-up. If I execute the application the image appear in the browser even is not in the canvas.Once I save and reopen the application the image is displayed on the canvas as expected.
    I built an extension based on  the 'Timer' sample which comes with the DS_13_SDK_Samples ( it has a background image) and it behaves the same way - when you drag the control on the canvas, the image is not displayed.
    Any help to solve this issue is much appreciated.
    Thank you.

    It does start to work once I save and reopen or even when I run.
    I tried the inline style but the behavior is much stranger. It does work if I have a full address url to an image, but if my image is part of the control's folder structure it fails completely - it cannot map the right address to the image. The only configuration that appears to work better is the one with the original problem.
    Thank you.

Maybe you are looking for