简体   繁体   English

Delphi-使用透明度和索引调整PNG大小

[英]Delphi - Resize PNG with transparence and index

I have many PNG files with transparency and these PNG fiels seem to be indexed. 我有许多透明的PNG文件,这些PNG文件似乎已被索引。 I would like to : 我想要 :

  • Put 2 identical PNG side to side with a space between both 将2个相同的PNG并排放置,两者之间留有间隔
  • Resize the result with a smooth resize filter (or Mitchell, Linear, Spline or other) 使用平滑的调整大小滤镜(或Mitchell,Linear,Spline或其他)调整结果的大小
  • Keep transparency and originals colors 保持透明度和原件颜色

Do you have an example to do that ? 你有一个例子可以做到吗?

This question is related to other PNG resize questions but... 这个问题与其他PNG调整大小问题有关,但是...

AFAIK, You can't resize an indexed image and keep the original palette. AFAIK,您无法调整索引图像的大小并保留原始调色板。 Resizing the image will necessitate the mixing of colors, especially in reducing the image. 调整图像大小将需要混合颜色,特别是在缩小图像时。

The original author of the PNGImage component (the basis of the Delphi native component) had a forum where he, and others, posted code snippets on how to do things using the PNGImage component. PNGImage组件的原始作者(Delphi本机组件的基础)在一个论坛上,他和其他人发布了有关如何使用PNGImage组件执行操作的代码段。

Before the forum was taken down I grabbed a copy of all of the code snippets and placed them on the CodeGear Code Central website. 在取消论坛之前,我抓取了所有代码片段的副本,并将其放在CodeGear Code Central网站上。

Most if not all of these work with native PNG images and do maintain the Alpha channel. 所有这些(如果不是全部的话)大多数都可以与本地PNG图像一起使用,并且可以维护Alpha通道。

Here is the complete list of examples included in the package: 这是软件包中包含的示例的完整列表:

  • Smooth rotates a PNG object 平滑旋转PNG对象
  • Resizes a TPNGObject using a smooth algorithm 使用平滑算法调整TPNGObject的大小
  • Slice one PNG into several smaller ones 将一个PNG切成几个较小的PNG
  • Saves an image as either a bitmap or a png. 将图像另存为位图或png。
  • Sample chunk descendant 样本块后代
  • Read all tEXt-Chunks and write values into a TStrings object 读取所有tEXt-Chunk并将值写入TStrings对象
  • Display a message box with information extracted from the PNG File 显示一个消息框,其中包含从PNG文件中提取的信息
  • Finds and cuts a block from a PNG image 从PNG图像中查找并剪切一个块
  • This method converts the png into a jpeg object 此方法将png转换为jpeg对象
  • This method converts the png into a bmp object 此方法将png转换为bmp对象
  • Overlay one PNG over another (This makes the image half transparent) 将一个PNG覆盖在另一个PNG上(这会使图像半透明)
  • Flips a png image vertically and saves back 垂直翻转png图像并保存回来
  • Draws a png image over the desktop 在桌面上绘制png图像

Here is the link: CodeCentral PNG Methods 这里是链接: CodeCentral PNG方法

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM