Hello,
solution for this is very simply, mu must get out lines
Code:
DXImageList.Items.Find('Rev').PatternHeight := DXImageList.Items.Find('Rev').Picture.Bitmap.Height;
DXImageList.Items.Find('Rev').PatternWidth := DXImageList.Items.Find('Rev').Picture.Bitmap.Width;
Why?
Because image is not meshed, it contain one image only! When you set up the PatternHeight and the PatternWidth property, the texture will be proceed as meshed and subimages can be stretched like code remaping subtexture via subpatterns.
And for code clearing is better like this
Code:
procedure TForm1.FormCreate(Sender: TObject);
var
Q: TPictureCollectionItem;
begin
{be sure color table}
DXImageList.Items.MakeColorTable;
DXDraw.ColorTable := DXImageList.Items.ColorTable;
DXDraw.DefColorTable := DXImageList.Items.ColorTable;
DXDraw.UpdatePalette;
{switch for easy change mode}
HardwareSwitch := False; {initialize, start in software mode}
{when changed can be call FormKeyDown with 'space' parameter}
//*******************
Q := TPictureCollectionItem(DXImageList.Items.Add);
Q.Name := 'montmelo';
Q.Picture.LoadFromFile(ExtractFilePath(ParamStr(0)) + 'montmelo.dib');
Q.Transparent := False;
Q := TPictureCollectionItem(DXImageList.Items.Add);
Q.Name := 'Rev';
Q.Picture.LoadFromFile(ExtractFilePath(ParamStr(0)) + 'Revoluciones.bmp');
Q.TransparentColor := DXDraw.Surface.ColorMatch(Q.Picture.Bitmap.Canvas.Pixels[0,Q.PatternHeight-1]);
Q.Transparent := True;
DXImageList.Items.Restore;
//*****************
end;
Regards
Bookmarks