Scanline Enigma 1 Application and Source Code download
Delphi 7 example: How to join two images together, side by side, using Draw or Scanline.
This program also has built in error trapping and writing to a log file for examination.
All errors have now been rectified.

  • Scanline Enigma 1, screen shot of program after loading 2 images.



  • Scanline Enigma 1, screen shot of program after a successful image join.


    There are 2 join image methods,
    the first uses the Draw statement,
    the second uses the Scanline statement.
    With the Draw statement in Join 1, you can join images that are not the same size.
    With the Scanline statement in Join 2, you can join images that are the same dimensions in pixels only.
    If the images being joined have different dimensions compared to each other, an error will occur.



    This program was written after encountering errors while writing the MERDAT application.
    The good folks in the Borland Delphi community have assisted me with this code.

    I would like to thank,
    Mattias Andersson for his solution to the Scanline code.
    GrandmasterB and Skybuck Flying for their suggestions to use Draw instead of Scanline.
    David Ninnes for his Assert statement suggestion.
    Jamie for jumping in to assist as well.



    Below is the code that uses the Draw statement to join two images side by side. Any sized images
    can be used, this is most flexible.
    The code example will still need a tweak to make all image sizes and combinations fit,
    e.g.
    W := max(BitmapX1.Width, BitmapX2.Width); and,
    H := max(BitmapX1.Height, BitmapX2.Height); should be added, but this will get you off the mark.


    procedure TForm1.Button25Click(Sender: TObject);
    var
    W, H : integer;
    begin
    //
    Label5.Caption := '>>> MERGE METHOD GrandmasterB/Skybuck (ATTEMPT)';
    Button10.Click; // Process into Log File
    W := (BitmapX1.Width + BitmapX2.Width);
    H := (BitmapX1.Height);
    BitmapXOut.Width := W;
    BitmapXOut.Height := H;
    //
    BitmapXOut.Canvas.Draw(0, 0, BitmapX1);
    BitmapXOut.Canvas.Draw(BitmapX1.Width, 0, BitmapX2);
    Image3.Picture.Bitmap := BitmapXOut;
    Label5.Caption := '>>> MERGE METHOD GrandmasterB/Skybuck (SUCCESS)';
    Button10.Click; // Process into Log File
    end; //



    Below is the code that uses the Scanline statement to join two images side by side.
    This code must have images that are the same as each other in regards to pixel dimensions.
    Otherwise an error will occur.

    procedure TForm1.Button26Click(Sender: TObject);
    Var //
    x, y, W, H : integer;
    begin
    //
    Label5.Caption := '>>> MERGE METHOD Mattias Andersson (ATTEMPT)';
    Button10.Click; // Process into Log File
    W := (BitmapX1.Width + BitmapX1.Width);
    H := (BitmapX1.Height);
    BitmapXOut.Width := W;
    BitmapXOut.Height := H;
    SetLength(ScanlinesOut, H);
    for y := 0 to H-1 do ScanlinesOut[y] := BitmapXOut.ScanLine[y];
    for y := 0 to H-1 do
    begin
    for x := 0 to BitmapX1.Width-1 do
    begin
    ScanlinesOut[y][x] := Scanlines1[y][x];
    end;
    for x := 0 to BitmapX2.Width-1 do
    begin
    ScanlinesOut[y][BitmapX1.Width + x] := Scanlines2[y][x];
    end;
    end;
    Image3.Picture.Bitmap := BitmapXOut;
    //
    Label5.Caption := '>>> MERGE METHOD Mattias Andersson (SUCCESS)';
    Button10.Click; // Process into Log File
    end;
    //



  • ScanlineEnigma1 executable and notes only. This software is for the investigation of errors encountered using Scanline while attempting to join images.
    Download ScanlineEnigma1 executable and notes only. 530 KB

  • ScanlineEnigma1 source code, made with Delphi 7.
    Download the Delphi source code for ScanlineEnigma1. 600 KB

  • Sample Image files for use with ScanlineEnigma1.
    Download 18 NASA images for testing ScanlineEnigma1. 2 MB


    Welcome to www.vk3ukf.com.
    Kevin Forbes (Amateur Radio Callsign VK3UKF)

    More about Kevin







  • NearlyFreeSpeech.NET



    Home
    ( UPDATED: Mar 27 2008 )