private void m_PictureBoxImage_Paint(object sender, System.Windows.Forms.PaintEventArgs e) { Graphics g = e.Graphics; if (this.m_PictureBoxImage.Image == null) { string noPreviewInfo = string.Empty; if(m_JobSize.Width == 0 || m_JobSize.Height == 0) { #if !LIYUUSB noPreviewInfo = ResString.GetNoPreviewImage(); #elif(LIYUUSB&&YASLAN ) Assembly myAssembly = Assembly.GetExecutingAssembly(); string[] names = myAssembly.GetManifestResourceNames(); string logopath = Path.Combine(Application.StartupPath,"Setup\\LOGO.png"); if (File.Exists(logopath)) { Stream myStream1 = new FileStream(logopath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);// myAssembly.GetManifestResourceStream("BYHXPrinterManager.Preview.yaslanLOGO.png"); if (myStream1 != null) m_PictureBoxImage.Image = new Bitmap(myStream1);// this.imageList1.Images[0]; } #else m_PictureBoxImage.Image = this.imageList1.Images[0]; #endif } else { noPreviewInfo = ResString.GetCreatingPreviewImage(); #if !LIYUUSB } #endif if (!m_bPrintingPreview) { Rectangle layoutRect = this.m_PictureBoxImage.ClientRectangle; StringFormat sf = new StringFormat(); sf.Alignment = StringAlignment.Center; sf.LineAlignment = StringAlignment.Center; e.Graphics.DrawString(noPreviewInfo, this.Font, SystemBrushes.WindowText, layoutRect, sf); } #if LIYUUSB } #endif return; }