【问题标题】:Setting a Bitmap in Windows 7 thumbnail preview在 Windows 7 缩略图预览中设置位图
【发布时间】:2009-10-10 15:27:43
【问题描述】:

我目前正在将Windows 7 API Code pack 用于我用 C# 编写的应用程序。 目前,我了解如何将部分 Window 区域或控件绘制到缩略图预览中:

TaskbarManager.Instance.TabbedThumbnail.SetThumbnailClip((new WindowInteropHelper(this)).Handle, new System.Drawing.Rectangle((int)v.X, (int)v.Y, (int)pictureBox1.RenderSize.Width, (int)pictureBox1.RenderSize.Height));

但是,我想将位图图像绘制到缩略图中。有一种方法,但没有很好地记录。设置位图i的方法:

System.Drawing.Bitmap bmptest = new System.Drawing.Bitmap(ms);
tb.SetImage(bmptest)

确实有效,但它仍然没有设置 (bmptest) 位图的缩略图预览。

我想知道这里是否有人对 Windows 7 API 代码包有深入了解,如果他们能指出我如何在缩略图预览中设置位图图像的正确方向。

【问题讨论】:

    标签: c# .net api windows-7 bitmap


    【解决方案1】:

    尝试先创建一个自定义的 TabbedThumbnail 并在缩略图上设置图像...

    Here 是一个如何创建自己的 TabbedThumbnail 的示例

    preview = new TabbedThumbnail(this, this, VisualTreeHelper.GetOffset(this));
    

    取自这篇文章!

    【讨论】:

      【解决方案2】:

      我从未使用过 Windows 7 API 代码包,但 Bitmap 类有一个 GetThumbnailImage(...) 方法,它可以满足您的需求。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2019-05-07
        • 1970-01-01
        • 2011-12-19
        • 1970-01-01
        • 2011-09-23
        • 2016-07-16
        • 1970-01-01
        • 2012-03-12
        相关资源
        最近更新 更多