private void setStrg(double sx, double sy, string sStr) { sx = sx * m_dTime + m_dBaseX; sy = sy * m_dTime + m_dBaseY; sStr = analyzeString(sStr); if (m_nTate == 0) { m_libCanvas.drawYokoStrg(m_Canvas, sx, sy, 0.0, 1.0, sStr); } else { m_libCanvas.drawTateStrg(m_Canvas, sx, sy, 0.0, 1.0, sStr); } }
private void drawCanvas(Canvas canvas) { double sx, sy, ex, ey; double wd, hi; double dx, dy; double space, time; double dFs; string sStr; string[] aryRec; string[] arySs; string[] arySk; string[] arySg; string[] aryFr; string[] ary; int max, idx; int lmax, lidx; int cmax, cidx; int lenmax, len; string sFuda; string[] sAry; double m_nCrtY; double crty1, crty2; int nSumPrice; space = 0.0; time = 1.0; m_libCanvas.setFontSize(24.0); m_libCanvas.setFontName("MS 明朝"); m_libCanvas.setFontNomal(); m_libCanvas.setBrushFill(-1, -1, -1); m_libCanvas.setBrushStroke(0, 0, 0, 0.5, 0); m_libCanvas.setBrushText(0, 0, 0); aryRec = m_aryRecLine[0].Split(','); arySs = m_sSasidasinin.Split(','); arySk = m_sSeikyu.Split(','); arySg = m_sSougi.Split(','); aryFr = m_sFurikomisaki.Split(','); m_libCanvas.setFontName("MS ゴシック"); m_libCanvas.setFontNomal(); dFs = trnsLen(6.0); m_libCanvas.setFontSize(dFs); sx = trnsX(88.0); sy = trnsY(12.0); sStr = "請 求 書"; m_libCanvas.drawYokoStrg(canvas, sx, sy, space, time, sStr); m_libCanvas.setFontName("MS 明朝"); dFs = trnsLen(5.0); m_libCanvas.setFontSize(dFs); sx = trnsX(12.0); sy = trnsY(35.0); sStr = getAryString(aryRec, 14); m_libCanvas.drawYokoStrg(canvas, sx, sy, space, time, sStr); sx = trnsX(117.0); sStr = getAryString(aryRec, 16); m_libCanvas.drawYokoStrg(canvas, sx, sy, space, time, sStr); sx = trnsX(11.0); ex = trnsX(125.0); dy = trnsY(41.0); m_libCanvas.drawLine(canvas, sx, dy, ex, dy); m_libCanvas.setFontName("MS ゴシック"); dFs = trnsLen(4.0); m_libCanvas.setFontSize(dFs); sx = trnsX(15.0); sy = trnsY(43.0); sStr = "下記のとおりご請求申し上げます。"; m_libCanvas.drawYokoStrg(canvas, sx, sy, space, time, sStr); m_libCanvas.setFontName("MS ゴシック"); dFs = trnsLen(4.0); m_libCanvas.setFontSize(dFs); sx = trnsX(130.0); sy = trnsY(34.0); sStr = getAryString(arySs, 1); m_libCanvas.drawYokoStrg(canvas, sx, sy, space, time, sStr); dFs = trnsLen(5.0); m_libCanvas.setFontSize(dFs); sx = trnsX(130.0); sy = trnsY(39.0); sStr = getAryString(arySs, 2); m_libCanvas.drawYokoStrg(canvas, sx, sy, space, time, sStr); dFs = trnsLen(3.0); m_libCanvas.setFontSize(dFs); sx = trnsX(128.0); sy = trnsY(46.0); sStr = "〒" + getAryString(arySs, 3) + " " + getAryString(arySs, 4); m_libCanvas.drawYokoStrg(canvas, sx, sy, space, time, sStr); if (getAryString(arySs, 5) != "") { sx = trnsX(135.0); sy = trnsY(49.0); sStr = getAryString(arySs, 5); m_libCanvas.drawYokoStrg(canvas, sx, sy, space, time, sStr); } sx = trnsX(141.0); sy = trnsY(52.0); sStr = "電話 " + getAryString(arySs, 6); m_libCanvas.drawYokoStrg(canvas, sx, sy, space, time, sStr); sy = trnsY(57.0); sStr = "FAX " + getAryString(arySs, 7); m_libCanvas.drawYokoStrg(canvas, sx, sy, space, time, sStr); m_libCanvas.setFontName("MS ゴシック"); sx = trnsX(10.0); sy = trnsY(62.0); wd = trnsLen(133.0); hi = trnsLen(16.0); m_libCanvas.drawBoxs(canvas, sx, sy, wd, hi); dFs = trnsLen(3.0); m_libCanvas.setFontSize(dFs); sx = trnsX(12.0); sy = trnsY(63.0); sStr = "指定コード番号"; m_libCanvas.drawYokoStrg(canvas, sx, sy, space, time, sStr); sx = trnsX(37.0); sy = trnsY(63.0); sStr = "お振込名"; m_libCanvas.drawYokoStrg(canvas, sx, sy, space, time, sStr); m_libCanvas.setFontName("MS 明朝"); dFs = trnsLen(4.0); m_libCanvas.setFontSize(dFs); sx = trnsX(14.0); sy = trnsY(70.0); sStr = getAryString(arySk, 2); m_libCanvas.drawYokoStrg(canvas, sx, sy, space, time, sStr); sx = trnsX(185.0); sy = trnsY(15.0); m_libCanvas.drawYokoStrg(canvas, sx, sy, space, time, sStr); sx = trnsX(36.0); sy = trnsY(70.0); sStr = getAryString(aryRec, 23); m_libCanvas.drawYokoStrg(canvas, sx, sy, space, time, sStr); m_libCanvas.setFontName("MS ゴシック"); dFs = trnsLen(3.5); m_libCanvas.setFontSize(dFs); sx = trnsX(10.0); sy = trnsY(81.0); // 複数行に対応する必要あり sStr = m_sBunsyou1; m_libCanvas.drawYokoStrg(canvas, sx, sy, space, time, sStr); m_libCanvas.setFontName("MS 明朝"); dFs = trnsLen(6.0); m_libCanvas.setFontSize(dFs); sx = trnsX(75.0); sy = trnsY(95.0); sStr = getAryString(aryRec, 5); m_libCanvas.drawYokoStrg(canvas, sx, sy, space, time, sStr); m_libCanvas.setFontName("MS ゴシック"); dFs = trnsLen(5.5); m_libCanvas.setFontSize(dFs); sx = trnsX(75.0 + 6.0 * aryRec[5].Length); sy = trnsY(95.0); sStr = "供花代金"; m_libCanvas.drawYokoStrg(canvas, sx, sy, space, time, sStr); max = m_aryRecLine.Length; sx = trnsX(10.0); sy = trnsY(104.0); wd = trnsLen(190.0); hi = trnsLen(75.0); m_libCanvas.drawBoxs(canvas, sx, sy, wd, hi); sx = trnsX(10.0); ex = trnsX(200.0); dy = trnsY(115.0); m_libCanvas.drawLine(canvas, sx, dy, ex, dy); dy = trnsY(120.0); m_libCanvas.drawLine(canvas, sx, dy, ex, dy); dx = trnsX(57.0); sy = trnsY(115.0); ey = trnsY(179.0); m_libCanvas.drawLine(canvas, dx, sy, dx, ey); m_libCanvas.setFontName("MS ゴシック"); dFs = trnsLen(3.0); m_libCanvas.setFontSize(dFs); sx = trnsX(11.0); sy = trnsY(105.0); sStr = "通夜"; m_libCanvas.drawYokoStrg(canvas, sx, sy, space, time, sStr); sx = trnsX(58.0); sStr = "告別式"; m_libCanvas.drawYokoStrg(canvas, sx, sy, space, time, sStr); sx = trnsX(112.0); sStr = "施工場所"; m_libCanvas.drawYokoStrg(canvas, sx, sy, space, time, sStr); m_libCanvas.setFontName("MS 明朝"); dFs = trnsLen(4.0); m_libCanvas.setFontSize(dFs); sx = trnsX(11.0); sy = trnsY(110.0); sStr = m_libCmn.convWakeki(getAryString(arySg, 4)); m_libCanvas.drawYokoStrg(canvas, sx, sy, space, time, sStr); sx = trnsX(58.0); sStr = m_libCmn.convWakeki(getAryString(arySg, 7)); m_libCanvas.drawYokoStrg(canvas, sx, sy, space, time, sStr); sx = trnsX(112.0); sStr = getAryString(arySg, 10); m_libCanvas.drawYokoStrg(canvas, sx, sy, space, time, sStr); m_libCanvas.setFontName("MS ゴシック"); dFs = trnsLen(3.0); m_libCanvas.setFontSize(dFs); sx = trnsX(22.0); sy = trnsY(116.0); sStr = "品名・個数・金額"; m_libCanvas.drawYokoStrg(canvas, sx, sy, space, time, sStr); sx = trnsX(120.0); sStr = "供花名札"; m_libCanvas.drawYokoStrg(canvas, sx, sy, space, time, sStr); m_libCanvas.setFontName("MS 明朝"); dFs = trnsLen(4.0); m_libCanvas.setFontSize(dFs); m_nCrtY = 121.0; nSumPrice = 0; max = m_aryRecLine.Length; for (idx = 0; idx < max; idx++) { aryRec = m_aryRecLine[idx].Split(','); sx = trnsX(11.0); ex = trnsX(56.0); sStr = getAryString(aryRec, 7); sAry = sStr.Split(' '); crty1 = m_nCrtY; lmax = sAry.Length; for (lidx = 0; lidx < lmax; lidx++) { sy = trnsY(crty1); ey = sy + dFs; m_libCanvas.drawRightEqualStrg(canvas, sx, sy, ex, ey, sAry[lidx]); crty1 = crty1 + 4.0; } crty2 = m_nCrtY; sx = trnsX(58.0); ex = trnsX(200.0); sy = trnsY(crty2); ey = sy + dFs; lenmax = (int)((ex - sx - dFs) / dFs); sFuda = getFudaStr(aryRec); sAry = sFuda.Split(' '); cmax = sAry.Length; sStr = sAry[0]; lidx = 0; for (cidx = 1; cidx < cmax; cidx++) { len = sStr.Length + 1 + sAry[cidx].Length; if (lenmax < len) { sy = trnsY(crty2); ey = sy + dFs; m_libCanvas.drawLeftEqualStrg(canvas, sx, sy, ex, ey, sStr); crty2 = crty2 + 5.0; lidx++; if (3 <= lidx) { sStr = ""; break; } sStr = sAry[cidx]; } else { sStr = sStr + " " + sAry[cidx]; } } if (sStr != "") { sy = trnsY(crty2); ey = sy + dFs; m_libCanvas.drawLeftEqualStrg(canvas, sx, sy, ex, ey, sStr); crty2 = crty2 + 5.0; } nSumPrice = nSumPrice + m_libCmn.StrToInt(getAryString(aryRec, 13)); if (crty1 > crty2) { m_nCrtY = crty1; } else { m_nCrtY = crty2; } } m_libCanvas.setFontName("MS ゴシック"); sx = trnsX(43.0); sy = trnsY(185.0); sStr = "御請求合計金額"; m_libCanvas.drawYokoStrg(canvas, sx, sy, space, time, sStr); m_libCanvas.setFontName("MS 明朝"); sx = trnsX(90.0); sStr = nSumPrice.ToString("C") + "也 (消費税込)"; m_libCanvas.drawYokoStrg(canvas, sx, sy, space, time, sStr); m_libCanvas.setFontName("MS ゴシック"); sx = trnsX(11.0); sy = trnsY(200.0); sStr = "お振込みされるお客様へ"; m_libCanvas.drawYokoStrg(canvas, sx, sy, space, time, sStr); sy = trnsY(205.0); sStr = "誠に勝手ではございますが、振込手数料はお客様にてご負担くださいませ。"; m_libCanvas.drawYokoStrg(canvas, sx, sy, space, time, sStr); sy = trnsY(210.0); sStr = "上記番号・上記名 以外で振込をされますと処理に行き違いが生じますのでお手数ですが"; m_libCanvas.drawYokoStrg(canvas, sx, sy, space, time, sStr); sy = trnsY(215.0); sStr = "必ず指定の振込番号・お名前をご入力いただきますようお願い申し上げます。"; m_libCanvas.drawYokoStrg(canvas, sx, sy, space, time, sStr); ary = m_sBunsyou2.Split('\n'); m_nCrtY = 225.0; max = ary.Length; for (idx = 0; idx < max; idx++) { sy = trnsY(m_nCrtY); m_libCanvas.drawYokoStrg(canvas, sx, sy, space, time, ary[idx]); m_nCrtY = m_nCrtY + 5.0; } sx = trnsX(20.0); sy = trnsY(254.0); wd = trnsLen(170.0); hi = trnsLen(26.0); m_libCanvas.drawBoxs(canvas, sx, sy, wd, hi); sx = trnsX(73.0); sy = trnsY(255.0); sStr = "【下記銀行へ御振込お願いします】"; m_libCanvas.drawYokoStrg(canvas, sx, sy, space, time, sStr); sx = trnsX(28.0); sy = trnsY(268.0); sStr = "【振込先】"; m_libCanvas.drawYokoStrg(canvas, sx, sy, space, time, sStr); sx = trnsX(52.0); sy = trnsY(260.0); sStr = getAryString(aryFr, 1) + " " + getAryString(aryFr, 2); m_libCanvas.drawYokoStrg(canvas, sx, sy, space, time, sStr); sx = trnsX(52.0); sy = trnsY(265.0); sStr = getAryString(aryFr, 3) + "No. " + getAryString(aryFr, 4); m_libCanvas.drawYokoStrg(canvas, sx, sy, space, time, sStr); sx = trnsX(52.0); sy = trnsY(270.0); sStr = getAryString(aryFr, 5); m_libCanvas.drawYokoStrg(canvas, sx, sy, space, time, sStr); sx = trnsX(52.0); sy = trnsY(275.0); sStr = getAryString(aryFr, 6); m_libCanvas.drawYokoStrg(canvas, sx, sy, space, time, sStr); sx = trnsX(125.0); sy = trnsY(284.0); sStr = "生花部受付"; m_libCanvas.drawYokoStrg(canvas, sx, sy, space, time, sStr); m_libCanvas.setFontName("MS 明朝"); sx = trnsX(152.0); sy = trnsY(284.0); sStr = getAryString(arySg, 11); m_libCanvas.drawYokoStrg(canvas, sx, sy, space, time, sStr); }
private void drawPageToCanvas(Canvas canvas, int nPage) { double dCrtY; double dFs; int blkmax, blkidx; int max, idx, no; int lmax, lidx, len, lenmax; int cmax, cidx; string[] sAry; string sSyouhin, sMark, sFuda, sKubun; double sx, sy, ex, ey; double space, time; string sStr; m_libCanvas.setFontSize(24.0); m_libCanvas.setFontName("MS 明朝"); m_libCanvas.setFontNomal(); m_libCanvas.setBrushFill(-1, -1, -1); m_libCanvas.setBrushStroke(0, 0, 0, 0.5, 0); m_libCanvas.setBrushText(0, 0, 0); printPageLayout(canvas, nPage, m_nPageMax); dFs = trnsLen(4.0); dCrtY = 41; space = 0.0; time = 1.0; m_libCanvas.setFontSize(dFs); m_libCanvas.setFontNomal(); blkmax = m_listShyouhin.Count; for (blkidx = 0; blkidx < blkmax; blkidx++) { if (m_listShyouhin[blkidx].nPageNo == nPage) { sSyouhin = m_listShyouhin[blkidx].sName; max = m_listShyouhin[blkidx].listIdx.Count; for (idx = 0; idx < max; idx++) { no = m_listShyouhin[blkidx].listIdx[idx]; sMark = ""; sFuda = ""; sKubun = ""; sAry = m_aryRecLine[no].Split(','); if (37 <= sAry.Length) { sMark = getKubunMark(sAry[24]); sFuda = getFudaStr(sAry); sKubun = sAry[24]; } m_libCanvas.setFontName("MS ゴシック"); sx = trnsX(26) - (dFs * 2); sy = trnsY(dCrtY + 5); no = idx + 1; sStr = sMark + no; m_libCanvas.drawYokoStrg(canvas, sx, sy, space, time, sStr); m_libCanvas.setFontName("MS 明朝"); sx = trnsX(28.5); sy = trnsY(dCrtY + 1); ex = trnsX(61.0); ey = sy + dFs; sAry = sSyouhin.Split(' '); lmax = sAry.Length; for (lidx = 0; lidx < lmax; lidx++) { m_libCanvas.drawRightEqualStrg(canvas, sx, sy, ex, ey, sAry[lidx]); sy = ey + 1; ey = sy + dFs; } sx = trnsX(62.5); sy = trnsY(dCrtY + 1); ex = trnsX(171.0); lenmax = (int)((ex - sx - dFs) / dFs); sAry = sFuda.Split(' '); cmax = sAry.Length; sStr = sAry[0]; lidx = 0; for (cidx = 1; cidx < cmax; cidx++) { len = sStr.Length + 1 + sAry[cidx].Length; if (lenmax < len) { ey = sy + dFs; m_libCanvas.drawLeftEqualStrg(canvas, sx, sy, ex, ey, sStr); sy = sy + dFs + 1; lidx++; if (3 <= lidx) { sStr = ""; break; } sStr = sAry[cidx]; } else { sStr = sStr + " " + sAry[cidx]; } } if (sStr != "") { ey = sy + dFs; m_libCanvas.drawLeftEqualStrg(canvas, sx, sy, ex, ey, sStr); sy = sy + dFs + 1; } m_libCanvas.setFontName("MS ゴシック"); sx = trnsX(172.5); sy = trnsY(dCrtY + 1); sStr = sKubun; m_libCanvas.drawYokoStrg(canvas, sx, sy, space, time, sStr); dCrtY = dCrtY + 16; } dCrtY = dCrtY + 16; } } }
private void drawCanvas(Canvas canvas) { double fs, sp; string sFileName; string[] aryLine; int max, idx; string[] ary; double dx, dy; double sx, sy; double wd, hi; string str; m_dFontSize = 5.0; m_dFontTime = 1.0; m_dFontSpace = 0.0; m_sFontName = "MS 明朝"; m_nTateGaki = 0; fs = trnsLen(m_dFontSize); m_libCanvas.setFontSize(fs); m_libCanvas.setFontName(m_sFontName); m_libCanvas.setFontNomal(); m_libCanvas.setBrushFill(-1, -1, -1); m_libCanvas.setBrushStroke(0, 0, 0, 0.5, 0); m_libCanvas.setBrushText(0, 0, 0); sFileName = m_sExecPath + "\\kden\\fuutou.lay"; aryLine = m_libCmn.LoadFileLineSJIS(sFileName); max = aryLine.Length; for (idx = 1; idx < max; idx++) { ary = aryLine[idx].Split(','); if (ary.Length < 2) { continue; } switch (ary[0]) { case "FONT": wd = m_libCmn.StrToDouble(ary[1]); hi = m_libCmn.StrToDouble(ary[2]); m_sFontName = ary[3]; m_nTateGaki = m_libCmn.StrToInt(ary[4]); if (m_nTateGaki == 0) { m_dFontSize = hi; m_dFontTime = wd / hi; } else { m_dFontSize = wd; m_dFontTime = hi / wd; } fs = trnsLen(m_dFontSize); m_libCanvas.setFontSize(fs); m_libCanvas.setFontName(m_sFontName); break; case "FSPC": m_dFontSpace = m_libCmn.StrToDouble(ary[1]); break; case "STRG": sp = trnsLen(m_dFontSpace); str = analyzeString(ary[3]); dx = m_libCmn.StrToDouble(ary[1]); dy = m_libCmn.StrToDouble(ary[2]); sx = trnsX(dx); sy = trnsY(dy); if (m_nTateGaki == 0) { m_libCanvas.drawYokoStrg(canvas, sx, sy, sp, m_dFontTime, str); } else { m_libCanvas.drawTateStrg(canvas, sx, sy, sp, m_dFontTime, str); } break; case "RSTR": sp = trnsLen(m_dFontSpace); fs = trnsLen(m_dFontSize); str = analyzeString(ary[3]); dx = m_libCmn.StrToDouble(ary[1]); dy = m_libCmn.StrToDouble(ary[2]); if (m_nTateGaki == 0) { sx = trnsX(dx) - fs * m_dFontTime * str.Length - -sp * m_dFontTime * (str.Length - 1); sy = trnsY(dy); m_libCanvas.drawYokoStrg(canvas, sx, sy, sp, m_dFontTime, str); } else { sx = trnsX(dx); sy = trnsY(dy) - fs * m_dFontTime * str.Length - -sp * m_dFontTime * (str.Length - 1); m_libCanvas.drawTateStrg(canvas, sx, sy, sp, m_dFontTime, str); } break; } } }