{"id":4203,"date":"2016-09-08T15:57:54","date_gmt":"2016-09-08T07:57:54","guid":{"rendered":"http:\/\/blog.qdac.cc\/?p=4203"},"modified":"2016-09-08T15:57:54","modified_gmt":"2016-09-08T07:57:54","slug":"fmx%e4%bb%8e%e6%91%84%e5%83%8f%e5%a4%b4%e8%8e%b7%e5%8f%96%e7%85%a7%e7%89%87%e5%b9%b6%e8%bd%ac%e6%8d%a2%e4%b8%ba%e7%89%b9%e5%ae%9a%e7%9a%84%e6%a0%bc%e5%bc%8f","status":"publish","type":"post","link":"https:\/\/blog.qdac.cc\/?p=4203","title":{"rendered":"[FMX]\u4ece\u6444\u50cf\u5934\u83b7\u53d6\u7167\u7247\u5e76\u8f6c\u6362\u4e3a\u7279\u5b9a\u7684\u683c\u5f0f"},"content":{"rendered":"<p>\u9996\u5148\uff0c\u6211\u4eec\u8981\u4f7f\u7528 TTakePhotoFromCamera \u8fd9\u4e2a Action \u6765\u83b7\u53d6\u4e00\u5e45\u7167\u7247\uff0c\u5728\u5176 OnDidFinishTaking \u4e8b\u4ef6\u4e2d\uff0c\u53ef\u4ee5\u5f97\u5230\u4e00\u4e2a TBitmap \u7684\u56fe\u7247\u3002\u8fd9\u5757\u6211\u4eec\u8df3\u8fc7\u4ee3\u7801\u3002<\/p>\n<p>\u7136\u540e\uff0c\u6211\u4eec\u8981\u5c06\u8fd9\u4e2a\u4f4d\u56fe\u4fdd\u5b58\u4e3a\u6211\u4eec\u5e0c\u671b\u7684\u683c\u5f0f\uff0c\u5982JPEG\u3002\u9ed8\u8ba4\u8c03\u7528\u5b83\u7684 SaveToStream \u5b83\u4f1a\u4fdd\u5b58\u4e3a PNG \u683c\u5f0f\uff0c\u6211\u4eec\u73b0\u5728\u63d0\u4f9b\u4e00\u6bb5\u4fdd\u5b58\u4e3a JPEG \u683c\u5f0f\u7684\u4ee3\u7801\uff1a<\/p>\n<pre class=\"lang:delphi decode:true \">procedure SaveImage(ABitmap:TBitmap;AStream:TStream)\r\nvar\r\n   Surf:TBitmapSurface;\r\n   AParams:TBitmapCodecSaveParams;\r\nbegin\r\n  Surf:=TBitmapSurface.Create;\r\n  try\r\n     Surf.Assign(ABitmap);\r\n     AParams.Quality:=60;\/\/JPEG \u753b\u8d28\uff0c60% \u5728Photoshop\u4e2d\u662f\u4e2d\u7b49\u753b\u8d28\r\n     if not TBitmapCodecManager.SaveToStream(AStream,Surf,'.jpg',@AParams) then\r\n        raise EBitmapSavingFailed.Create('\u65e0\u6cd5\u4fdd\u5b58\u56fe\u7247\u4e3aJPG\u683c\u5f0f');\r\n  finally\r\n    Surf.DisposeOf;\r\n  end;\r\nend;<\/pre>\n<p>\u8fd9\u6837\u56fe\u7247\u5c31\u8f6c\u6362\u4e3a JPEG \u683c\u5f0f\uff0c\u4fdd\u5b58\u5230\u6d41\u4e2d\u4e86\u3002\u5176\u4e2d\u768460\u53ef\u4ee5\u6839\u636e\u9700\u8981\u8c03\u6574\u6210\u4f60\u9700\u8981\u7684\u54c1\u8d28\uff0c\u8d8a\u5927\u753b\u8d28\u8d8a\u597d\uff0c\u4e5f\u5c31\u8d8a\u5360\u5730\u65b9\uff0c\u81ea\u884c\u6743\u8861\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u9996\u5148\uff0c\u6211\u4eec\u8981\u4f7f\u7528 TTakePhotoF [&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":[145,69,8,603],"tags":[149,434,23,671,47],"class_list":["post-4203","post","type-post","status-publish","format-standard","hentry","category-android","category-c-builder","category-delphi","category-603","tag-fmx","tag-434","tag-23","tag-671","tag-47"],"views":10876,"_links":{"self":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/4203","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=4203"}],"version-history":[{"count":1,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/4203\/revisions"}],"predecessor-version":[{"id":4204,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/4203\/revisions\/4204"}],"wp:attachment":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4203"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4203"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4203"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}