Changeset 16 for trunk/UMainForm.pas


Ignore:
Timestamp:
Mar 24, 2011, 7:05:53 AM (14 years ago)
Author:
george
Message:
  • Added: Menu action to view RawImage description.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UMainForm.pas

    r14 r16  
    77uses
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
    9   ComCtrls, Menus, ActnList, UCore, UPlatform, Math, DateUtils;
     9  ComCtrls, Menus, ActnList, UCore, UPlatform, Math, DateUtils, GraphType;
    1010
    1111type
     
    1414
    1515  TMainForm = class(TForm)
     16    AAbout: TAction;
     17    AShowRawImageDesc: TAction;
    1618    AShowMap: TAction;
    1719    ANewGame: TAction;
     
    2729    MenuItem5: TMenuItem;
    2830    MenuItem6: TMenuItem;
     31    MenuItem7: TMenuItem;
     32    MenuItem8: TMenuItem;
    2933    StatusBar1: TStatusBar;
    3034    TimerDraw: TTimer;
     
    3438    procedure ANewGameExecute(Sender: TObject);
    3539    procedure AShowMapExecute(Sender: TObject);
     40    procedure AShowRawImageDescExecute(Sender: TObject);
    3641    procedure FormCreate(Sender: TObject);
    3742    procedure FormDeactivate(Sender: TObject);
     
    172177end;
    173178
     179procedure TMainForm.AShowRawImageDescExecute(Sender: TObject);
     180var
     181  List: TStringList;
     182begin
     183  with Image1.Picture.Bitmap.RawImage, Description do
     184  try
     185    List := TStringList.Create;
     186    with List do begin
     187      Add('Format: ' + RawImageColorFormatNames[Format]);
     188      Add('Width: ' + IntToStr(Width));
     189      Add('Height: ' + IntToStr(Height));
     190      Add('Depth: ' + IntToStr(Depth));
     191      Add('BitOrder: ' + RawImageBitOrderNames[BitOrder]);
     192      Add('ByteOrder: ' + RawImageByteOrderNames[ByteOrder]);
     193      Add('LineOrder: ' + RawImageLineOrderNames[LineOrder]);
     194      Add('LineEnd: ' + RawImageLineEndNames[LineEnd]);
     195      Add('BitsPerPixel: ' + IntToStr(BitsPerPixel));
     196      Add('RedPrec: ' + IntToStr(RedPrec));
     197      Add('RedShift: ' + IntToStr(RedShift));
     198      Add('GreenPrec: ' + IntToStr(GreenPrec));
     199      Add('GreenShift: ' + IntToStr(GreenShift));
     200      Add('BluePrec: ' + IntToStr(BluePrec));
     201      Add('BlueShift: ' + IntToStr(BlueShift));
     202      Add('AlphaPrec: ' + IntToStr(AlphaPrec));
     203      Add('AlphaShift: ' + IntToStr(AlphaShift));
     204    end;
     205    ShowMessage(List.Text);
     206  finally
     207    List.Free;
     208  end;
     209end;
     210
    174211procedure TMainForm.AExitExecute(Sender: TObject);
    175212begin
Note: See TracChangeset for help on using the changeset viewer.