[simpits-tech] Any Delphi GURU out there - or wheres Roy

Roy Coates roy at flightlab.liv.ac.uk
Sun Mar 7 15:39:47 PST 2004


On Sun, 7 Mar 2004, paul needham wrote:


A quick look tells me to use:

BackgroundBitmap.loadfromfile('262-ins-bk.bmp');

hth,

Roy.



>
> Hi all
>
> I am trying to use FSUIPC and have with my limited programming skills [
> pascal and C 8 years ago ! ]successfully complied and hacked the
> UIPCHello world file but have failed with the following code.
> I want to load a bitmap of my cockpit instruments into the background to
> a form, I have go it to 800*640 and 256 colours and made a resource file
> of it.
> The code below was found on the Net but was for Delphi 1 or 2 and I have
> Delphi 7 it fails with the following :-
>
> [Error] MainFormback.pas(84): Object or class type required
>   [Error] MainFormback.pas(85): Undeclared identifier:
> 'LoadFromResourceName'
>   [Error] MainFormback.pas(88): ';' expected but '.' found
>   [Error] MainFormback.pas(90): Undeclared identifier:
> 'BackgroundBitmap'
>   [Error] MainFormback.pas(90): Missing operator or semicolon
>   [Error] MainFormback.pas(93): Undeclared identifier: 'Formpaint'
>   [Error] MainFormback.pas(95): Undeclared identifier: 'Canvas'
>   [Error] MainFormback.pas(95): Undeclared identifier:
> 'BackgroundBitmap'
>   [Error] MainFormback.pas(98): Identifier redeclared:
> 'TFormMain.FormCreate'
>   [Error] MainFormback.pas(102): Object or class type required
>   [Error] MainFormback.pas(104): Undeclared identifier: 'LoadFromFile'
>   [Error] MainFormback.pas(105): Undeclared identifier: 'Form1'
>   [Error] MainFormback.pas(105): Incompatible types: 'TBitmap' and
> 'tagBITMAP'
>   [Error] MainFormback.pas(106): Missing operator or semicolon
>   [Error] MainFormback.pas(108): Missing operator or semicolon
>   [Error] MainFormback.pas(109): Undeclared identifier: 'Free'
>
>  { Private declarations }
>              BackgroundBitmap :  TBitmap ;
>
>              public
>              { Public declarations }
>              end;
>
> var
>   FormMain: TFormMain;
>
> implementation
>
> {$R *.DFM}
> {$R 262-ins-bk.res}
>
>
> Uses
>   FPCuser;
> procedure TFormMain.Formcreate(Sender: TObject);
> begin
> line 84   BackgroundBitmap := TBitmap.create;
> BackgroundBitmap.LoadFromResourceName(hInstance,'262-ins-bk');
> end;
>
> procedure Tform1.Formestroy(Sender: TObject);
> begin
> BackgroundBitmap.Free;
> end;
>
> procedure TFormmain.Formpaint(Sender: TObject);
> begin
>    Canvas.Draw(0,0,BackgroundBitmap);
> end;
>
> Sorry for long boring post !!!
>
> Regards Paul
>
> Despite constant warnings, I have never met anybody who has had their
> leg broken by a swan.
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.613 / Virus Database: 392 - Release Date: 04/03/2004
>
>



More information about the Simpits-tech mailing list