⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 interface.cpp

📁 MH解码
💻 CPP
字号:
#include <b_g3sdecod.h>
#include <Unit1.h>
extern FILE *f;


short row=20;

short column=10;
short row_number=1;

String Column_str;

short  decode_next_byte(void)
{
    char buffer[1];
	fread(buffer,1,1,f);
	return (short)(buffer[0]);

}

// jason add



// 换一行
char  decode_new_row (void)
{
        String str;

        str=IntToStr(row_number);
       	str+=Column_str;
        Form1->Image1->Canvas->TextOut(column+14,row,str);
  //   if (Form1->Image1->Width<column+14+str.Length())
   //  {
  //     Form1->Image1->Width=column+14+str.Length();
  //     Form1->Image1->Height=row+20;
  //   }
  //    if (Form1->Panel1->Width<column+14+str.Length())
  //    {
 //      Form1->Panel1->Width=column+14+str.Length();
  //     Form1->Panel1->Height=row+20;
  //    }
       //Form1->Image1->Canvas->FillRect(Rect(0,0,Form1->Image1->Width,Form1->Image1->Height));

	row_number++;
	row+=20;
	column=10;
        Column_str="";

	return 1;
}

char  decode_black (short runlength)
{


   String str;
   str=" B";
   str+=IntToStr(runlength);
   Column_str+=str;
   Form1->Image1->Canvas->Pen->Color=(TColor)RGB(0,0,0);
   for (short i=0;i<runlength*10;i++)
   {
        Form1->Image1->Canvas->MoveTo(column+i,row+5);
        Form1->Image1->Canvas->LineTo(column+i,row+10);
   }
   column=column+runlength*10;
   return 1;
}
char  decode_white (short runlength)
{
   String str;
   str=" W";
   str+=IntToStr(runlength);
   Column_str+=str;

   Form1->Image1->Canvas->Pen->Color=(TColor)RGB(255,255,255);
   for (short i=0;i<runlength*10;i++)
   {
        Form1->Image1->Canvas->MoveTo(column+i,row+5);
        Form1->Image1->Canvas->LineTo(column+i,row+10);
   }
   column=column+runlength*10;
   return 1;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -