summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorsekelsenmat <sekelsenmat@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2007-05-27 09:29:23 +0000
committersekelsenmat <sekelsenmat@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2007-05-27 09:29:23 +0000
commit41fd902e393efc9a057defc73fee1a1aef17d98f (patch)
tree501c79507895c11f0d58bf9587f160c98d4ea977 /examples
parent2d5991c4c67b9ead40df34cfdb73434231956116 (diff)
downloadfpGUI-41fd902e393efc9a057defc73fee1a1aef17d98f.tar.xz
partial fix for fpimg
Diffstat (limited to 'examples')
-rw-r--r--examples/gfx/imgtest/imgtest.lpi7
-rw-r--r--examples/img/masktest/masktest.pas39
2 files changed, 21 insertions, 25 deletions
diff --git a/examples/gfx/imgtest/imgtest.lpi b/examples/gfx/imgtest/imgtest.lpi
index c507609d..57b067c6 100644
--- a/examples/gfx/imgtest/imgtest.lpi
+++ b/examples/gfx/imgtest/imgtest.lpi
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<CONFIG>
<ProjectOptions>
- <PathDelim Value="/"/>
+ <PathDelim Value="\"/>
<Version Value="5"/>
<General>
<Flags>
@@ -9,7 +9,7 @@
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
- <IconPath Value="./"/>
+ <IconPath Value=".\"/>
<TargetFileExt Value=""/>
</General>
<PublishOptions>
@@ -20,7 +20,7 @@
<RunParams>
<local>
<FormatVersion Value="1"/>
- <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
+ <LaunchingApplication PathPlusParams="\usr\X11R6\bin\xterm -T 'Lazarus Run Output' -e $(LazarusDir)\tools\runwait.sh $(TargetCmdLine)"/>
</local>
</RunParams>
<RequiredPackages Count="1">
@@ -39,6 +39,7 @@
</ProjectOptions>
<CompilerOptions>
<Version Value="5"/>
+ <PathDelim Value="\"/>
<CodeGeneration>
<Generate Value="Faster"/>
</CodeGeneration>
diff --git a/examples/img/masktest/masktest.pas b/examples/img/masktest/masktest.pas
index 79b619ef..b469dbd5 100644
--- a/examples/img/masktest/masktest.pas
+++ b/examples/img/masktest/masktest.pas
@@ -24,44 +24,41 @@ type
TMainWindow = class
procedure Paint(Sender: TObject; const ARect: TRect);
private
- Display: TDefDisplay;
- Window: TGfxWindow;
- Image2, Image4, Image8, Image24, Mask: TGfxImage;
+ Window: TFWindow;
+ Image2, Image4, Image8, Image24, Mask: TFBitmap;
Image2Canvas, Image4Canvas, Image8Canvas,
- Image24Canvas, MaskCanvas: TGfxCanvas;
+ Image24Canvas, MaskCanvas: TFCanvas;
public
- constructor Create(ADisplay: TDefDisplay);
+ constructor Create;
destructor Destroy; override;
end;
-constructor TMainWindow.Create(ADisplay: TDefDisplay);
+constructor TMainWindow.Create;
begin
inherited Create;
- Display := ADisplay;
// Load and prepare the images
- Image2 := CreateImageFromFile(Display.DefaultScreen, TBMPReader, 'image2.bmp');
- Image2Canvas :=
- Display.DefaultScreen.CreateBitmap(Image2.Width, Image2.Height);
+ Image2 := CreateImageFromFile(GFScreen, TBMPReader, 'image2.bmp');
+ Image2Canvas := TFBitmap.Create(Image2.Width, Image2.Height);
Image2Canvas.DrawImage(Image2, Point(0, 0));
- Image4 := CreateImageFromFile(Display.DefaultScreen, TBMPReader, 'image4.bmp');
+ Image4 := CreateImageFromFile(GFScreen, TBMPReader, 'image4.bmp');
Image4Canvas :=
- Display.DefaultScreen.CreateBitmap(Image4.Width, Image4.Height);
+ GFScreen.CreateBitmap(Image4.Width, Image4.Height);
Image4Canvas.DrawImage(Image4, Point(0, 0));
- Image8 := CreateImageFromFile(Display.DefaultScreen, TBMPReader, 'image8.bmp');
+ Image8 := CreateImageFromFile(GFScreen, TBMPReader, 'image8.bmp');
Image8Canvas :=
Display.DefaultScreen.CreateBitmap(Image8.Width, Image8.Height);
Image8Canvas.DrawImage(Image8, Point(0, 0));
- Image24 := CreateImageFromFile(Display.DefaultScreen, TBMPReader, 'image24.bmp');
+ Image24 := CreateImageFromFile(GFScreen, TBMPReader, 'image24.bmp');
Image24Canvas :=
Display.DefaultScreen.CreateBitmap(Image24.Width, Image24.Height);
Image24Canvas.DrawImage(Image24, Point(0, 0));
// Load and prepare the image mask
- Mask := CreateImageFromFile(Display.DefaultScreen, TBMPReader, 'mask.bmp');
+ Mask := CreateImageFromFile(GFScreen, TBMPReader, 'mask.bmp');
MaskCanvas := Display.DefaultScreen.CreateMonoBitmap(Mask.Width, Mask.Height);
MaskCanvas.DrawImage(Mask, Point(0, 0));
@@ -124,14 +121,12 @@ begin
end;
var
- Display: TDefDisplay;
MainWindow: TMainWindow;
begin
- WriteLn('Version: ' + {$I %date%} + ' ' + {$I %time%});
- Display := TDefDisplay.Create;
- MainWindow := TMainWindow.Create(Display);
- Display.Run;
- MainWindow.Free;
- Display.Free;
+ GFApplication.Initialize;
+ MainWindow := TMainWindow.Create;
+ GFApplication.AddWindow(MainWindow);
+ MainWindow.Show;
+ GFApplication.Run;
end.