Hallo
Ich habe gerade angefangen ein Programm zu schreiben, welches Gifs in Sprites umwandeln soll, ist auch schon fast fertig, jedoch bekomme ich die Gif-Frames nicht in meine Bitmap kopiert, zuerst habe ich es mit Draw probiert und jetzt mit BitBlt, aber das Bild bleibt weiß, warum ?
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31:
| procedure TForm1.SpeedButton3Click(Sender: TObject); var GIF: TGifImage; BMP: TBitmap; FrameInfo: TFrameInfo; nstr: string; i, w: integer; begin GIF := TGifImage.Create(nil); BMP := TBitmap.Create; BMP_Path := edit2.text; try if GIF.loadfromFile(GIF_Path) then begin BMP.Height := Gif.ImageHeight; BMP.Width := Gif.ImageWidth * Gif.NumFrames; for i := 1 to Gif.NumFrames do begin FrameInfo := GIF.GetFrameInfo(i); BitBlt(BMP.Canvas.Handle, i * Gif.ImageWidth - Gif.ImageWidth, 0, Gif.ImageWidth, Gif.ImageHeight, FrameInfo.iiImage.Handle, 0, 0, SRCCopy); end; nstr := ExtractFilename(Gif_Path); delete(nstr, pos('.gif', nstr) + 1, 3); nstr := nstr + 'bmp'; BMP.SaveToFile(BMP_Path + nstr); end; finally Gif.Free; Bmp.Free; end; end; |