예제 #1
0
 private void GetPage()
 {
     if (m_IdChapter == null)
     {
         m_oPage = m_oBook.GetPage(m_iActualPage);
     }
     else
     {
         CChapter oChapter = (CChapter)m_oBook.Chapter[m_IdChapter];
         m_oPage = oChapter.GetPage(m_iActualPage);
     }
 }
예제 #2
0
        private void LoadPicturePage()
        {
            string sImage = "";

            splitContainer5.SplitterDistance = this.Width - 59;
            splitContainer1.SplitterDistance = this.Width - splitContainer5.Width - 1;


            if (pictureBox1.BackgroundImage != null)
            {
                pictureBox1.BackgroundImage.Dispose();
                pictureBox1.BackgroundImage = null;
                GC.Collect();
            }

            try
            {
                if (m_IdChapter == null)
                {
                    m_oPage = m_oBook.GetPage(m_iActualPage);
                }
                else
                {
                    CChapter oChapter = (CChapter)m_oBook.Chapter[m_IdChapter];
                    m_oPage = oChapter.GetPage(m_iActualPage);
                }
                sImage = CGenDef.BooksDir + "\\" + m_oBook.NameId + "\\" + m_oPage.Background;
                pictureBox1.BackgroundImage = new Bitmap(sImage);
            }
            catch
            {
                pictureBox1.BackgroundImage = new Bitmap(CGenDef.BooksDir + m_oBook.NameId + "\\cover.png");
            }


            if (pictureBox1.BackgroundImage.Width < this.Width - 119)
            {
                splitContainer1.SplitterDistance = this.Width - pictureBox1.BackgroundImage.Width - 59;
                splitContainer5.SplitterDistance = pictureBox1.BackgroundImage.Width;
            }
        }