diff options
author | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2007-07-23 12:09:25 +0000 |
---|---|---|
committer | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2007-07-23 12:09:25 +0000 |
commit | aa3047498c3f9ac846b175e2f44ddbebafac86bc (patch) | |
tree | d8cc5e4f8c318e2ec16e5111b13722808fcb0782 /examples | |
parent | c9be342c9263cd72b93fc54ba90330152844d0c3 (diff) | |
download | fpGUI-aa3047498c3f9ac846b175e2f44ddbebafac86bc.tar.xz |
Added and updated the fpGFX package for Windows.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/gui/imgtest/bitmaptest.dpr | 26 | ||||
-rw-r--r-- | examples/gui/imgtest/bitmaptest.lpi | 12 |
2 files changed, 22 insertions, 16 deletions
diff --git a/examples/gui/imgtest/bitmaptest.dpr b/examples/gui/imgtest/bitmaptest.dpr index c8000d15..380aa076 100644 --- a/examples/gui/imgtest/bitmaptest.dpr +++ b/examples/gui/imgtest/bitmaptest.dpr @@ -1,3 +1,7 @@ +{ + This demo shows how you can manipulate the data of a TfpgImage + directly. +} program bitmaptest; {$mode objfpc}{$H+} @@ -26,28 +30,28 @@ type { TMainForm } procedure TMainForm.HandlePaint; +var + i, j: integer; begin Canvas.BeginDraw; // activate double buffering in time. - inherited HandlePaint; +// inherited HandlePaint; + img.Free; + img := TfpgImage.Create; + img.AllocateImage(32, 256, 256); + img.UpdateImage; + // populate the bitmap with pretty colors :-) + for j := 0 to 255 do + for i := 0 to 255 do + PLongWord(img.ImageData)[j * 256 + i] := (i shl 16) or (j shl 8); Canvas.DrawImage(0, 0, img); Canvas.EndDraw; end; constructor TMainForm.Create(AOwner: TComponent); -var - i, j: integer; begin inherited Create(AOwner); SetPosition(100, 100, 256, 256); WindowTitle := 'fpGUI Bitmap Test'; - - img := TfpgImage.Create; - img.AllocateImage(32, 256, 256); - img.UpdateImage; - // populate the bitmap with pretty colors :-) - for j := 0 to 255 do - for i := 0 to 255 do - PLongWord(img.ImageData)[j * 256 + i] := (i shl 16) or (j shl 8); end; destructor TMainForm.Destroy; diff --git a/examples/gui/imgtest/bitmaptest.lpi b/examples/gui/imgtest/bitmaptest.lpi index de1157a5..463da0ee 100644 --- a/examples/gui/imgtest/bitmaptest.lpi +++ b/examples/gui/imgtest/bitmaptest.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=""/> <Title Value="bitmaptest"/> </General> @@ -18,13 +18,14 @@ </VersionInfo> <PublishOptions> <Version Value="2"/> + <DestinationDirectory Value="$(TestDir)\publishedproject\"/> <IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/> <ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/> </PublishOptions> <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"> @@ -43,9 +44,10 @@ </ProjectOptions> <CompilerOptions> <Version Value="5"/> + <PathDelim Value="\"/> <SearchPaths> - <IncludeFiles Value="../source/"/> - <OtherUnitFiles Value="../source/;../source/x11/;../gui/"/> + <IncludeFiles Value="..\source\"/> + <OtherUnitFiles Value="..\source\;..\source\x11\;..\gui\"/> </SearchPaths> <CodeGeneration> <Generate Value="Faster"/> |