public static void Readdata_ReadPic(ref Picturexinxi pic, int index) { byte[] array = new byte[(int)Readdata.picxinxisize]; Readdata.myapp.upapp.filesr.BaseStream.Position = (long)((ulong)Readdata.myapp.app.picxinxiadd + (ulong)((long)((int)Readdata.picxinxisize * index))); Readdata.myapp.upapp.filesr.BaseStream.Read(array, 0, (int)Readdata.picxinxisize); pic = (Picturexinxi)array.BytesTostruct(default(Picturexinxi).GetType()); }
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); }
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 static byte Readdata_ReadBinapp() { byte[] array = new byte[4]; appinf0 appinf = default(appinf0); byte result; if (Readdata.Readdata_ReadApp0(ref appinf) == 0) { result = 0; } else { byte[] array2 = new byte[Marshal.SizeOf(default(appinf1))]; Readdata.myapp.upapp.filesr.BaseStream.Position = 200L; Readdata.myapp.upapp.filesr.BaseStream.Read(array2, 0, Marshal.SizeOf(default(appinf1))); Readdata.myapp.upapp.filesr.BaseStream.Position = 396L; Readdata.myapp.upapp.filesr.BaseStream.Read(array, 0, 4); if ((uint)array.BytesTostruct(0u.GetType()) != array2.getcrc(4294967295u, 0, (int)Readdata.appxinxisize1)) { result = 0; } else { array2 = array2.Appfree10(datasize.apppasseord, appinf.Modelcrc); Readdata.myapp.app = (appinf1)array2.BytesTostruct(default(appinf1).GetType()); progform progform = null; int num = 1; int num2 = 0; if (Readdata.myapp.upapp.runapptype == runapptype.run && Readdata.myapp.upapp.images == null) { Readdata.myapp.upapp.images = new List <guiimagetype>(); if (Readdata.myapp.app.picqyt > 0) { num = (int)(Readdata.myapp.app.zimodataadd - Readdata.myapp.app.picdataadd); num2 = 0; progform = new progform(); progform.Show(); Application.DoEvents(); Thread.Sleep(300); } for (int i = 0; i < (int)Readdata.myapp.app.picqyt; i++) { Picturexinxi pic = default(Picturexinxi); Readdata.Readdata_ReadPic(ref pic, i); guiimagetype item = default(guiimagetype); item.imagebitbmp = new Bitmap((int)pic.W, (int)pic.H); byte[] array3 = new byte[(int)(pic.W * pic.H * 2)]; Readdata.myapp.upapp.filesr.BaseStream.Position = (long)(pic.addbeg + Readdata.myapp.app.picdataadd); Readdata.myapp.upapp.filesr.BaseStream.Read(array3, 0, array3.Length); item.imagebitbmp = array3.GetBitmap(pic, datasize.Opentouming); Readdata.myapp.upapp.images.Add(item); num2 += (int)pic.imgbytesize; progform.setprogval(num2 * 100 / num); Application.DoEvents(); } if (progform != null) { Application.DoEvents(); Thread.Sleep(300); progform.Close(); } } result = 1; } } return(result); }
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); }