Exemple #1
0
        public override bool Render(GravurGIS.Rendering.RenderProperties rp)
        {
            IntPtr hDC = rp.G.GetHdc();

            MapPanelBindings.OGRDrawImage(container, hDC, rp.Scale, rp.DX / rp.Scale, rp.DY / rp.Scale, layerID);
            rp.G.ReleaseHdc(hDC);

            return(true);
        }
Exemple #2
0
        public void UnExecute()
        {
            if (cType == CoordinateType.Display)
            {
                MapPanelBindings.RecalculateImages(scale, (oldD.x / scale), (oldD.y / scale));

                mapPanel.ViewHasChanged(oldD);
            }
            else
            {
                MapPanelBindings.RecalculateImages(scale, (oldD.x), (oldD.y));

                mapPanel.ViewHasChanged(oldD * scale);
            }
        }
Exemple #3
0
        public override bool Render(RenderProperties rp)
        {
            double xOff = rp.DX / rp.Scale;
            double yOff = rp.DY / rp.Scale;

            if (Changed)
            {
                recalculateData(rp.AbsoluteZoom, rp.Scale, xOff, yOff);
            }

            IntPtr hDC = rp.G.GetHdc();

            MapPanelBindings.GDALDrawImage(layermanager.CGDALContainer, hDC,
                                           xOff, yOff, this.layerID);
            rp.G.ReleaseHdc(hDC);
            return(true);
        }
Exemple #4
0
        public bool Execute()
        {
            if (cType == CoordinateType.Display)
            {
                MapPanelBindings.RecalculateImages(scale, (d.x / scale), (d.y / scale));

                mapPanel.ViewHasChanged(d);
            }
            else
            {
                MapPanelBindings.RecalculateImages(scale, (d.x), (d.y));

                mapPanel.ViewHasChanged(d * scale);
            }

            return(true);
        }
Exemple #5
0
 public override void recalculateData(double absoluteZoom, double scale, double xOff, double yOff)
 {
     MapPanelBindings.RecalculateImage(scale, xOff, yOff, this.layerID);
     this.Changed = false;
 }
Exemple #6
0
        public override bool Render(RenderProperties rp)
        {
            double newsize = size / rp.AbsoluteZoom;

            double CurrentxPos = (xPos + rp.DX / rp.AbsoluteZoom) * (newsize / Height);
            double CurrentyPos = (rp.DY / rp.AbsoluteZoom - yPos) * (newsize / Height);

            IntPtr hDC = rp.G.GetHdc();

            MapPanelBindings.DrawMandelbrot(
                cMandelbrot, hDC,
                rp.DX, rp.DY,
                maxIterations,
                CurrentxPos,
                CurrentyPos,
                newsize);
            rp.G.ReleaseHdc(hDC);

            return(true);



            //Color[] cs = new Color[256];
            //// Fills cs with the colors from the current ColorMap file
            //cs = GetColors(ColMaps[CurColMap]);
            //// Creates the Bitmap we draw to
            //Bitmap b = new Bitmap(this.Width, this.Height);
            //// From here on out is just converted from the c++ version.
            //double x, y, x1, y1, xx, xmin, xmax, ymin, ymax = 0.0;

            //int looper, s, z = 0;
            //double intigralX, intigralY = 0.0;
            //xmin = Sx; // Start x value, normally -2.1
            //ymin = Sy; // Start y value, normally -1.3
            //xmax = Fx; // Finish x value, normally 1
            //ymax = Fy; // Finish y value, normally 1.3
            //intigralX = (xmax - xmin) / this.Width; // Make it fill the whole window
            //intigralY = (ymax - ymin) / this.Height;
            //x = xmin;

            //for (s = 1; s < this.Width; s++)
            //{
            //    y = ymin;
            //    for (z = 1; z < this.Height; z++)
            //    {
            //        x1 = 0;
            //        y1 = 0;
            //        looper = 0;
            //        while (looper < 100 && Math.Sqrt((x1 * x1) + (y1 * y1)) < 2)
            //        {
            //            looper++;
            //            xx = (x1 * x1) - (y1 * y1) + x;
            //            y1 = 2 * x1 * y1 + y;
            //            x1 = xx;
            //        }

            //        // Get the percent of where the looper stopped
            //        double perc = looper / (100.0);
            //        // Get that part of a 255 scale
            //        int val = ((int)(perc * 255));
            //        // Use that number to set the color
            //        b.SetPixel(s, z, cs[val]);
            //        y += intigralY;
            //    }
            //    x += intigralX;
            //}
            //bq = b; // bq is a globally defined bitmap
            //this.BackgroundImage = (Image)bq; // Draw it to the form
        }