Exemplo n.º 1
0
        private PrintTypeEnum GetPrintType(ZMotifGraphics.RibbonTypeEnum ribbonType)
        {
            switch (ribbonType)
            {
            case ZMotifGraphics.RibbonTypeEnum.Color:
                return(PrintTypeEnum.Color);

            case ZMotifGraphics.RibbonTypeEnum.MonoUV:
                return(PrintTypeEnum.MonoK);

            case ZMotifGraphics.RibbonTypeEnum.MonoK:
                return(PrintTypeEnum.MonoK);

            case ZMotifGraphics.RibbonTypeEnum.Overlay:
                return(PrintTypeEnum.Overlay);

            case ZMotifGraphics.RibbonTypeEnum.GrayUV:
                return(PrintTypeEnum.MonoK);

            case ZMotifGraphics.RibbonTypeEnum.GrayDye:
                return(PrintTypeEnum.GrayDye);

            case ZMotifGraphics.RibbonTypeEnum.Monok_NoPanels:
                return(PrintTypeEnum.MonoK);

            case ZMotifGraphics.RibbonTypeEnum.Inhibit:
                return(PrintTypeEnum.MonoK);

            default:
                return(PrintTypeEnum.MonoK);
            }
        }
Exemplo n.º 2
0
        private byte[] BuildImageXY(byte[] image, float x, float y, int width, int height, ZMotifGraphics.ImageOrientationEnum ImageOrientation,
                                    ZMotifGraphics.RibbonTypeEnum RibbonType, out string errMsg)
        {
            errMsg = string.Empty;

            byte[] TheImage = null;

            ZMotifGraphics graphics = null;

            try
            {
                int dataLen = 0;

                graphics = new ZMotifGraphics();

                graphics.InitGraphics(0, 0, ImageOrientation, RibbonType);

                if (RibbonType != ZMotifGraphics.RibbonTypeEnum.Color)
                {
                    graphics.ColorProfile = string.Empty;
                }

                graphics.DrawImage(ref image, x, y, width, height, (float)0.0);


                if (image != null)
                {
                    TheImage = graphics.CreateBitmap(out dataLen);
                }

                return(TheImage);
            }
            catch (Exception ex)
            {
                TheImage = null;
                errMsg   = ex.StackTrace;
            }
            finally
            {
                graphics.ClearGraphics();
                graphics.CloseGraphics();
                graphics = null;
            }
            return(null);
        }
Exemplo n.º 3
0
        private byte[] BuildOverlayImage(byte[] image, out string errMsg)
        {
            errMsg = string.Empty;

            byte[] TheImage = null;

            ZMotifGraphics graphics = null;

            try
            {
                int dataLen = 0;

                graphics = new ZMotifGraphics();

                ZMotifGraphics.RibbonTypeEnum       RibbonType       = ZMotifGraphics.RibbonTypeEnum.Overlay;
                ZMotifGraphics.ImageOrientationEnum ImageOrientation = ZMotifGraphics.ImageOrientationEnum.Landscape;

                graphics.InitGraphics(0, 0, ImageOrientation, RibbonType);

                graphics.ColorProfile = string.Empty;

                graphics.DrawImage(ref image, ZMotifGraphics.ImagePositionEnum.Centered, 1100, 700, 0);

                if (image != null)
                {
                    TheImage = graphics.CreateBitmap(out dataLen);
                }

                return(TheImage);
            }
            catch (Exception ex)
            {
                TheImage = null;
                errMsg   = ex.StackTrace;
            }
            finally
            {
                graphics.ClearGraphics();
                graphics.CloseGraphics();
                graphics = null;
            }
            return(null);
        }
Exemplo n.º 4
0
        private byte[] BuildText(string text, float x, float y, string font, float fontSize, int fontColour, ZMotifGraphics.FontTypeEnum fontType,
                                 ZMotifGraphics.ImageOrientationEnum ImageOrientation, ZMotifGraphics.RibbonTypeEnum RibbonType, out string errMsg)
        {
            errMsg = string.Empty;

            byte[] TheImage = null;

            ZMotifGraphics graphics = null;

            try
            {
                int dataLen = 0;

                graphics = new ZMotifGraphics();

                graphics.InitGraphics(0, 0, ImageOrientation, RibbonType);

                if (RibbonType != ZMotifGraphics.RibbonTypeEnum.Color)
                {
                    graphics.ColorProfile = string.Empty;
                }

                graphics.DrawTextString(x, y, text, font, fontSize, fontType, fontColour);

                TheImage = graphics.CreateBitmap(out dataLen);

                return(TheImage);
            }
            catch (Exception ex)
            {
                TheImage = null;
                errMsg   = ex.StackTrace;
            }
            finally
            {
                graphics.ClearGraphics();
                graphics.CloseGraphics();
                graphics = null;
            }
            return(null);
        }
Exemplo n.º 5
0
        private byte[] BuildTest(ZMotifGraphics.ImageOrientationEnum ImageOrientation, ZMotifGraphics.RibbonTypeEnum RibbonType, out string errMsg)
        {
            errMsg = string.Empty;

            byte[] TheImage = null;

            ZMotifGraphics graphics = null;

            try
            {
                int dataLen = 0;

                graphics = new ZMotifGraphics();

                graphics.InitGraphics(0, 0, ImageOrientation, RibbonType);

                if (RibbonType != ZMotifGraphics.RibbonTypeEnum.Color)
                {
                    graphics.ColorProfile = string.Empty;
                }

                graphics.DrawRectangle(20, 20, DEFAULT_WIDTH - 40, DEFAULT_HEIGHT - 40, 10, System.Drawing.Color.Black.ToArgb());
                graphics.DrawTextString(25, 25, "PRINT TEST", "Arial", 12, ZMotifGraphics.FontTypeEnum.Bold, System.Drawing.Color.Black.ToArgb());

                TheImage = graphics.CreateBitmap(out dataLen);

                return(TheImage);
            }
            catch (Exception ex)
            {
                TheImage = null;
                errMsg   = ex.StackTrace;
            }
            finally
            {
                graphics.ClearGraphics();
                graphics.CloseGraphics();
                graphics = null;
            }
            return(null);
        }