Results 1 to 14 of 14

Thread: eBook - Two Boxes - Manage spillovers - {Resolved}

  1. #1

    Thread Starter
    Frenzied Member KayJay's Avatar
    Join Date
    Jul 2001
    Location
    Chennai
    Posts
    1,849

    eBook - Two Boxes - Manage spillovers - {Resolved}

    I am trying to make a simple e-book reader. The contents are in an XML file and I was thinking of using two picture boxes or RTBs to simulate the two pages of a normal book. I am reading the contents Chapter by Chapter.

    As I cannot use Scroll Bars, how do I code such that any spillover from one page goes to the next page and also hold display of text if the Chapter is more than two pages long? I would also like to make the font and "page size", i.e., size of the RTB or Pic Box, variable.

    Hope I was clear

    TIA

    Regards

    KayJay
    Last edited by KayJay; May 15th, 2003 at 06:09 AM.

    "Brothers, you asked for it."
    ...Francisco Domingo Carlos Andres Sebastian D'Anconia

  2. #2
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    Try the [control].TextWidth or [control].TextHeight properties for starters
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  3. #3

    Thread Starter
    Frenzied Member KayJay's Avatar
    Join Date
    Jul 2001
    Location
    Chennai
    Posts
    1,849
    Thanx for the hint. Managed to get it working. Am using picBoxes as RichText ones do not have TextWidth and TextHeight props. So setting fonts is going to be some work.

    Thanx a lot

    Regards

    KayJay


    "Brothers, you asked for it."
    ...Francisco Domingo Carlos Andres Sebastian D'Anconia

  4. #4

    Thread Starter
    Frenzied Member KayJay's Avatar
    Join Date
    Jul 2001
    Location
    Chennai
    Posts
    1,849
    Sastraxi: Almost through! Had a tough time with <center> tags and bitblting inline images. Got that done as well. Thanx a lot again for that early pointer. Saved me a lot of knuckle cracking Should be ready pretty soon for deployment. Unfortunately I can't post what I coded as its for a client of mine.

    Thanx again

    Regards

    KayJay

    "Brothers, you asked for it."
    ...Francisco Domingo Carlos Andres Sebastian D'Anconia

  5. #5
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    Well, I'll tell you one thing - you're diligent. Half of the members on here, I know, would still be looking for code

    Good job on the reader. Is it possible to see a screenshot?
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  6. #6

    Thread Starter
    Frenzied Member KayJay's Avatar
    Join Date
    Jul 2001
    Location
    Chennai
    Posts
    1,849
    Screenshot? Sure! Its attached.


    In fact the book will be available for public download shortly we can release the code should we choose to, as this reader is our own value addition and the books' contents are already available on their website for everybody to see. But nevertheless, its only fair to get their permission since they have paid us to develop it.

    And as for the centering code. Here is a sample I had posted to help another VBFer out. Yeah! I did that!
    posted here
    VB Code:
    1. Private Const strData As String = "This is a sample text that should perhaps run " & _
    2. "into more than three lines depending on the font " & _
    3. "that is used to display the text in this picturebox." & _
    4. "The technique I would suggest is to read this text into a " & _
    5. "variable and split by a space and then print onto this " & _
    6. "picture box depending on the position of the current " & _
    7. "pixel in relation to the current font's TextHeight and/or TextWidth"
    8.  
    9. Private Sub Command1_Click()
    10. Dim strDataArray() As String
    11. Dim strToPrint As String
    12. strDataArray = Split(strData, " ", -1, vbBinaryCompare)
    13. i = 0
    14. Do
    15. If i > UBound(strDataArray) Then
    16.     Exit Do
    17. End If
    18. Do
    19.     If i > UBound(strDataArray) Then
    20.         Exit Do
    21.     End If
    22.        If (picBox.CurrentX + picBox.TextWidth(strToPrint & strDataArray(i))) > (picBox.ScaleWidth) Then
    23.         'i = i + 1
    24.             Exit Do
    25.         End If
    26.     strToPrint = strToPrint & strDataArray(i) & " "
    27.     picBox.CurrentX = (picBox.ScaleWidth - (picBox.TextWidth(strToPrint))) / 2
    28.     i = i + 1
    29. Loop
    30. picBox.Print strToPrint
    31. strToPrint = ""
    32. picBox.CurrentX = 0
    33. Loop
    34. End Sub
    35.  
    36. Private Sub Form_Load()
    37. With picBox
    38.     .ScaleMode = vbPixels
    39.     .Font.Name = "Century Gothic"
    40.     .Font.size = 10
    41.     .Font.Bold = True
    42.     .Font.Italic = True
    43.     .Height = 300
    44.     .Width = 300
    45.     .AutoRedraw = True
    46. End With
    47. End Sub
    Cheers!

    KayJay
    Attached Images Attached Images  
    Last edited by KayJay; May 15th, 2003 at 09:11 AM.

    "Brothers, you asked for it."
    ...Francisco Domingo Carlos Andres Sebastian D'Anconia

  7. #7
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    Looks very nice ^_^
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  8. #8
    Addicted Member CodeRonin's Avatar
    Join Date
    Jul 2002
    Location
    Vienna, Austria
    Posts
    233

    Ebook

    The Ebook looks interesting.... what is it?
    Code Ronin

  9. #9

    Thread Starter
    Frenzied Member KayJay's Avatar
    Join Date
    Jul 2001
    Location
    Chennai
    Posts
    1,849
    Sastraxi: Thank you very much And I may be able to post the code soon.

    CodeRonin:
    If you mean the application - It is a compiled application where the book's contents are painted onto the screen to simulate reading of a normal paper book, and flipping its pages backwards or forwards. We wanted to do it mainly for portability; the text and images can be included as resource files, so only one file, the compiled EXE needs to be distributed. The second reason is to maintain data integrity and protect against plagiarism. No Cut-Copy-Paste, and editing of the text is possible. At least its not very easy.

    If you mean the contents of the book - To learn more of Sri Ramchandra's Pranahuti Aided Meditation, visit http://www.sriramchandra.org

    Yes, we developed that website and are hosting it as well.



    Regards

    KayJay

  10. #10

    Thread Starter
    Frenzied Member KayJay's Avatar
    Join Date
    Jul 2001
    Location
    Chennai
    Posts
    1,849
    Originally posted by Sastraxi
    ....... diligent. Half of the members on here, I know, would still be looking for code
    .....
    I thought you were being slightly uncharitable, I don't now

  11. #11
    Frenzied Member cyborg's Avatar
    Join Date
    May 2000
    Location
    Sweden
    Posts
    1,755
    lol
    Check out the FAQ and do a search before you post.
    My tutorials: Anti-Alias Pixels, Accurate Game Loop, Resource File

  12. #12
    Addicted Member CodeRonin's Avatar
    Join Date
    Jul 2002
    Location
    Vienna, Austria
    Posts
    233

    Ebook

    I meant the content of the book, tahnk you... Are you generally interested in meditaion and stuff?
    Code Ronin

  13. #13

    Thread Starter
    Frenzied Member KayJay's Avatar
    Join Date
    Jul 2001
    Location
    Chennai
    Posts
    1,849
    Cyborg:

    CodeRonin:

    Yes, I am very intereseted, though I have not yet initiated myself into that particular system. But I will eventually, if only because its in my blood

    Should you be interested, you could communicate with the Institute straight from the Website. Off my head, I do not know of a training centre in Austria yet, but that is never a hindrance in such matters.

    Regards

    KayJay

  14. #14
    Addicted Member CodeRonin's Avatar
    Join Date
    Jul 2002
    Location
    Vienna, Austria
    Posts
    233

    Hmm...

    I'm more of a Zen follower myself, check out my site (www.geocities.com/bushidonews) for info about zen...
    Code Ronin

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width