Page 2 of 2 FirstFirst 12
Results 11 to 18 of 18

Thread: string to bitmap module

  1. #11
    thinBasic MVPs
    Join Date
    May 2007
    Location
    UK
    Posts
    1,427
    Rep Power
    159

    Re: string to bitmap module

    Quote Originally Posted by ErosOlmi
    Here they are PB source.
    They can be improved maybe wrapping arounf TRY/CATCH/END TRY

    [code=vb]
    FUNCTION FILE_Load(BYVAL lFileName AS STRING) AS STRING
    LOCAL hFile AS LONG
    LOCAL lBuffer AS STRING

    ON ERROR RESUME NEXT
    IF FILE_EXISTS(lFileName) THEN
    hFile = FREEFILE
    OPEN lFileName FOR BINARY ACCESS READ AS hFile
    SEEK hFile,1 ' Start of file
    GET$ hFile, LOF(hFile), lBuffer
    CLOSE hFile
    FUNCTION = lBuffer
    END IF

    END FUNCTION
    [/code]

    thanks

    Is it better to add SEEK like above to guarantee that it points to the start of the file.
    Home Desktop : Windows 7 - Intel Pentium (D) - 3.0 Ghz - 2GB - Geforce 6800GS
    Home Laptop : WinXP Pro SP3 - Intel Centrino Duo - 1.73 Ghz - 2 GB - Intel GMA 950
    Home Laptop : Windows 10 - Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz, 2401 Mhz, 2 Core(s), 4 Logical Processor(s) - 4 GB - Intel HD 4400
    Work Desktop : Windows 10 - Intel I7 - 4 Ghz - 8GB - Quadro Fx 370

  2. #12
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: string to bitmap module

    Do you have any evidence that after an OPEN ... BINARY ACCESS READ pointer is not at the beginning of the file?
    Because file channel is a new one, even if file is already open in the same process, it should create a new file structure setting pointer to the beginning of the file.

    I'm not aware of problems on that side but if you have good reason a will change.

    Thanks
    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  3. #13
    thinBasic MVPs
    Join Date
    May 2007
    Location
    UK
    Posts
    1,427
    Rep Power
    159

    Re: string to bitmap module

    no evidence. Me just not trusting that they wont change it in the future and just playing it safe.

    thanks

    Mike
    Home Desktop : Windows 7 - Intel Pentium (D) - 3.0 Ghz - 2GB - Geforce 6800GS
    Home Laptop : WinXP Pro SP3 - Intel Centrino Duo - 1.73 Ghz - 2 GB - Intel GMA 950
    Home Laptop : Windows 10 - Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz, 2401 Mhz, 2 Core(s), 4 Logical Processor(s) - 4 GB - Intel HD 4400
    Work Desktop : Windows 10 - Intel I7 - 4 Ghz - 8GB - Quadro Fx 370

  4. #14
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: string to bitmap module

    OK, thanks.
    Maybe time to improve a bit. Those functions are at least 4 years old
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  5. #15
    thinBasic MVPs
    Join Date
    May 2007
    Location
    UK
    Posts
    1,427
    Rep Power
    159

    Re: string to bitmap module

    I found my original code (from my old dead HDD) for this module, thought I would release it for people to play with.

    Its as I left it last year so I dont know if its working or not.
    Attached Files Attached Files
    Home Desktop : Windows 7 - Intel Pentium (D) - 3.0 Ghz - 2GB - Geforce 6800GS
    Home Laptop : WinXP Pro SP3 - Intel Centrino Duo - 1.73 Ghz - 2 GB - Intel GMA 950
    Home Laptop : Windows 10 - Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz, 2401 Mhz, 2 Core(s), 4 Logical Processor(s) - 4 GB - Intel HD 4400
    Work Desktop : Windows 10 - Intel I7 - 4 Ghz - 8GB - Quadro Fx 370

  6. #16

    Re: string to bitmap module

    thanks Michael for sharing!

  7. #17
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: string to bitmap module

    Thanks Michael (Clease) for posting the sources here.

    Can you be so kind to see if you have your copy of "zlib.inc" file?
    The versions I have are incompatible with your code. In particular "uncompress" function.

    Thanks a lot
    Eros

    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  8. #18
    thinBasic MVPs
    Join Date
    May 2007
    Location
    UK
    Posts
    1,427
    Rep Power
    159

    Re: string to bitmap module

    I suspect that the uncompress function was the thing I was working on when I stopped work on it.

    The zlib files I have will be added to my post with the code on.
    Home Desktop : Windows 7 - Intel Pentium (D) - 3.0 Ghz - 2GB - Geforce 6800GS
    Home Laptop : WinXP Pro SP3 - Intel Centrino Duo - 1.73 Ghz - 2 GB - Intel GMA 950
    Home Laptop : Windows 10 - Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz, 2401 Mhz, 2 Core(s), 4 Logical Processor(s) - 4 GB - Intel HD 4400
    Work Desktop : Windows 10 - Intel I7 - 4 Ghz - 8GB - Quadro Fx 370

Page 2 of 2 FirstFirst 12

Similar Threads

  1. bitmap font
    By kryton9 in forum TBGL General
    Replies: 6
    Last Post: 26-04-2007, 20:53

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

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