创建BMP屏幕截图并保存为8pp灰度

时间:2013-10-06 19:52:36

标签: vb.net

我在尝试完成这项任务时遇到了很多问题。我知道如何创建截图并将其保存为位图....

    Dim printscreen As New Bitmap(thewidth, theheight, PixelFormat.Format24bppRgb)
    Dim xscreenshot As Graphics = Graphics.FromImage(printscreen)
    Dim theTest As New Size(thewidth, theheight)

    Dim theXLoc As String = "200"
    Dim theYLoc As String = "200"

    xscreenshot.CopyFromScreen(theXLoc, theYLoc, 0, 0, theTest)

    printscreen.Save("C:\Temp\printscreen.bmp", ImageFormat.MemoryBmp)

然而,当你拉出Pixelformat的选项时。没有选项可以保存在8pp。我真的想这样做,因为我一直在使用AFORGE.Imaging库进行图像比较,为了比较灰度图像,它们必须是8pp格式。

0 个答案:

没有答案