Write a binary string(image) to a file

Posted on 2005-04-13
Last Modified: 2012-05-05
  AssignFile(tiffFile, 'c:\Test1.tif');
this is what I have but for some reason the tiff when read from the string is II* and if I look into the file after it being written it doesnt start with II* what am I doing wrong?

Question by:T0masz

    Author Comment

    a is a string
    and tiffFile is a File
    LVL 11

    Accepted Solution

    try this:

    AssignFile(tiffFile, 'c:\Test1.tif');
    ReWrite(tiffFile, 1);
    BlockWrite(tiffFile, a[1], length(a));

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
    The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now