Package com.emitrom.lienzo.client.core

Examples of com.emitrom.lienzo.client.core.Context2D$GradientJSO


            {
                m_element = Document.get().createCanvasElement();
            }
            if (null == m_context)
            {
                m_context = new Context2D(getNativeContext2D(m_element));
            }
        }
        return m_element;
    }
View Full Code Here


                {
                    draw = m_olbd.onLayerBeforeDraw(this);
                }
                if (draw)
                {
                    Context2D context = getContext();

                    Transform transform = null;

                    if (isTransformable())
                    {
                        transform = getViewport().getTransform();
                    }
                    if (transform != null)
                    {
                        context.save();

                        context.transform(transform);
                    }
                    drawWithTransforms(context);

                    if (transform != null)
                    {
                        context.restore();
                    }
                    if (m_olad != null)
                    {
                        m_olad.onLayerAfterDraw(this);
                    }
                    if (isListening())
                    {
                        SelectionLayer selection = getSelectionLayer();

                        if (null != selection)
                        {
                            selection.clear();

                            context = selection.getContext();

                            if (transform != null)
                            {
                                context.save();

                                context.transform(transform);
                            }
                            drawWithTransforms(context);

                            if (transform != null)
                            {
                                context.restore();
                            }
                        }
                    }
                }
            }
View Full Code Here

    {
        if (false == m_virgin)
        {
            if (LienzoGlobals.getInstance().getLayerClearMode() == LayerClearMode.CLEAR)
            {
                Context2D context = getContext();

                if (null != context)
                {
                    context.clearRect(0, 0, m_wide, m_high);
                }
            }
            else
            {
                setPixelSize(m_wide, m_high);
View Full Code Here

     */
    public final ImageData copy()
    {
        ScratchCanvas scratch = new ScratchCanvas(getWidth(), getHeight());

        Context2D context = scratch.getContext();

        context.putImageData(this, 0, 0);

        return context.getImageData(0, 0, getWidth(), getHeight());
    }
View Full Code Here

                // Prepare the Image for the Selection Layer.
                // Get ImageData of the image by drawing it in a temporary canvas...

                ScratchCanvas scratch = new ScratchCanvas(m_destinationWidth, m_destinationHeight);

                Context2D context = scratch.getContext();

                context.drawImage(m_imageJSO, m_x, m_y, m_width, m_height, 0, 0, m_destinationWidth, m_destinationHeight);

                ImageData imageData = context.getImageData(0, 0, m_destinationWidth, m_destinationHeight);

                // Now draw the image again, replacing each color with the color key

                scratch.clear();

                Color rgb = Color.fromColorString(m_picture.getColorKey());

                context.putImageData(new RGBIgnoreAlphaImageDataFilter(rgb.getR(), rgb.getG(), rgb.getB()).filter(imageData), 0, 0);

                // Load the resulting image from the temporary canvas into the selection Image

                String dataURL = scratch.toDataURL();
View Full Code Here

        {
            return null;
        }
        ScratchCanvas scratch = new ScratchCanvas(m_destinationWidth, m_destinationHeight);

        Context2D context = scratch.getContext();

        context.drawImage(m_imageJSO, m_x, m_y, m_width, m_height, 0, 0, m_destinationWidth, m_destinationHeight);

        ImageData imageData = context.getImageData(0, 0, m_destinationWidth, m_destinationHeight);

        return imageData;
    }
View Full Code Here

        {
            return null;
        }
        ScratchCanvas scratch = new ScratchCanvas(m_destinationWidth, m_destinationHeight);

        Context2D context = scratch.getContext();

        context.drawImage(m_imageJSO, m_x, m_y, m_width, m_height, 0, 0, m_destinationWidth, m_destinationHeight);

        if (mimeType == null)
        {
            return scratch.toDataURL();
        }
View Full Code Here

TOP

Related Classes of com.emitrom.lienzo.client.core.Context2D$GradientJSO

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.