example for TLazIntfImage fixed

git-svn-id: trunk@12266 -
This commit is contained in:
mattias 2007-10-01 09:05:25 +00:00
parent 86cc0508dc
commit 622c1cea5a
3 changed files with 32 additions and 32 deletions

View File

@ -1,43 +1,19 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<CONFIG> <CONFIG>
<ProjectOptions> <ProjectOptions>
<Version Value="3"/> <PathDelim Value="/"/>
<Version Value="5"/>
<General> <General>
<ProjectType Value="Application"/>
<Flags> <Flags>
<SaveClosedFiles Value="False"/> <SaveClosedFiles Value="False"/>
<SaveOnlyProjectUnits Value="True"/> <SaveOnlyProjectUnits Value="True"/>
</Flags> </Flags>
<MainUnit Value="0"/> <MainUnit Value="0"/>
<ActiveEditorIndexAtStart Value="0"/>
<IconPath Value="./"/> <IconPath Value="./"/>
<TargetFileExt Value=""/> <TargetFileExt Value=""/>
<Title Value="Fade In - Example for TLazIntfImage"/> <Title Value="Fade In - Example for TLazIntfImage"/>
<ActiveEditorIndexAtStart Value="0"/>
</General> </General>
<Units Count="2">
<Unit0>
<CursorPos X="8" Y="11"/>
<EditorIndex Value="1"/>
<Filename Value="fadein1.lpr"/>
<IsPartOfProject Value="True"/>
<Loaded Value="True"/>
<TopLine Value="1"/>
<UnitName Value="FadeIn1"/>
<UsageCount Value="20"/>
</Unit0>
<Unit1>
<CursorPos X="19" Y="59"/>
<EditorIndex Value="0"/>
<Filename Value="mainunit1.pas"/>
<ComponentName Value="Form1"/>
<IsPartOfProject Value="True"/>
<Loaded Value="True"/>
<ResourceFilename Value="mainunit1.lrs"/>
<TopLine Value="37"/>
<UnitName Value="MainUnit1"/>
<UsageCount Value="20"/>
</Unit1>
</Units>
<PublishOptions> <PublishOptions>
<Version Value="2"/> <Version Value="2"/>
<IgnoreBinaries Value="False"/> <IgnoreBinaries Value="False"/>
@ -56,9 +32,33 @@
<MinVersion Major="1" Valid="True"/> <MinVersion Major="1" Valid="True"/>
</Item1> </Item1>
</RequiredPackages> </RequiredPackages>
<Units Count="2">
<Unit0>
<Filename Value="fadein1.lpr"/>
<IsPartOfProject Value="True"/>
<UnitName Value="FadeIn1"/>
<CursorPos X="8" Y="11"/>
<TopLine Value="1"/>
<EditorIndex Value="3"/>
<UsageCount Value="20"/>
<Loaded Value="True"/>
</Unit0>
<Unit1>
<Filename Value="mainunit1.pas"/>
<ComponentName Value="Form1"/>
<IsPartOfProject Value="True"/>
<ResourceFilename Value="mainunit1.lrs"/>
<UnitName Value="MainUnit1"/>
<CursorPos X="30" Y="234"/>
<TopLine Value="215"/>
<EditorIndex Value="0"/>
<UsageCount Value="20"/>
<Loaded Value="True"/>
</Unit1>
</Units>
</ProjectOptions> </ProjectOptions>
<CompilerOptions> <CompilerOptions>
<Version Value="2"/> <Version Value="5"/>
<SearchPaths> <SearchPaths>
<SrcPath Value="$(LazarusDir)/lcl/;$(LazarusDir)/lcl/interfaces/$(LCLWidgetType)/"/> <SrcPath Value="$(LazarusDir)/lcl/;$(LazarusDir)/lcl/interfaces/$(LCLWidgetType)/"/>
</SearchPaths> </SearchPaths>

View File

@ -84,7 +84,7 @@ begin
TempIntfImg.Colors[px,py]:=CurColor; TempIntfImg.Colors[px,py]:=CurColor;
end; end;
end; end;
TempIntfImg.CreateBitmap(ImgHandle,ImgMaskHandle,false); TempIntfImg.CreateBitmaps(ImgHandle,ImgMaskHandle,false);
TempBitmap.Handle:=ImgHandle; TempBitmap.Handle:=ImgHandle;
TempBitmap.MaskHandle:=ImgMaskHandle; TempBitmap.MaskHandle:=ImgMaskHandle;
Canvas.Draw(x,y,TempBitmap); Canvas.Draw(x,y,TempBitmap);
@ -231,7 +231,7 @@ begin
croix(px+x,py+y); croix(px+x,py+y);
{$ENDIF} {$ENDIF}
TempIntfImg.CreateBitmap(ImgHandle,ImgMaskHandle,false); TempIntfImg.CreateBitmaps(ImgHandle,ImgMaskHandle,false);
TempBitmap.Handle:=ImgHandle; TempBitmap.Handle:=ImgHandle;
TempBitmap.MaskHandle:=ImgMaskHandle; TempBitmap.MaskHandle:=ImgMaskHandle;
aCanvas.Draw(x-dx,y-dy,TempBitmap); aCanvas.Draw(x-dx,y-dy,TempBitmap);

View File

@ -244,7 +244,7 @@ type
ExceptionOnError: boolean): boolean; virtual; ExceptionOnError: boolean): boolean; virtual;
procedure LoadFromDevice(DC: HDC); virtual; procedure LoadFromDevice(DC: HDC); virtual;
procedure LoadFromBitmap(ABitmap, AMaskBitmap: HBitmap; AWidth: integer = -1; AHeight: integer = -1); virtual; procedure LoadFromBitmap(ABitmap, AMaskBitmap: HBitmap; AWidth: integer = -1; AHeight: integer = -1); virtual;
procedure CreateBitmaps(var ABitmap, AMask: HBitmap; ASkipMask: boolean = False); virtual; procedure CreateBitmaps(out ABitmap, AMask: HBitmap; ASkipMask: boolean = False); virtual;
procedure SetRawImage(const ARawImage: TRawImage; ADataOwner: Boolean = True); virtual; procedure SetRawImage(const ARawImage: TRawImage; ADataOwner: Boolean = True); virtual;
procedure GetRawImage(out ARawImage: TRawImage); virtual; procedure GetRawImage(out ARawImage: TRawImage); virtual;
procedure FillPixels(const Color: TFPColor); virtual; procedure FillPixels(const Color: TFPColor); virtual;
@ -2979,7 +2979,7 @@ begin
SetRawImage(RawImage); SetRawImage(RawImage);
end; end;
procedure TLazIntfImage.CreateBitmaps(var ABitmap, AMask: HBitmap; ASkipMask: boolean); procedure TLazIntfImage.CreateBitmaps(out ABitmap, AMask: HBitmap; ASkipMask: boolean);
begin begin
if not RawImage_CreateBitmaps(FRawImage, ABitmap, AMask, ASkipMask) if not RawImage_CreateBitmaps(FRawImage, ABitmap, AMask, ASkipMask)
then raise FPImageException.Create('Failed to create handles'); then raise FPImageException.Create('Failed to create handles');