{"id":3005,"date":"2015-11-07T19:51:29","date_gmt":"2015-11-07T11:51:29","guid":{"rendered":"http:\/\/blog.qdac.cc\/?p=3005"},"modified":"2015-11-07T19:51:41","modified_gmt":"2015-11-07T11:51:41","slug":"%e6%9d%82%e8%b0%88-%e5%9c%a8-delphic-builder-%e4%b8%ad%e5%88%9b%e5%bb%ba%e6%97%a0%e9%99%90%e5%be%aa%e7%8e%af%e7%9a%84-gif-%e5%8a%a8%e7%94%bb","status":"publish","type":"post","link":"https:\/\/blog.qdac.cc\/?p=3005","title":{"rendered":"[\u6742\u8c08] \u5728 Delphi\/C++ Builder \u4e2d\u521b\u5efa\u65e0\u9650\u5faa\u73af\u7684 GIF \u52a8\u753b"},"content":{"rendered":"<p>\u9996\u5148\u662f\u770b\u4ee3\u7801\uff1a<\/p>\n<pre class=\"lang:delphi decode:true \">var\r\n  AGif: TGifImage;\r\n  ABitmap: TBitmap;\r\n  i: Integer;\r\n  ALoopExt:TGIFAppExtNSLoop;\r\nbegin\r\n  AGif := TGifImage.Create;\r\n  AGif.SetSize(100, 100);\r\n  ABitmap := TBitmap.Create;\r\n  ABitmap.SetSize(100, 100);\r\n  for i := 9 downto 0 do\r\n  begin\r\n    ABitmap.Canvas.FillRect(Rect(0, 0, 100, 100));\r\n    ABitmap.Canvas.TextOut(i * 10, 30, IntToStr(i));\r\n    if i = 9 then\r\n      TGIFAppExtNSLoop.Create(AGif.Add(ABitmap))\r\n    else\r\n      AGif.Add(ABitmap);\r\n  end;\r\n  AGif.AnimationSpeed := 100;\r\n  Image1.Picture.Assign(AGif);\r\n  TGifImage(Image1.Picture.Graphic).Animate := true;\r\n  FreeAndNil(ABitmap);\r\n  FreeAndNil(AGif);\r\nend;<\/pre>\n<p>\u8fd9\u6bb5\u4ee3\u7801\u5b9e\u73b0\u7684\u662f\u7ed8\u5236\u4e86\u4e00\u4e2a\u4ece\u53f3\u5230\u5de6\u7684\uff0c\u4ece 9 \u53d8\u5230 0 \u7684\u5c0f\u52a8\u753b\uff0c\u52a8\u753b\u6bcf\u5e27\u95f4\u9694\u4e3a 100ms\uff0c\u6211\u4eec\u7528\u4e00\u4e2a TImage \u7684\u5b9e\u4f8b Image1 \u6765\u663e\u793a\u3002<\/p>\n<p>\u8fd9\u91cc\uff0c\u6709\u4e00\u4e2a\u5173\u952e\u7684\u5730\u65b9\uff0c\u662f\u4e3a\u52a8\u753b\u6dfb\u52a0 TGIFAppExtNSLoop \u6269\u5c55\uff0c\u5982\u679c\u4e0d\u8bbe\u7f6e\uff0c\u52a8\u753b\u5c06\u53ea\u64ad\u653e\u4e00\u6b21\u5c31\u505c\u4e86\u3002\u6dfb\u52a0\u6269\u5c55\u540e\uff0c\u8fd9\u4e2a\u52a8\u753b\u5c31\u53ef\u4ee5\u65e0\u9650\u5faa\u73af\u4e0b\u53bb\u6216\u8005\u5faa\u73af\u6307\u5b9a\u7684\u6b21\u6570\uff08\u901a\u8fc7\u8bbe\u7f6e TGIFAppExtNSLoop \u7684 Loops \u5c5e\u6027\uff09\u3002<\/p>\n<p>\u8fd9\u91cc\u6709\u4e00\u4e2a\u95ee\u9898\uff0c\u5c31\u662f TGIFImage \u00a0\u6bcf\u5e27\u7684\u95f4\u9694\u65f6\u95f4\u662f\u56fa\u5b9a\u7684\uff0c\u6211\u6ca1\u770b\u5230\u5728\u90a3\u513f\u80fd\u591f\u8bbe\u7f6e\u975e\u5300\u901f\u7684 GIF \u52a8\u753b\u3002\u5982\u679c\u4f60\u77e5\u9053\uff0c\u6b22\u8fce\u4e00\u8d77\u4ea4\u6d41\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u9996\u5148\u662f\u770b\u4ee3\u7801\uff1a var AGif: TG [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[69,8,9,21],"tags":[482,483],"class_list":["post-3005","post","type-post","status-publish","format-standard","hentry","category-c-builder","category-delphi","category-qdac","category-misc","tag-gif","tag-483"],"views":11143,"_links":{"self":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/3005","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3005"}],"version-history":[{"count":2,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/3005\/revisions"}],"predecessor-version":[{"id":3007,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/3005\/revisions\/3007"}],"wp:attachment":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3005"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3005"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3005"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}