惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
The Register - Security
The Register - Security
Hugging Face - Blog
Hugging Face - Blog
博客园 - 聂微东
GbyAI
GbyAI
Recent Commits to openclaw:main
Recent Commits to openclaw:main
博客园_首页
D
Docker
S
Security @ Cisco Blogs
K
Kaspersky official blog
爱范儿
爱范儿
Simon Willison's Weblog
Simon Willison's Weblog
TaoSecurity Blog
TaoSecurity Blog
V
V2EX
C
CXSECURITY Database RSS Feed - CXSecurity.com
T
Troy Hunt's Blog
Cloudbric
Cloudbric
博客园 - 三生石上(FineUI控件)
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
The Hacker News
The Hacker News
美团技术团队
S
SegmentFault 最新的问题
L
Lohrmann on Cybersecurity
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
宝玉的分享
宝玉的分享
The Last Watchdog
The Last Watchdog
Y
Y Combinator Blog
M
MIT News - Artificial intelligence
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Martin Fowler
Martin Fowler
Google Online Security Blog
Google Online Security Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
C
Cybersecurity and Infrastructure Security Agency CISA
T
Tor Project blog
Vercel News
Vercel News
The Cloudflare Blog
G
Google Developers Blog
T
Threat Research - Cisco Blogs
AI
AI
Stack Overflow Blog
Stack Overflow Blog
I
InfoQ
Scott Helme
Scott Helme
S
Schneier on Security
大猫的无限游戏
大猫的无限游戏
The GitHub Blog
The GitHub Blog
S
Securelist
IT之家
IT之家
Microsoft Azure Blog
Microsoft Azure Blog

博客园 - FilyCks

SQL动态条件查询例子 日期格式化函数 解决日志文件满造成的无法写入问题 数据库的日志文件 Delphi制作DLL SQLSERVER 日期函数及取当天数据 SQL语句导入导出大全 日期数据处理 按时间段统计数据(1) FastReport(5) FastReport(4) FastReport(3) FastReport(2) FastReport(1) 游标嵌套(个人笔记) FastReport 的初学感悟 查询表(个人笔记) 游标的一些例子 自己研究出来的第一个游标
图片转换和读取(个人笔记)
FilyCks · 2008-03-13 · via 博客园 - FilyCks

uses
Jpeg


procedure BitmapToJpeg(Bitmap: TBitmap; Jpg: TJPEGImage;
  Compress: Integer);
begin
  Jpg.Assign(Bitmap);
  if Compress>0 then
  begin
    Jpg.CompressionQuality:= Compress;
    Jpg.Compress;
  end;
end;


procedure JpegToBitmap(Jpg: TJPEGImage; Bitmap: TBitmap);
begin
  Bitmap.Width:= JPG.Width;
  Bitmap.Height:= JPG.Height;
  Bitmap.PixelFormat:= pf24bit;
  Bitmap.Canvas.Draw(0,0,JPG);
end;

var
  ms:TMemoryStream;
  jpg:TJPEGImage;
with ADOQuery3 do
    begin
      Close;
      SQL.Clear;
      SQL.Add('exec GetImage ''' + ADOQuery2.FieldByName('IDBName').AsString + ''',''' + ADOQuery2.FieldByName('IUID').AsString + '''');
      Open;
      if not IsEmpty then
      begin
        ms:= TMemoryStream.Create;
        jpg:= TJPEGImage.Create;
        try
          TBlobField(FieldByName('Image')).SaveToStream(ms);
          ms.Position:=0;
          jpg.LoadFromStream(ms);
          JpegToBitmap(jpg, Image1.Picture.Bitmap);
        finally
          ms.Free;
          jpg.Free;
        end;
      end;
      Close;
    end;