示例#1
0
    public void drawrectImage(ImageData1 img, float x, float y, float x2, float y2, int w2, int h2)
    {
        x += swing_x;
        y += swing_y;

        int w, h;

        DX.GetGraphSize(img.call(), out w, out h);
        int flag = 0;

        //範囲内
        int rang = 1280;

        //	int flag=0;
        if (x + w / 2 >= 0 - rang && x - w / 2 <= 0 + world_w + rang)
        {
            if (y + h / 2 >= 0 - rang && y - h / 2 <= 0 + world_h + rang)
            {
                flag = 1;
            }
        }

        int n = 0;

        if (flag == 1)
        {
            n = DX.DrawRectGraph((int)x, (int)y, (int)x2, (int)y2, w2, h2, img.call(), 1, turnflag);
        }
        //    return n;
    }
示例#2
0
    public int drawImage(ImageData1 img, float x, float y, float large, float angle)
    {
        x += swing_x;
        y += swing_y;

        //	if (explode_f==true){x+=explode_x;y+=explode_y;}
        int w, h;

        DX.GetGraphSize(img.call(), out w, out h);

        int flag = 0;

        //範囲内
        int rang = 60;

        //	int flag=0;
        if (x + w / 2 >= 0 - rang && x - w / 2 <= 0 + world_w + rang)
        {
            if (y + h / 2 >= 0 - rang && y - h / 2 <= 0 + world_h + rang)
            {
                flag = 1;
            }
        }

        if (flag == 1)
        {
            if (large <= 0.99f || large >= 1.01f)
            {
                Anti_aliasing();
            }

            float PI  = 3.141592f;
            int   ntt = 0;

            ntt = DX.DrawRotaGraph((int)x, (int)y, large, -angle / 360 * PI * 2, img.call(), 1, turnflag);

            if (large <= 0.99f || large >= 1.01f)
            {
                Anti_aliasing_re();
            }

            return(ntt);
        }
        else
        {
            return(-1);
        }
    }
示例#3
0
    //描画
    public int drawImage(ImageData1 img, float x, float y)
    {
        //  x += swing_x;
        //  y += swing_y;

        int w, h;

        DX.GetGraphSize(img.call(), out w, out h);

        int flag = 0;

        //範囲内
        int rang = 60;

        //	int flag=0;
        if (x + w / 2 >= 0 - rang && x - w / 2 <= 0 + world_w + rang)
        {
            if (y + h / 2 >= 0 - rang && y - h / 2 <= 0 + world_h + rang)
            {
                flag = 1;
            }
        }


        if (flag == 1)
        {
            //return DX.DrawGraph((int)x-w/2,(int)y-h/2,img,1);
            return(this.drawImage(img, (int)x, (int)y, 1, 0));
        }
        else
        {
            return(-1);
        }
    }
示例#4
0
    public int drawImage2(ImageData1 img, float x, float y)
    {
        x += swing_x;
        y += swing_y;

        //	if (explode_f==true){a+=explode_x;b+=explode_y;}
        int w, h;

        DX.GetGraphSize(img.call(), out w, out h);
        int flag = 0;

        //範囲内
        int rang = 10;//81;

        //	int flag=0;
        if (x + w >= 0 - rang && x <= 0 + world_w + rang)
        {
            if (y + h >= 0 - rang && y <= 0 + world_h + rang)
            {
                flag = 1;
            }
        }

        /*
         * int rang = 120;//81;
         * //	int flag=0;
         * if (x + w / 2 >= 0 - rang && x - w / 2 <= 0 + world_w + rang)
         * {
         *  if (y + h / 2 >= 0 - rang && y - h / 2 <= 0 + world_h + rang)
         *  {
         *      flag = 1;
         *  }
         * }
         */

        //	int w,h;
        //	GetGraphSize(mx ,&w ,&h);

        int n = 0;

        if (flag == 1)
        {
            n = DX.DrawGraph((int)x, (int)y, img.call(), 1);
        }
        return(n);
    }
示例#5
0
    //そのイメージが存在するかどうか (1,存在 0,無し)
    public int image_check(ImageData1 img)
    {
        int check_flag = 1;

        if (img.call() == -1)
        {
            check_flag = 0;
        }

        return(check_flag);
    }
示例#6
0
    public ImageData1 split_image(ImageData1 img, int x, int y, int w, int h)
    {
        int nt1 = 0;

        ImageData1 imgdata1 = new ImageData1();

        nt1 = DX.DerivationGraph(x, y, w, h, img.call());

        imgdata1.adress_set(nt1);

        return(imgdata1);
    }
示例#7
0
    //画像削除
    public int delete_graph(ImageData1 img)
    {
        int img2 = img.call();

        if (img2 != -1)
        {
            int nt1 = DX.DeleteGraph(img2);
            img.adress_delete1();

            return(nt1);
        }
        else
        {
            return(-1);
        }
    }
示例#8
0
    /*
     * //メモリ開放
     * public void release()
     * {
     *  for (int t3 = 0; t3 < NUMBER_2; t3++)
     *  {
     *      if (img[t3] != -1)
     *      {
     *          g.delete_graph(img[t3]);
     *      }
     *
     *      img[t3] = -1;
     *  }
     * }
     */



    void split_load(string name, int type, int number, int type3, int x_num, int y_num)//, int sload)
    {
        if (m1.strlength(name) >= 1)
        {
            if (x_num <= 1 && y_num <= 1 || type3 >= 1)
            {
                {
                    img[type][number][type3] = g1.load_image(name);
                }
            }

            else if ((x_num >= 2 || y_num >= 2) && type3 == 0)
            {
                ImageData1 image = new ImageData1();
                image = g.load_image(name);

                if (x_num * y_num <= NUMBER_2)
                {// || send2==1){
                    for (int t3 = 1; t3 <= y_num; t3++)
                    {
                        for (int t2 = 1; t2 <= x_num; t2++)
                        {
                            int size_x, size_y;
                            //	DX.GetGraphSize(image,&size_x,&size_y);
                            DX.GetGraphSize(image.call(), out size_x, out size_y);

                            int xn = x_num;
                            int yn = y_num;

                            {
                                img[type][number][(t2 - 1) + (t3 - 1) * (xn)] = g.split_image(image, (t2 - 1) * size_x / xn, (t3 - 1) * size_y / yn, size_x / xn, size_y / yn);
                            }
                        }
                    }
                }

                g1.delete_graph(image);
            }
        }
    }
示例#9
0
    public int drawImage2(ImageData1 img, float x, float y, float large)
    {
        x += swing_x;
        y += swing_y;

        //	if (explode_f==true){a+=explode_x;b+=explode_y;}
        int w, h;

        DX.GetGraphSize(img.call(), out w, out h);
        //    int flag = 1;

        Anti_aliasing();

        //	int w,h;
        //	GetGraphSize(mx ,&w ,&h);

        float PI  = 3.141592f;
        int   nt1 = DX.DrawRotaGraph((int)(large * w / 2 + x), (int)(large * h / 2 + y), large, -0 / 360 * PI * 2, img.call(), 1, turnflag);

        Anti_aliasing_re();

        return(nt1);
    }
示例#10
0
 public void drawImage(ImageData1 mx, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4)
 {
     DX.DrawModiGraph((int)x1, (int)y1, (int)x2, (int)y2, (int)x3, (int)y3, (int)x4, (int)y4, mx.call(), DX.TRUE);
 }