[simpits-tech] Any Delphi GURU out there - or wheres Roy
Erwin Neyt
erwin at sim-instruments.com
Sun Mar 7 22:19:45 PST 2004
Well Roy,
What Paul is doing is actually correct. He is not loading from a bmp file,
but from a resourse file: {$R 262-ins-bk.res}.
Erwin.
> -----Original Message-----
> From: simpits-tech-bounces at simpits.org
> [mailto:simpits-tech-bounces at simpits.org] On Behalf Of Roy Coates
> Sent: Sunday, March 07, 2004 16:40
> To: Simulator Cockpit tech list
> Subject: Re: [simpits-tech] Any Delphi GURU out there - or wheres Roy
>
> 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
> >
> >
>
> _______________________________________________
> Simpits-tech mailing list
> Simpits-tech at simpits.org
> http://www.simpits.org/mailman/listinfo/simpits-tech
> To unsubscribe, please see the instructions at the bottom of
> the above page. Thanks!
>
More information about the Simpits-tech
mailing list