Beispiel #1
0
 public static void Lcd_Draw_Circles(ushort x0, ushort y0, ushort r, ushort color)
 {
     if (r <= x0 && r <= y0 && y0 + r <= Lcd.myapp.upapp.lcddev.height && x0 + r <= Lcd.myapp.upapp.lcddev.width)
     {
         int i    = 0;
         int num  = (int)r;
         int num2 = 3 - ((int)r << 1);
         while (i <= num)
         {
             uint qyt = (uint)(i * 2 + 1);
             Lcd.LCD_addset((int)((ushort)((int)x0 - num)), (int)((ushort)((int)y0 - i)), (int)((ushort)((int)x0 - num)), (int)((ushort)((int)y0 + i)), 1);
             Lcd.Lcd_WR_POINT(qyt, color);
             Lcd.LCD_addset((int)((ushort)((int)x0 + num)), (int)((ushort)((int)y0 - i)), (int)((ushort)((int)x0 + num)), (int)((ushort)((int)y0 + i)), 1);
             Lcd.Lcd_WR_POINT(qyt, color);
             qyt = (uint)(num * 2 + 1);
             Lcd.LCD_addset((int)((ushort)((int)x0 - i)), (int)((ushort)((int)y0 - num)), (int)((ushort)((int)x0 - i)), (int)((ushort)((int)y0 + num)), 1);
             Lcd.Lcd_WR_POINT(qyt, color);
             Lcd.LCD_addset((int)((ushort)((int)x0 + i)), (int)((ushort)((int)y0 - num)), (int)((ushort)((int)x0 + i)), (int)((ushort)((int)y0 + num)), 1);
             Lcd.Lcd_WR_POINT(qyt, color);
             i++;
             if (num2 < 0)
             {
                 num2 += 4 * i + 6;
             }
             else
             {
                 num2 += 10 + 4 * (i - num);
                 num--;
             }
         }
     }
 }
Beispiel #2
0
        public unsafe static byte CurveRefBack(objxinxi *obj, byte ID)
        {
            byte[]       array = new byte[0];
            CURVE_PARAM *ptr;

            if (GuiCurve.myapp.upapp.runapptype == runapptype.bianji)
            {
                GuiCurve.GuiCurvePageInit();
                ptr = (CURVE_PARAM *)GuiCurve.myapp.mymerry;
            }
            else
            {
                ptr = (CURVE_PARAM *)(GuiCurve.myapp.mymerry + obj->attpos);
            }
            if (GuiCurve.myapp.upapp.runapptype == runapptype.bianji || GuiCurve.myapp.pageobjs[ID].vis == 1)
            {
                if (ptr->BackType == 0)
                {
                    Showpic.Showpic_ShowXpic((int)obj->redian.x, (int)obj->redian.y, (ushort)(obj->redian.endx - obj->redian.x + 1), (ushort)(obj->redian.endy - obj->redian.y + 1), (int)obj->redian.x, (int)obj->redian.y, ptr->PicID);
                }
                else if (ptr->BackType == 2)
                {
                    Showpic.Showpic_ShowPic((int)obj->redian.x, (int)obj->redian.y, ptr->PicID);
                }
                else
                {
                    uint qyt = (uint)(ptr->objWid * ptr->objHig);
                    Lcd.LCD_addset((int)obj->redian.x, (int)obj->redian.y, (int)obj->redian.endx, (int)obj->redian.endy, 1);
                    Lcd.Lcd_WR_POINT(qyt, ptr->Bkclr);
                    if (ptr->GridX > 0)
                    {
                        for (short num = (short)obj->redian.x; num <= (short)obj->redian.endx; num += (short)ptr->GridX)
                        {
                            Lcd.LCD_addset((int)((ushort)num), (int)obj->redian.y, (int)((ushort)num), (int)obj->redian.endy, 1);
                            Lcd.Lcd_WR_POINT((uint)ptr->objHig, ptr->Griclr);
                        }
                    }
                    if (ptr->GridY > 0)
                    {
                        for (short num = (short)obj->redian.endy; num >= (short)obj->redian.y; num -= (short)ptr->GridY)
                        {
                            Lcd.LCD_addset((int)obj->redian.x, (int)((ushort)num), (int)obj->redian.endx, (int)((ushort)num), 1);
                            Lcd.Lcd_WR_POINT((uint)ptr->objWid, ptr->Griclr);
                        }
                    }
                }
            }
            return(1);
        }
