示例#1
0
        public void RotatedImage()
        {
            Color  col = ScriptingUtilities.rd_GetColor("Pink");
            string img = Path.Combine(sampleDocumentDir, "Rotate.tif");

            OCCSinglePage sp = new OCCSinglePage(img, 270);

            sp.FillRectangle(new SolidBrush(col), new Rectangle(50, 50, 100, 40));
            sp.FillRectangle(new SolidBrush(col), new Rectangle(1000, 1000, 500, 200));
            sp.Save(img + ".tif");
        }
        private static void rd_redactField(Document doc, string variant, Field f, string color)
        {
            if (f.State == DataState.Empty)
            {
                return;
            }
            if (f.Zone.Height == 0 && f.Zone.Width == 0)
            {
                return;
            }

            // We need to locate the sources at the document,
            // only they contain the variants as well as the rotation
            foreach (ImageSource ims in doc.Sources)
            {
                if (ims.Url != f.Sources[0].Url)
                {
                    continue;                               // find page
                }
                if (pageMap.ContainsKey(f.Sources[0].Id))
                {
                    break;                                       // page already loaded
                }
                pageMap[f.Sources[0].Id] = rd_createPage(ims.SelectInstance(variant));
            }

            // Redact the zone
            OCCSinglePage sp = pageMap[f.Sources[0].Id].Bitmap;

            sp.FillRectangle(new SolidBrush(rd_GetColor(color)), f.Zone);
        }