Delphi / C ++ Builder / Lazarus报表开发:如何直接从代码中保存BPM / JPEG / TIFF / GIF?

2023-11-01

报表生成器FastReport VCL是用于在软件中集成商务智能的现代解决方案。它提供了可视化模板设计器,可以访问最受欢迎的数据源,报告引擎,预览,将过滤器导出为30多种格式,并可以部署到云,Web,电子邮件和打印中。

近日,FastReport VCL更新至v6.7,在新版本中,添加了对最新版本IDE的支持,简化了用于付款标准的条形码的创建,新增从预览窗口直接编辑RichView的功能,同时修复了多个Bug问题。欢迎下载体验。(下载最新版

我们先来看看有哪些光栅图像格式。

BMP

首先,你应该知道,由于BMP是一个老的图像格式,它不是很流行的互联网用户,只有位图图像保存在这种格式不支持向量。

bmp文件的大小可能不同,这取决于图像的质量。尽管用户认为BMP格式已经过时,但它在许多领域都被积极地使用。例如,所有的Windows界面都基于这种格式。为什么BMP呢?因为它是方便使用时,创建图像,不失去质量后,编辑他们。BMP是Photoshop中编辑图片时经常使用的格式,这种格式也很容易上传到社交网络和各种网站上。

当然,最好使用现代的图像格式,因为它们是多层次的,而且您可以将它们上传到任何网站而不存在技术问题。同时,有许多选项来编辑这些图像,它们有一个较小的文件大小。

JPEG

JPEG是存储图像的常用格式。它具有良好的压缩质量,可以观看图片。这种格式有很多好处,因为用户具有许多优点,例如:更改文件质量和大小的能力,在任何浏览器中轻松打开图像,在任何图形编辑器中编辑该文件以及较小的尺寸,在计算机和其他数据存储设备上不会占用太多空间。如果压缩不多,将完全保存图像质量。

这种格式有几个缺点:与PNG不同,没有透明度;如果压缩(调整大小)JPG图像,则其失真(或完全丢失)将非常明显;不建议在压缩后编辑恢复的JPG文件,因为它可能会降低质量。

尽管存在这些缺点,但该格式仍被认为是Internet上最受欢迎的格式,并且人们经常使用它。

TIFF

这是一种众所周知的栅格格式,几乎支持所有已知的色彩空间。未经压缩的图像几乎已成为印刷行业的标准。有多种压缩算法,甚至有或没有损失。TIFF文件可以包含以索引颜色模式以及灰度存储在CMYK,RGB,Lab颜色模型中的图像。这允许使用这种格式来存储各种图像,用于准备Web图形和版式。除图像本身外,TIFF还包含透明通道,通过它们可以保存图像的透明区域或在工作会话之间突出显示对象。

TIFF格式的另一个功能是能够将多个具有各自属性和属性(标签)的图像保存在一个文件中。尽管TIFF没有创建动画图像的功能,但这使其类似于GIF。这种格式的普及使得在程序和硬件平台之间轻松传输图像成为可能。

GIF

GIF文件尺寸较小,并且支持简单的动画,即在一个文件中更改帧。

GIF格式广泛用于创建横幅以及视频内容的图形外壳。主要优点是数据压缩在多达256色的深度处不会明显损失质量。动画图像包括许多静态帧以及有关帧演示所需时间的数据。

人们在许多领域中使用GIF格式。例如,在其网站的设计中,在社交网络上以广告标语,用于存储照片等形式在撰写文章或书籍时进行网页设计,图形设计。使用这种格式,您可以减小图像的大小,这会积极影响Internet网站页面的加载速度。

SVG

这种格式是矢量。简而言之,网站是在其帮助下进行编译的。SVG是带有标签的XML文本文件。缩放和裁剪时,这种格式不会丢失图像质量

现在我们知道什么时候使用哪种格式更好。

如何从Delphi / Lazarus应用程序导出为这些格式?

首先,我们必须创建一个文档。

然后,在我们创建了想要变成插图的对象之后,启动并查看。

在预览窗口中,我们选择保存报告的格式。 例如,我们需要导出到BMP图像。选择并单击。

可视化报告生成器FastReport VCL功能指南:从Delphi / C ++ Builder / Lazarus保存图像

将出现导出设置窗口。配置并保存。

可视化报告生成器FastReport VCL功能指南:从Delphi / C ++ Builder / Lazarus保存图像

如何直接从Delphi / C ++ Builder / Lazarus代码中保存BPM / JPEG / TIFF / GIF?

保存为BMP

procedure TForm1.Button1Click(Sender: TObject);
begin
 {Generate a report. The report must be generated before exporting}
 frxReport1.PrepareReport();
 {Set the range of pages to export. By default, all pages of the generated report are exported}
 frxBMPExport1.PageNumbers := '2-3';
 {Set whether to export each page to a separate file.}
 {.N will be added to the file name, where N is the serial number of the page}
 frxBMPExport1.SeparateFiles := True;
 {Set whether to export to monochrome image}
 frxBMPExport1.Monochrome := False;
 {Set whether to crop empty edges (page margins)}
 frxBMPExport1.CropImages := False;
 {Set the resolution, DPI}
 frxBMPExport1.Resolution := 96;
 {Set whether to open the resulting file after export}
 frxBMPExport1.OpenAfterExport := False;
 {Set whether to display export progress (show which page is currently being exported)}
 frxBMPExport1.ShowProgress := False;
 {Set whether to display the export filter dialog box}
 frxBMPExport1.ShowDialog := False;
 {Set the name of the resulting file.}
 {Please note that if you do not set the file name and disable the export filter dialog box,}
 {the file name selection dialog will still be displayed}
 frxBMPExport1.FileName := 'C:\Output\test.bmp';
 {Export the report}
 frxReport1.Export(frxBMPExport1);
end;

保存为JPEG

procedure TForm1.Button2Click(Sender: TObject);
begin
 {Generate a report. The report must be generated before exporting}
 frxReport1.PrepareReport();
 {Set the range of pages to export. By default, all pages of the generated report are exported}
 frxJPEGExport1.PageNumbers := '2-3';
 {Set whether to export each page to a separate file.}
 {.N will be added to the file name, where N is the serial number of the page}
 frxJPEGExport1.SeparateFiles := True;
 {Set whether to export to monochrome image}
 frxJPEGExport1.Monochrome := False;
 {Set whether to crop empty edges (page margins)}
 frxJPEGExport1.CropImages := False;
 {Set the quality of JPEG}
 frxJPEGExport1.JPEGQuality := 90;
 {Set the resolution, DPI}
 frxJPEGExport1.Resolution := 96;
 {Set whether to open the resulting file after export}
 frxJPEGExport1.OpenAfterExport := False;
 {Set whether to display export progress (show which page is currently being exported)}
 frxJPEGExport1.ShowProgress := False;
 {Set whether to display the export filter dialog box}
 frxJPEGExport1.ShowDialog := False;
 {Set the name of the resulting file.}
 {Please note that if you do not set the file name and disable the export filter dialog box,}
 {the file name selection dialog will still be displayed}
 frxJPEGExport1.FileName := 'C:\Output\test.jpg';
 {Export the report}
 frxReport1.Export(frxJPEGExport1);
end;

保存为TIFF

procedure TForm1.Button3Click(Sender: TObject);
begin
 {Generate a report. The report must be generated before exporting}
 frxReport1.PrepareReport();
 {Set the range of pages to export. By default, all pages of the generated report are exported}
 frxTIFFExport1.PageNumbers := '2-3';
 {Set whether to export each page to a separate file.}
 {.N will be added to the file name, where N is the serial number of the page}
 frxTIFFExport1.SeparateFiles := True;
 {Set whether to export to monochrome image}
 frxTIFFExport1.Monochrome := False;
 {Set whether to crop empty edges (page margins)}
 frxTIFFExport1.CropImages := False;
 {Set the resolution, DPI}
 frxTIFFExport1.Resolution := 96;
 {Set whether to open the resulting file after export}
 frxTIFFExport1.OpenAfterExport := False;
 {Set whether to display export progress (show which page is currently being exported)}
 frxTIFFExport1.ShowProgress := False;
 {Set whether to display the export filter dialog box}
 frxTIFFExport1.ShowDialog := False;
 {Set the name of the resulting file.}
 {Please note that if you do not set the file name and disable the export filter dialog box,}
 {the file name selection dialog will still be displayed}
 frxTIFFExport1.FileName := 'C:\Output\test.tif';
 {Export the report}
 frxReport1.Export(frxTIFFExport1);
end;

保存为GIF

procedure TForm1.Button4Click(Sender: TObject);
begin
 {Generate a report. The report must be generated before exporting}
 frxReport1.PrepareReport();
 {Set the range of pages to export. By default, all pages of the generated report are exported}
 frxGIFExport1.PageNumbers := '2-3';
 {Set whether to export each page to a separate file.}
 {.N will be added to the file name, where N is the serial number of the page}
 frxGIFExport1.SeparateFiles := True;
 {Set whether to export to monochrome image}
 frxGIFExport1.Monochrome := False;
 {Set whether to crop empty edges (page margins)}
 frxGIFExport1.CropImages := False;
 {Set the resolution, DPI}
 frxGIFExport1.Resolution := 96;
 {Set whether to open the resulting file after export}
 frxGIFExport1.OpenAfterExport := False;
 {Set whether to display export progress (show which page is currently being exported)}
 frxGIFExport1.ShowProgress := False;
 {Set whether to display the export filter dialog box}
 frxGIFExport1.ShowDialog := False;
 {Set the name of the resulting file.}
 {Please note that if you do not set the file name and disable the export filter dialog box,}
 {the file name selection dialog will still be displayed}
 frxGIFExport1.FileName := 'C:\Output\test.gif';
 {Export the report}
 frxReport1.Export(frxGIFExport1);
end;

如果您有任何疑问或需求,请随时加入FastReport技术交流群(783996712),我们很高兴为您提供查询和咨询。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Delphi / C ++ Builder / Lazarus报表开发:如何直接从代码中保存BPM / JPEG / TIFF / GIF? 的相关文章

  • global::System.Runtime.Versioning.TargetFrameworkAttribute 特性重复问题处理

    今天编译程序遇到global System Runtime Versioning TargetFrameworkAttribute 特性重复错误 原因是编译时生成的 NETFramework Version v4 6 1 AssemblyA
  • jsvc

    boltapp localhost apphome home boltapp apphome jsvc help Usage jsvc options class args Where options include help help s
  • Httpservletrequest与Httpservletresponse

    目录 一 Httpservletrequest 1 1什么是Httpservletrequest 1 2Httpservletrequest中的方法 二 Httpservletresponse 1 1什么是Httpservletrespon
  • windows下搭建编译chromium的开发环境

    本篇为windows下搭建编译chromium的方法 mac篇 mac下搭建编译chromium的开发环境 二七 CSDN博客 linux篇 linux 搭建和编译 chromium 环境 二七 CSDN博客 注意 搭建部署chromium
  • 如何在Tlistview中基于subitem[x]排序

    如何排序tlistview数据存在于subitem x Set SortType stData和写 procedure TForm1 ListView1Compare Sender TObject Item1 Item2 TListItem
  • 求VCL工具栏布局图设计

    我正在寻找 C 构建器的 VCL 组件 它最好有一个具有拖放功能的工具栏 我想定义一个建筑物或区域 可能不是矩形 并将其分成 房间 或区域 或任何你想称呼它们的东西 我希望能够将 门口 或通道等 从一个房间放入其邻居中 有这样的事吗 最好是
  • Delphi非可视化TTree实现

    我正在寻找一种非可视持久树 TStringTree 实现 如果有人知道它的任何良好实施 请告诉我 Thanks 你会发现一个灵活的 非可视化的树结构DI 容器图书馆 商业 然而 正如其他人上面所指出的 开发自己的功能确实非常容易 只需添加您
  • C 语言教程:数据类型和格式说明符

    C 语言中的数据类型 C 中的变量必须是指定的 数据类型 并且您必须在 printf 函数中使用 格式说明符 来显示它 创建变量 int myNum 5 整数 没有小数点 float myFloatNum 5 99 浮点数 char myL
  • 如何允许在 Delphi 中拖动特定控件的文件

    我想在有人将文件放到特定控件 例如 TMemo 时立即接受文件 我从这个例子开始 http delphi about com od windowsshellapi a accept filedrop htm http delphi abou
  • C 语言运算符详解

    C 语言中的运算符 运算符用于对变量和值进行操作 在下面的示例中 我们使用 运算符将两个值相加 int myNum 100 50 虽然 运算符通常用于将两个值相加 就像上面的示例一样 它还可以用于将变量和值相加 或者将变量和另一个变量相加
  • Python 元组完全指南 1

    元组用于在单个变量中存储多个项目 mytuple apple banana cherry 元组是 Python 中的 4 种内置数据类型之一 用于存储数据集合 另外还有列表 集合和字典 它们都具有不同的特性和用途 元组是有序且不可更改的集合
  • 在Thread中使用EnterCriticalSection更新VCL标签

    我是线程新手 我正在使用一个第三方库 该库使用线程 有时会调用我提供的过程 当线程调用我的过程时 如何更新 TLabel Caption 如果我在其他地方调用了InitializeCriticalSection 它是否像 EnterCrit
  • 如何“扫描”当前安装的 VCL 组件的完整列表

    我还没有找到真正满意的答案这个问题 https stackoverflow com questions 691989 full vcl class browser for delphi 现在正在考虑推出自己的 我有 ModelMaker 和
  • 将一个 TForm 嵌入另一个 TForm 时如何避免出现问题?

    我经常嵌入一个TForm后代成为另一个TForm后代是这样的 var Form1 TForm1 Form2 TForm2 begin Form2 Parent Form1 Form2 BorderStyle bsNone Form2 Ali
  • DevExpress Web Report Designer中文教程 - 如何自定义控件和表达式注册?

    获取DevExpress v23 2正式版下载 Q技术交流 909157416 自定义控件集成 DevExpress Reports中的自定义报表控件注册变得更加容易 为了满足web开发人员的需求 DevExpressv23 1 包括简化的
  • 如何从代码中获取 ComboBox 的 SelectedValue?

    我正在尝试构建类似的东西TLookupComboBox使用LiveBindings 我已经放置了一个普通的TComboBox在 VCL 形式上 我还有一个数据集 其中一些行具有两个字段id and text 然后我使用 LiveBindin
  • 如何将 TWSocket 的 OnDataAvailable() 事件推送到 Delphi 6 应用程序中的后台线程?

    我有一个 Delphi 6 应用程序 它使用 ICS 组件套件进行套接字通信 我有自己的服务器套接字 VCL 组件 当新会话可用时 它会创建客户端 TWSocket 套接字 我创建的客户端套接字确实将 Multithreaded 属性设置为
  • 有 Delphi XE2 样式库吗?

    在 XE2 中 有一个新函数 styles 用于 VCL vsf 和 Firemonkey styles 有些是在C Program Files Embarcadero RAD Studio 9 0 Redist styles目录 创建新样
  • Delphi 窗体在显示时总是会触发 OnResize 吗?

    如果我创建一个新的 Delphi 表单 挂钩其 OnResize 事件并运行该应用程序 则在显示窗口之前会触发 OnResize 我不知道对于任何窗口来说 这种情况是否总是会发生 对于熟悉 Windows API 的人来说 我已将其追溯到
  • TColorProperty德尔福柏林10.1.2?

    我正在尝试将组件从 Delphi 7 转换为 Delphi Berlin 平面组件 https sourceforge net projects flatstyle https sourceforge net projects flatst

随机推荐

  • 完整LUT解释说明

    什么是LUT 我们业内在LUT的应用方面有着许多混乱的认识 很多人会把LUT看成是一种 黑魔法 然而实际上它们是再正常不过的东西 因此为了帮助大家了解LUT的定义和工作原理 本文将会尽可能详细地为大家讲述LUT以及它的应用 包括用于校准的技
  • 简介JSONObject的各种用法

    1 java对象转化成String String s JSONObject toJSONString javaObject class 2 java对象转化成Object Object str JSONObject toJSON javaO
  • SW-3配置文件

    CS6200 28X EI config hos SW 3 SW 3 config vlan 10 SW 3 config vlan10 name FB YX SW 3 config vlan10 vlan 20 SW 3 config v
  • 树莓派Raspbian Buster/Debian 10 安装ROS

    目录 一些补充 安装ROS 初始化rosdep 测试 平台 树莓派4B 系统版本 2020 05 27 raspios buster arm64 img 一些补充 系统安装参考 树莓派学习笔记 一 烧录系统 无屏幕 配置Wifi和SSH服务
  • QT 元对象解析 及和其他语言区别

    说Qt信号与槽是一个很好机制 不如说Qt的元对象系统很强大 这也是大家讲Qt就必须将信号与槽 讲信号与槽就要讲Qt的元对象系统 当然初学者知道怎么用就OK啦 当然随着你写的代码越多 接触的平台越多的时候 你就会好奇Qt是如何把两个 多个 任
  • Java程序——检索文件(含内容)

    项目说明 给定一个指定目录和关键字 扫描其中的文件名和文件内容 找到包含关键字的文件 完整代码 import java io File import java io FileInputStream import java io IOExce
  • 利用find命令进行批量操作

    前些天 我要把Linux上的几千个txt文档进行转码 需要用到iconv命令 可是我总不能 一个一个的去敲 文档转码命令 iconv f GBK t UTF 8 file1 o file2 将file1从GBK转为UTF 8 并输出为fil
  • Wireshark抓包体验

    1 嗅探器原理 嗅探技术是网络安全攻防技术中很重要的一种 通过它可以获取网络中的大量信息 与主动扫描相比 嗅探更难以被察觉 能够对网络中的活动进行实时监控 网络嗅探器实际上就是网络中的窃听器 其用途就是捕获分析网络中的数据包 帮助网络管理员
  • CMake方式配置PCL+VS开发环境

    PCL VS安装配置其他方式看下面博客 本文链接 win10 vs2019 pcl1 11 0安装教程 a zhua66的博客 CSDN博客 win10 安装pcl 考虑到配置属性表 xxx props 非常麻烦繁琐 换设备又得重新选择PC
  • 电源设计问题

    目录 一 电源器件 1 法拉电容 二 充电规则 1 充电限制 2 充电时间计算 三 有线充电 四 无线充电 一 电源器件 1 法拉电容 超级电容具有功率密度高 充放电时间短 循环寿命长 工作温度范围宽等显著的优点 适合应用在大功率能量流动的
  • 南京大学《软件分析》笔记01 - 静态分析的基本概念

    Rice s Theorem Any non trivial property of the behavior of programs in a r e language is undecidable r e recursively enu
  • 顺序表初始化

    文章目录 1 顺序表 2 顺序表的初始化 1 顺序表 顺序表 顺序存储结构 存储数据时 会提前申请一整块足够大小的物理空间 然后将数据依次存储到一整块连续的存储空间内 存储时做到数据元素之间不留一丝缝隙 使用顺序表存储集合 1 2 3 4
  • Cheat Engine 教程( 1 - 9 通关 )

    工具包 https down 52pojie cn Tools Debuggers Cheat Engine 官网 https www cheatengine org Cheat Engine v7 5 汉化 https pan aoe t
  • FPGA project : inf_rcv

    module top input wire sys clk input wire sys rst n input wire inf in output wire led output wire ds output wire oe outpu
  • 获取数组的所有子序列

    一个包含n个元素的集合 获取其所有子集 可以采用按位对应法 例如 int array 1 3 2 5 这个集合可以看做1325四位 每一位在子集中要么存在要么不存在 是否的操作我们就考虑二进制的01 一位子序列的情况有 1000 0100
  • 大数据的分布式SQL查询引擎 -- Presto的详细使用

    Presto Distributed SQL Query Engine for Big Data 官网 项目源码 官方文档 目录 1 Presto 概述 2 概念 2 1 服务进程 2 2 数据源 2 3 查询执行模型 3 整体架构 4 P
  • 2.4 【LaTex】数论符号

    文章目录 同余 向下取整 向上取整 整除 进制 对数 数论的文章 写的人是蛮少的 因为数论好像已经成为民科专用数学 因为数论门槛低 上限高 研究成本低 很多问题至今未解决 所以成为了民科首选 在这篇文章 我不可能介绍所有数论使用的符号 所以
  • 查看gcc/g++默认include路径

    转自 http gcc gnu org ml gcc help 2007 09 msg00205 html gcc print prog name cc1plus v g print prog name cc1plus v 例如 CentO
  • 新安装Android Studio创建项目失败解决方法

    一 梗概 第一次安装Android Studio的时候 因为被墙等原因 Gradle总是出错导一直构建不了项目 Failed to open zip file Gradle s dependency cache may be corrupt
  • Delphi / C ++ Builder / Lazarus报表开发:如何直接从代码中保存BPM / JPEG / TIFF / GIF?

    报表生成器FastReport VCL是用于在软件中集成商务智能的现代解决方案 它提供了可视化模板设计器 可以访问最受欢迎的数据源 报告引擎 预览 将过滤器导出为30多种格式 并可以部署到云 Web 电子邮件和打印中 近日 FastRepo