static void Main(string[] args) { Mod_XAMLToBitmap_08 temp = new Mod_XAMLToBitmap_08(); temp.XAMLToBitmap("D:\\MBME\\FewaReceipt_small_English_ForJK_new.XAML", "D:\\MBME\\Sample.bmp", "Image", 203.0); System.Drawing.Bitmap bmp = new Bitmap("D:\\MBME\\Sample.bmp"); System.Drawing.Bitmap newbmp = BitmapConverter.CopyToBpp(bmp, 1); //BitmapConverter.SplashImage(newbmp, 100, 100); newbmp.Save("D:\\MBME\\Sample1.bmp", System.Drawing.Imaging.ImageFormat.Bmp); m_PrinterDevice = Epic950.FindPrinter(); ReturnStatus del; del = Status; m_PrinterDevice.GetStatus(del); FileStream fsBMP = new FileStream("D:\\MBME\\Sample1.bmp", FileMode.Open); ////m_PrinterDevice.PrintBitmap(fsBMP,500); m_PrinterDevice.PrintBitmap(fsBMP, 0); //for (int i=0;i < 7;i++) // m_PrinterDevice.PrintBitmap(); System.Threading.Thread.Sleep(2000); m_PrinterDevice.GetStatus(del); m_PrinterDevice.Dispose(); //m_PrinterDevice.Reset(); //m_PrinterDevice.GetStatus(); //m_PrinterDevice.WriteText(); }
public bool IsReady() { lock (monitor) { if (m_PrinterDevice == null) m_PrinterDevice = Epic950.FindPrinter(); } if (simulate) { printerState = 1; printerStatus = 1; printerStatusDesc = "Printer Ready."; return true; } if (m_PrinterDevice != null) { short status = -1; status = m_PrinterDevice.GetStatus(prnStatus); System.Threading.Thread.Sleep(1000); if (status > 0) printerState = 1; // Indicates Printer Online State. else { printerState = 2; // Indicates Printer Offline State. printerStatusDesc = "Printer In Offline State."; m_PrinterDevice = null; } if ((printerState == 1) && ((printerStatus == 1) || (printerStatus == 2))) return true; } return false; }