private unsafe static byte DrawSliderBackGround(objxinxi *obj, SLIDER_PARAM *pSliRam) { byte result; switch (pSliRam->BackType) { case 0: if (pSliRam->BkPicID >= GuiSlider.myapp.app.picqyt) { result = 0; return(result); } Readdata.Readdata_ReadPic(ref GuiSlider.myapp.brush.pic, (int)pSliRam->BkPicID); break; case 1: GuiSlider.myapp.brush.backcolor = pSliRam->BkPicID; break; case 2: if (pSliRam->BkPicID >= GuiSlider.myapp.app.picqyt) { result = 0; return(result); } GuiSlider.myapp.brush.x = obj->redian.x; GuiSlider.myapp.brush.y = obj->redian.y; Readdata.Readdata_ReadPic(ref GuiSlider.myapp.brush.pic, (int)pSliRam->BkPicID); break; } GuiSlider.myapp.brush.sta = pSliRam->BackType; Showpic.Showpic_Clearspa((int)obj->redian.x, (int)obj->redian.y, (int)(obj->redian.endx - obj->redian.x + 1), (int)(obj->redian.endy - obj->redian.y + 1)); result = 1; return(result); }
public static void Showpic_SendDataOffset(uint address, ushort offset, ushort WinH, byte WinW) { uint num = address; for (int i = 0; i < (int)WinH; i++) { Showpic.Showpic_SendData(num, (uint)WinW); num += (uint)offset; } }
public unsafe static byte Showpic_Picq(int x, int y, ushort w, ushort h, int x2, int y2, ref Picturexinxi mpicture) { byte result; fixed(Picturexinxi *ptr = &mpicture) { result = Showpic.Showpic_ShowXpic_M(x, y, w, h, x2, y2, ptr); } return(result); }
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); }
public static void Showpic_Clearspa(int x, int y, int w, int h) { if (Showpic.myapp.brush.sta == 1) { Lcd.Lcd_Fill(x, y, w, h, Showpic.myapp.brush.backcolor); } else if (Showpic.myapp.brush.sta == 0) { Showpic.Showpic_Picq(x, y, (ushort)w, (ushort)h, x, y, ref Showpic.myapp.brush.pic); } else if (Showpic.myapp.brush.sta == 2) { Showpic.Showpic_Picq(x, y, (ushort)w, (ushort)h, (int)((ushort)(x - (int)Showpic.myapp.brush.x)), (int)((ushort)(y - (int)Showpic.myapp.brush.y)), ref Showpic.myapp.brush.pic); } }
private unsafe static byte DrawSliderCursor(objxinxi *obj, SLIDER_PARAM *pSliRam, ushort *CurXPos, ushort *CurXEnd, ushort *CurYPos, ushort *CurYEnd) { if (pSliRam->Mode > 0) { byte b = (byte)(pSliRam->CursorHig / 2); * CurXPos = (ushort)((obj->redian.endx - obj->redian.x + 1 - (ushort)pSliRam->CursorWid) / 2 + obj->redian.x); * CurXEnd = (ushort)(*CurXPos + (ushort)pSliRam->CursorWid - 1); * CurYEnd = (ushort)(pSliRam->TouchPos + (ushort)b); * CurYPos = (ushort)(*CurYEnd - (ushort)pSliRam->CursorHig + 1); } else { byte b = (Convert.ToByte(pSliRam->CursorWid / 2)); * CurYPos = (ushort)((obj->redian.endy - obj->redian.y + 1 - (ushort)pSliRam->CursorHig) / 2 + obj->redian.y); * CurYEnd = (ushort)(*CurYPos + (ushort)pSliRam->CursorHig - 1); * CurXPos = (ushort)(pSliRam->TouchPos - (ushort)b); * CurXEnd = (ushort)(*CurXPos + (ushort)pSliRam->CursorWid - 1); } byte result; if (pSliRam->CursorType > 0) { if (pSliRam->CuPicID >= GuiSlider.myapp.app.picqyt) { result = 0; return(result); } GuiSlider.myapp.brush.sta = 2; Readdata.Readdata_ReadPic(ref GuiSlider.myapp.brush.pic, (int)pSliRam->CuPicID); GuiSlider.myapp.brush.x = *CurXPos; GuiSlider.myapp.brush.y = *CurYPos; } else { GuiSlider.myapp.brush.sta = 1; GuiSlider.myapp.brush.backcolor = pSliRam->CuPicID; } Showpic.Showpic_Clearspa((int)(*CurXPos), (int)(*CurYPos), (int)pSliRam->CursorWid, (int)pSliRam->CursorHig); result = 1; return(result); }
public unsafe static byte Showpic_ShowXpic(int x, int y, ushort w, ushort h, int x2, int y2, ushort picindex) { Picturexinxi picturexinxi = default(Picturexinxi); byte result; if (picindex >= Showpic.myapp.app.picqyt) { if (picindex == 65535) { result = 1; } else { Showpic.myapp.errcode = 4; result = 0; } } else { Readdata.Readdata_ReadPic(ref picturexinxi, (int)picindex); result = Showpic.Showpic_ShowXpic_M(x, y, w, h, x2, y2, &picturexinxi); } return(result); }
private unsafe static byte ClearSliderCursor(objxinxi *obj, SLIDER_PARAM *pSliRam, ushort *CurXPos, ushort *CurXEnd, ushort *CurYPos, ushort *CurYEnd) { ushort num = 0; ushort num2 = 0; ushort num3 = 0; ushort num4 = 0; if (pSliRam->Mode > 0) { num = *CurXPos; num3 = *CurXEnd; if (*CurYEnd < pSliRam->LastPos) { num4 = pSliRam->LastPos; num2 = (ushort)(num4 - (ushort)pSliRam->CursorHig + 1); if (*CurYEnd >= num2) { num2 = (ushort)(*CurYEnd + 1); } } else if (*CurYEnd > pSliRam->LastPos) { num4 = pSliRam->LastPos; num2 = (ushort)(num4 - (ushort)pSliRam->CursorHig + 1); if (num4 >= *CurYPos) { num4 = (ushort)(*CurYPos - 1); } } } else { num2 = *CurYPos; num4 = *CurYEnd; if (*CurXPos < pSliRam->LastPos) { num = pSliRam->LastPos; num3 = (ushort)(num + (ushort)pSliRam->CursorWid - 1); if (*CurXEnd >= num) { num = (ushort)(*CurXEnd + 1); } } else if (*CurXPos > pSliRam->LastPos) { num = pSliRam->LastPos; num3 = (ushort)(num + (ushort)pSliRam->CursorWid - 1); if (num3 >= *CurXPos) { num3 = (ushort)(*CurXPos - 1); } } } switch (pSliRam->BackType) { case 0: Readdata.Readdata_ReadPic(ref GuiSlider.myapp.brush.pic, (int)pSliRam->BkPicID); break; case 1: GuiSlider.myapp.brush.backcolor = pSliRam->BkPicID; break; case 2: Readdata.Readdata_ReadPic(ref GuiSlider.myapp.brush.pic, (int)pSliRam->BkPicID); GuiSlider.myapp.brush.x = obj->redian.x; GuiSlider.myapp.brush.y = obj->redian.y; break; } GuiSlider.myapp.brush.sta = pSliRam->BackType; Showpic.Showpic_Clearspa((int)num, (int)num2, (int)(num3 - num + 1), (int)(num4 - num2 + 1)); return(1); }
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); }
public unsafe static byte Showfont_XstringHZK(int x, int y, int w, int h, byte *buf) { size_tyte size_tyte = default(size_tyte); int num = (int)Showfont.myapp.brush.x; int num2 = (int)Showfont.myapp.brush.y; byte result; if ((int)buf == 0) { MessageBox.Show("error"); result = 0; } else { try { if ((ushort)Showfont.myapp.brush.zikuid >= Showfont.myapp.app.zimoqyt) { if (*buf != 0) { Showfont.myapp.errcode = 5; result = 0; return(result); } if (Showfont.myapp.brush.sta < 10) { myappinf expr_AA_cp_0 = Showfont.myapp; expr_AA_cp_0.brush.sta = Convert.ToByte(expr_AA_cp_0.brush.sta + 10); } } if (Showfont.myapp.brush.endx >= Showfont.myapp.upapp.lcddev.width) { Showfont.myapp.brush.endx = Convert.ToByte(Showfont.myapp.upapp.lcddev.width - 1); } if (Showfont.myapp.brush.endy >= Showfont.myapp.upapp.lcddev.height) { Showfont.myapp.brush.endy = Convert.ToByte(Showfont.myapp.upapp.lcddev.height - 1); } if (Showfont.myapp.brush.sta < 10) { myappinf expr_199_cp_0 = Showfont.myapp; expr_199_cp_0.brush.sta = Convert.ToByte(expr_199_cp_0.brush.sta + 10); } if (Showfont.myapp.brush.sta == 0 || Showfont.myapp.brush.sta == 2 || Showfont.myapp.brush.sta == 10 || Showfont.myapp.brush.sta == 12) { if (Showfont.myapp.brush.backcolor >= Showfont.myapp.app.picqyt) { Showfont.myapp.errcode = 4; result = 0; return(result); } } if (*buf == 0) { if (Showfont.myapp.brush.sta < 10) { myappinf expr_26F_cp_0 = Showfont.myapp; expr_26F_cp_0.brush.sta = Convert.ToByte(expr_26F_cp_0.brush.sta + 10); } } if (Showfont.myapp.brush.sta > 9) { if (Showfont.myapp.brush.sta == 11) { Lcd.Lcd_Fill(num, num2, (int)((ushort)((int)Showfont.myapp.brush.endx - num + 1)), (int)((ushort)((int)Showfont.myapp.brush.endy - num2 + 1)), Showfont.myapp.brush.backcolor); } else if (Showfont.myapp.brush.sta == 10) { Showpic.Showpic_ShowXpic(num, num2, (ushort)((int)Showfont.myapp.brush.endx - num + 1), (ushort)((int)Showfont.myapp.brush.endy - num2 + 1), num, num2, Showfont.myapp.brush.backcolor); } else if (Showfont.myapp.brush.sta == 12) { Showpic.Showpic_ShowPic(num, num2, Showfont.myapp.brush.backcolor); } if (*buf == 0) { result = 1; return(result); } Showfont.myapp.brush.sta = 3; } if (w == 32767) { Showfont.myapp.brush.brendx = (short)Showfont.myapp.brush.endx; Showfont.myapp.brush.brendy = (short)Showfont.myapp.brush.endy; Showfont.Showfont_StringHZK((int)Showfont.myapp.brush.x, (int)Showfont.myapp.brush.y, buf, 0, ref size_tyte); } else { size_tyte.a = (ushort)w; size_tyte.b = (ushort)h; } if (x == 32767) { if (Showfont.myapp.brush.xjuzhong > 0) { int num3 = (int)(Showfont.myapp.brush.endx - Showfont.myapp.brush.x + 1 - size_tyte.a); if (num3 > 1) { if (Showfont.myapp.brush.xjuzhong == 1) { num += (int)((ushort)(num3 / 2)); } else { num += num3; } } } } else { num = x; } if (y == 32767) { if (Showfont.myapp.brush.yjuzhong > 0) { int num3 = (int)(Showfont.myapp.brush.endy - Showfont.myapp.brush.y + 1 - size_tyte.b); if (num3 > 1) { if (Showfont.myapp.brush.yjuzhong == 1) { num2 += (int)((ushort)(num3 / 2)); } else { num2 += num3; } } } } else { num2 = y; } if (w != 32767) { Showfont.myapp.brush.brendx = (short)(num + w); Showfont.myapp.brush.brendy = (short)(num2 + h); } Showfont.Showfont_StringHZK(num, num2, buf, 1, ref size_tyte); } catch (Exception ex) { MessageOpen.Show("Showfont_StringHZK is error!" + ex.Message); } result = 1; } return(result); }