v_telange

Resolution problem on export schematic diagram in JPGE and PNG format

Discussion created by v_telange on Oct 7, 2010
Latest reply on Nov 15, 2010 by v_telange
Hi,
  I have problem on exporting schematic diagram in JPGE and PNG format. Normaly, if i give 250 resolution at time of exporting then diagram export well. but if i will increase resolution above 250 then  problem will occured in exporting diagram. Diagram will be see as cross mark. No problem on exporting diagram in pdf format. Please see attach code.

public static string Export(ESRI.ArcGIS.ADF.Web.UI.WebControls.Map map, string template, string format, string strElementValues, DataTable dtSelectedFeatures, string strResource)
        {
            string url = string.Empty;
            //get the instance mapbean
            RAPDRP.MapFunctionMgmt.MapBean pMapBean = new RAPDRP.MapFunctionMgmt.MapBean();
            ESRI.ArcGIS.Server.IServerContext pServerContext = null;
            try
            {

                string[] strElementsArray = strElementValues.Split('|');
                //setting mapcontrol to mapbean
                pMapBean.MapControl = map;
                //setting networkresource name to mapbean
                pMapBean.NetworkMapResource = strResource;
                // creating the propertyset at server context
                System.Web.SessionState.HttpSessionState sessionVar = map.Page.Session;
                pMapBean.TargetScheLayerExtend =(ESRI.ArcGIS.ADF.Web.Geometry.Envelope)sessionVar["Envelop"];
                pServerContext = pMapBean.GetServerContext;
                ESRI.ArcGIS.esriSystem.IPropertySet pPropertySet = (ESRI.ArcGIS.esriSystem.IPropertySet)pServerContext.CreateObject("esriSystem.PropertySet");
                //setting values in property set
                for (int intElement = 0; intElement < strElementsArray.Length; intElement++)
                {
                    //assigning values in the property set depending on controls
                    string[] strElementArray = strElementsArray[intElement].Split(',');
                    if (strElementArray[0].StartsWith("txt"))
                    {
                        strElementArray[0] = strElementArray[0].Remove(0, 3);
                    }
                    else if (strElementArray[0].StartsWith("lst"))
                    {
                        strElementArray[0] = strElementArray[0].Remove(0, 3);
                    }
                    //assigning the values in property set
                    pPropertySet.SetProperty(strElementArray[0], strElementArray[1]);

                    if (strElementArray[0] == "Resolution")
                    {
                        if (format == "pdf")
                        {
                            pPropertySet.SetProperty("Resolution", 300);
                            SetPdfPropertySet(pPropertySet);
                        }
                        else if (format == "png")
                        {
                            pPropertySet.SetProperty("Resolution", 300);
                            SetPngPropertySet(pPropertySet);
                        }
                        else if (format == "jpg")
                        {
                            pPropertySet.SetProperty("Resolution",300);
                            SetJpgPropertySet(pPropertySet);
                        }
                    }
                }
               
                pPropertySet.SetProperty("ResolutionScreen", 96);
                short shrtQualityJpeg = 100;
                pPropertySet.SetProperty("QualityJPEG", shrtQualityJpeg);
                pPropertySet.SetProperty("BiLevelThreshold", 256);
                Color defaultColor = System.Drawing.Color.White;
                pPropertySet.SetProperty("BackgroundColor", ToRGBColor(defaultColor, pServerContext).RGB);
                pPropertySet.SetProperty("TransparentColor", ToRGBColor(defaultColor, pServerContext).RGB);
               
                //creating the instance function controller
                RAPDRP.Controller.FunctionController objFunctionController = new RAPDRP.Controller.FunctionController();

                //getting the image url
                url = objFunctionController.ExportPrintLayout(pMapBean, pPropertySet, template, format, dtSelectedFeatures);
                HttpContext.Current.Session["PrintImageURL"] = url;
                return url;
            }
            catch (Exception ex)
            {
                //return "Error:" + ex.Message + "," + ex.StackTrace;
                throw ex;
            }
            finally
            {
                if (strResource == "NetworkResource")
                {
                    if (pServerContext != null)
                    {
                        pServerContext.ReleaseContext();
                    }
                }
            }
        }

Outcomes