Beispiel #3
0
        public unsafe static byte GuiCurveRef(objxinxi *obj, byte ID)
        {
            byte qyt = 0;

            byte[]       buffer         = new byte[4];
            ushort[]     numArray       = new ushort[4];
            ushort[]     numArray2      = new ushort[4];
            ushort[]     numArray3      = new ushort[4];
            ushort[]     numArray4      = new ushort[4];
            byte[]       buffer2        = new byte[4];
            int          num9           = 0;
            int          num10          = 0;
            Picturexinxi pic            = new Picturexinxi();
            CURVE_PARAM *curve_paramPtr = (CURVE_PARAM *)(myapp.mymerry + obj->attpos);

            CURVE_CHANNEL_PARAM *[] curve_channel_paramPtrArray = new CURVE_CHANNEL_PARAM *[4];
            short x     = 0;
            short num12 = 0;
            short endy  = 0;
            short y     = 0;
            short num17 = 0;

            if (curve_paramPtr->CH_qyt <= 4)
            {
                byte num3;
                for (num3 = 0; num3 < curve_paramPtr->CH_qyt; num3 = (byte)(num3 + 1))
                {
                    curve_channel_paramPtrArray[num3] = (CURVE_CHANNEL_PARAM *)((((uint)curve_paramPtr) + sizeof(CURVE_PARAM)) + (sizeof(CURVE_CHANNEL_PARAM) * num3));
                }
                byte num2 = 0;
                num3 = 0;
                while (num3 < curve_paramPtr->CH_qyt)
                {
                    buffer[num3]    = 1;
                    numArray3[num3] = curve_channel_paramPtrArray[num3]->DotLen;
                    if (numArray3[num3] > 0)
                    {
                        num2 = (byte)(num2 + 1);
                    }
                    numArray4[num3] = obj->redian.x;
                    if (curve_paramPtr->DrawDir == 0)
                    {
                        numArray[num3] = (ushort)(curve_channel_paramPtrArray[num3]->BufNext - 1);
                        num17          = -1;
                    }
                    else
                    {
                        num17 = (short)(curve_channel_paramPtrArray[num3]->BufNext - curve_channel_paramPtrArray[num3]->BufPos.star);
                        if (num17 >= numArray3[num3])
                        {
                            numArray[num3] = (ushort)(curve_channel_paramPtrArray[num3]->BufNext - curve_channel_paramPtrArray[num3]->DotLen);
                        }
                        else
                        {
                            numArray[num3] = (ushort)((curve_channel_paramPtrArray[num3]->BufPos.end - (curve_channel_paramPtrArray[num3]->DotLen - num17)) + 1);
                        }
                        if (curve_paramPtr->DrawDir == 2)
                        {
                            num17 = (short)((obj->redian.endx - obj->redian.x) + 1);
                            if (numArray3[num3] < num17)
                            {
                                numArray4[num3] = (ushort)(numArray4[num3] + ((ushort)(num17 - numArray3[num3])));
                            }
                        }
                        num17 = 1;
                    }
                    num3 = (byte)(num3 + 1);
                }
                if (num2 == 0)
                {
                    CurveRefBack(obj, ID);
                }
                else
                {
                    if (curve_paramPtr->BackType == 0)
                    {
                        qyt = 5;
                        Readdata.Readdata_ReadPic(ref pic, curve_paramPtr->PicID);
                        num9 = (int)(pic.addbeg + myapp.app.picdataadd);
                        if (myapp.upapp.lcddev.guidire == 0)
                        {
                            num9 += ((obj->redian.y * pic.W) + obj->redian.x) << 1;
                            num10 = qyt << 1;
                        }
                        else if (myapp.upapp.lcddev.guidire == 1)
                        {
                            num9 += (((pic.H - obj->redian.endy) - 1) + (obj->redian.x * pic.H)) << 1;
                            num10 = (qyt * pic.H) << 1;
                        }
                        else if (myapp.upapp.lcddev.guidire == 2)
                        {
                            num9 += ((((pic.H - obj->redian.endy) * pic.W) - obj->redian.x) - qyt) << 1;
                            num10 = qyt * -2;
                        }
                        else if (myapp.upapp.lcddev.guidire == 3)
                        {
                            num9 += (obj->redian.y + (((pic.W - obj->redian.x) - qyt) * pic.H)) << 1;
                            num10 = (qyt * pic.H) * -2;
                        }
                    }
                    else if (curve_paramPtr->BackType == 2)
                    {
                        qyt = 5;
                        Readdata.Readdata_ReadPic(ref pic, curve_paramPtr->PicID);
                        num9 = (int)(pic.addbeg + myapp.app.picdataadd);
                        if (myapp.upapp.lcddev.guidire == 0)
                        {
                            num10 = qyt << 1;
                        }
                        else if (myapp.upapp.lcddev.guidire == 1)
                        {
                            num10 = (qyt * pic.H) << 1;
                        }
                        else if (myapp.upapp.lcddev.guidire == 2)
                        {
                            num9 += (pic.W - qyt) << 1;
                            num10 = qyt * -2;
                        }
                        else if (myapp.upapp.lcddev.guidire == 3)
                        {
                            num9 += ((pic.W - qyt) * pic.H) << 1;
                            num10 = (qyt * pic.H) * -2;
                        }
                    }
                    else
                    {
                        x     = (short)obj->redian.x;
                        num12 = (short)(x + curve_paramPtr->GridX);
                    }
                    for (short i = (short)obj->redian.x; i <= obj->redian.endx; i = (short)(i + qyt))
                    {
                        short endx = (short)((i + 5) - 1);
                        if (endx > obj->redian.endx)
                        {
                            endx = (short)obj->redian.endx;
                        }
                        if (curve_paramPtr->BackType == 1)
                        {
                            if (curve_paramPtr->GridX > 0)
                            {
                                ushort num15;
                                ushort num16;
                                if (i == x)
                                {
                                    Lcd.LCD_addset((ushort)i, obj->redian.y, (ushort)i, obj->redian.endy, 1);
                                    Lcd.Lcd_WR_POINT(curve_paramPtr->objHig, curve_paramPtr->Griclr);
                                    num15 = (ushort)(i + 1);
                                }
                                else
                                {
                                    num15 = (ushort)i;
                                }
                                if ((num15 + 5) >= num12)
                                {
                                    num16 = (ushort)(num12 - 1);
                                    x     = num12;
                                    num12 = (short)(num12 + curve_paramPtr->GridX);
                                }
                                else
                                {
                                    num16 = (ushort)((num15 + 5) - 1);
                                }
                                qyt = (byte)((num16 - i) + 1);
                                if ((i + qyt) > obj->redian.endx)
                                {
                                    num16 = (ushort)endx;
                                    qyt   = (byte)((endx - i) + 1);
                                }
                                if (curve_paramPtr->GridY > 0)
                                {
                                    endy = (short)obj->redian.endy;
                                    while (endy >= obj->redian.y)
                                    {
                                        y = (short)((endy - curve_paramPtr->GridY) + 1);
                                        if (y < obj->redian.y)
                                        {
                                            y = (short)obj->redian.y;
                                        }
                                        Lcd.LCD_addset(num15, (ushort)endy, num16, (ushort)endy, 1);
                                        Lcd.Lcd_WR_POINT((ushort)((num16 - num15) + 1), curve_paramPtr->Griclr);
                                        Lcd.LCD_addset(num15, (ushort)y, num16, (ushort)(endy - 1), 1);
                                        Lcd.Lcd_WR_POINT((uint)(((num16 - num15) + 1) * (endy - y)), curve_paramPtr->Bkclr);
                                        endy = (short)(endy - curve_paramPtr->GridY);
                                    }
                                }
                                else
                                {
                                    num9 = curve_paramPtr->objHig * ((num16 - num15) + 1);
                                    Lcd.LCD_addset(num15, obj->redian.y, num16, obj->redian.endy, 1);
                                    Lcd.Lcd_WR_POINT((uint)num9, curve_paramPtr->Bkclr);
                                }
                            }
                            else if (curve_paramPtr->GridY > 0)
                            {
                                for (endy = (short)obj->redian.endy; endy >= obj->redian.y; endy = (short)(endy - curve_paramPtr->GridY))
                                {
                                    y = (short)((endy - curve_paramPtr->GridY) + 1);
                                    if (y < obj->redian.y)
                                    {
                                        y = (short)obj->redian.y;
                                    }
                                    Lcd.LCD_addset((ushort)i, (ushort)y, (ushort)endx, (ushort)endy, 1);
                                    qyt = (byte)((endx - i) + 1);
                                    Lcd.Lcd_WR_POINT((uint)(qyt * (endy - y)), curve_paramPtr->Bkclr);
                                    Lcd.Lcd_WR_POINT(qyt, curve_paramPtr->Griclr);
                                }
                            }
                            else
                            {
                                qyt  = (byte)((endx - i) + 1);
                                num9 = curve_paramPtr->objHig * ((endx - i) + 1);
                                Lcd.LCD_addset((ushort)i, obj->redian.y, (ushort)endx, obj->redian.endy, 1);
                                Lcd.Lcd_WR_POINT((uint)num9, curve_paramPtr->Bkclr);
                            }
                        }
                        else
                        {
                            Lcd.LCD_addset((ushort)i, obj->redian.y, (ushort)endx, obj->redian.endy, 1);
                            if ((myapp.upapp.lcddev.guidire & 1) > 0)
                            {
                                Showpic.Showpic_SendDataOffset((uint)num9, (ushort)(pic.H << 1), (ushort)((endx - i) + 1), (byte)curve_paramPtr->objHig);
                            }
                            else
                            {
                                Showpic.Showpic_SendDataOffset((uint)num9, (ushort)(pic.W << 1), curve_paramPtr->objHig, (byte)((endx - i) + 1));
                            }
                            num9 += num10;
                        }
                        for (num3 = 0; num3 < curve_paramPtr->CH_qyt; num3 = (byte)(num3 + 1))
                        {
                            if ((numArray3[num3] > 0) && (i >= numArray4[num3]))
                            {
                                for (num2 = 0; num2 < qyt; num2 = (byte)(num2 + 1))
                                {
                                    byte num6;
                                    byte num5 = myapp.mymerry[numArray[num3]];
                                    byte num4 = buffer2[num3];
                                    if (buffer[num3] > 0)
                                    {
                                        num4         = num5;
                                        buffer[num3] = 0;
                                    }
                                    if (num5 > num4)
                                    {
                                        num6 = (byte)((num5 - num4) + 1);
                                        Lcd.LCD_addset((ushort)(i + num2), (ushort)(obj->redian.endy - num5), (ushort)(i + num2), (ushort)(obj->redian.endy - num4), 1);
                                        Lcd.Lcd_WR_POINT(num6, curve_channel_paramPtrArray[num3]->Penclr);
                                    }
                                    else
                                    {
                                        num6 = (byte)((num4 - num5) + 1);
                                        Lcd.LCD_addset((ushort)(i + num2), (ushort)(obj->redian.endy - num4), (ushort)(i + num2), (ushort)(obj->redian.endy - num5), 1);
                                        Lcd.Lcd_WR_POINT(num6, curve_channel_paramPtrArray[num3]->Penclr);
                                    }
                                    buffer2[num3]  = num5;
                                    numArray[num3] = (ushort)(numArray[num3] + num17);
                                    if (numArray[num3] > curve_channel_paramPtrArray[num3]->BufPos.end)
                                    {
                                        numArray[num3] = curve_channel_paramPtrArray[num3]->BufPos.star;
                                    }
                                    else if (numArray[num3] < curve_channel_paramPtrArray[num3]->BufPos.star)
                                    {
                                        numArray[num3] = curve_channel_paramPtrArray[num3]->BufPos.end;
                                    }
                                    numArray3[num3] = (ushort)(numArray3[num3] - 1);
                                    if (numArray3[num3] == 0)
                                    {
                                        break;
                                    }
                                }
                            }
                        }
                    }
                }
                myapp.pageobjs[ID].refFlag = 0;
            }
            return(0);
        }