Tag: image

.NET TIFF文件:没有第三方库可以转换RGB到CMYK吗?

继我之前的问题:是否以及如何使用基于RGB的TIFF文件并将其转换为具有标准.NET(3.5)function的CMYK? 这有可能吗?

具有自动记忆清洁function的图像下载器

我有一个列表(简单ListBox)的项目与主要细节基础上的图像(如果用户点击列表项,详细信息页面打开)。 我在这里 , 这里 , 这里和这里描述了图像内存泄漏的相当着名的问题。 一种可能的方法是在NavigatingFrom 和清理它们时浏览所有图像 。 在其中一个线程中 ,我找到了更有趣的解决方案:它自动清理图像,但这不适用于虚拟化(图像丢失或混合,如果添加私有字段用于存储ImageSource)。 建议的解决方法是添加依赖项属性。 但是我仍然面临同样的问题:图像在向下滚动并返回后混淆了。 看起来依赖属性是随机改变的,但我不能抓住他们改变的那一刻。 public class SafePicture : ContentControl { public static readonly DependencyProperty SafePathProperty = DependencyProperty.RegisterAttached( “SafePath”, typeof(string), typeof(SafePicture), new PropertyMetadata(OnSourceWithCustomRefererChanged)); public string SafePath { get { return (string)GetValue(SafePathProperty); } set { SetValue(SafePathProperty, value); } } private static void OnSourceWithCustomRefererChanged(DependencyObject o, DependencyPropertyChangedEventArgs e) { […]

如何在虚拟模式下显示所有列表视图项目上的图标(C#)

我正在使用listview的虚拟模式来显示大数据。 但我不知道如何显示每个项目的图像。 谁能帮我 ? 我写 private void ListContact_RetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e) { MyContact contact = ContactData.GetMyContact(e.ItemIndex); if (e.Item == null) e.Item = new ListViewItem(contact.ToString()); if (contact.Photo != null) { e.Item.ImageList.Images.Add(“” + contact.Id, contact.Photo); e.Item.ImageKey = “” + contact.Id; } else { e.Item.ImageKey = “default”; } } 但它无法正常工作

C#GDI +图像resizefunction

所以我的逻辑存在缺陷,我需要一种更好,更正确的方法来调整c#app中的图像大小 我需要一个类似于这个设置的function public void ResizeImageForWeb(string OriginalFile, string NewFile, int MaxWidth, int MaxHeight, int Quality) { // Resize Code } 基本上,我是一个网页设计师,试图编写桌面应用程序。

使用C#在dataGridView中显示位图

我想在dataGridView中显示一些图像。 我有两个组件,dataGridView,dataTable和一个Bitmap。 DataTable有两列。 dataGridview.source = dataTable; 现在,我想在dataGridView中显示三列,两列来自dataTable,新的三列来自我的位图。 如果它更容易,我可以修改dataTable和dataGridView。 有可能吗?

如何在C#中使用imageMagick

你能解释一下我如何在C#中使用ImageMagick吗? 我正在尝试将PDF转换为页面到图像。 我想运行imageMagick命令“convert -density 300 $ input.pdf $ output.png”

如何从网上下载和保存图像?

我正在尝试制作一个Windows Phone 7应用程序,它将从网络上保存一些图像,我不知道我可以在哪里,或者我是否可以将图像从网络保存到手机。 我该怎么做才能保存图像?

使用C#从BitmapData裁剪区域

我有一个位图sourceImage.bmp 锁定它的位: BitmapData dataOriginal = sourceImage.LockBits(new Rectangle(0, 0, sourceImage.Width, sourceImage.Height), ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb); 做分析, 得到一个克隆 : Bitmap originalClone = AForge.Imaging.Image.Clone(dataOriginal); 解锁位: sourceImage.UnlockBits(dataOriginal); 是否可以指定要复制的“dataOriginal”的哪一部分(x,y,w,h)? 或者从dataOriginal创建新数据,指定X和Y坐标以及H和W? 目的是从该图像中复制一个小区域。 这个方法可能比DrawImage更快,这就是我不使用后者的原因。 编辑: 所以我拿了29 Mb位图并进行了一些硬核测试! 全尺寸裁剪(基本上是副本)+ 100次迭代。 码: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using AForge; using AForge.Imaging; using System.Diagnostics; using System.Drawing.Imaging; […]

为什么调整png图像的大小会失去透明度?

我正在尝试按如下方式调整图像大小。 我将resize的图像返回到byte[]以便我可以将其存储在数据库中。 png图像的透明度丢失了。 请帮助改善这一点。 private byte[] GetThumbNail(string imageFile, Stream imageStream, int imageLen) { try { Image.GetThumbnailImageAbort imageCallBack = new Image.GetThumbnailImageAbort(ThumbnailCallback); Bitmap getBitmap = new Bitmap(imageFile); byte[] returnByte = new byte[imageLen]; Image getThumbnail = getBitmap.GetThumbnailImage(160, 59, imageCallBack, IntPtr.Zero); using (Graphics g = Graphics.FromImage(getThumbnail)) { g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias; g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic; g.DrawImage(getThumbnail, 0, 0, 160, 59); } […]

.net中的PNG压缩

我想将位图压缩为具有不同压缩级别的PNG,因为这些级别在C#中的JPEG压缩中可用。 我有20到30张不同尺寸的图像,可在1秒内处理。 是否有任何库可以在不同压缩级别的PNG中实现此压缩?