小编Pet*_*ate的帖子

如何配置Visual Studio 2008以使用IIS Express?

IIS快递常见问题指出:

您还可以从命令行手动启动IIS Express,并使用自定义Web服务器选项将其与Visual Studio 2008一起使用

如何配置"开始选项"以使其正常工作?

visual-studio-2008 iis-express

10
推荐指数
1
解决办法
8563
查看次数

如何确定.NET中Monitor的真实像素大小?

我想在我的应用程序中以"真实大小"显示图像.为此,我需要知道显示器的像素大小.

我知道Windows显示分辨率名义上是96dpi,但出于我的目的,我想要更好的猜测.我知道这些信息可能并不总是可用或准确的(例如较旧的CRT显示器),但我认为LCD显示器的前提是这应该是可能的!

有没有办法获得显示器的像素大小?

有没有办法确定像素大小是否准确?

.NET API是首选(我找不到它们),但Win32也行,我很高兴P/Invoke.

.net c# windows

9
推荐指数
1
解决办法
2万
查看次数

将Bitmap保存到MemoryStream的GDI +异常

我在Windows窗体应用程序中遇到问题,Bitmap.Save在保存到MemoryStream时失败.问题似乎只是间歇性地出现在一台机器上(到目前为止),而坏消息则出现在客户现场.我无法在机器上进行调试,但是我得到了一个堆栈跟踪,将问题缩小到一行代码.

这是我的代码的精简版本:

byte[] ConvertPixelsToBytes()
{
    // imagine a picture class that creates a 24 bbp image, and has
    // a method to get an unmanaged pixel buffer.
    // imagine it also has methods for getting the width,
    // height, pitch 

    // I suppose this line could return a bad address, but 
    // I would have expected that the Bitmap constructor would have 
    // failed if it was
    System.IntPtr pPixels = picture.GetPixelData();

    System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(
            picture.width(),
            picture.height(),
            picture.pitch(),
            System.Drawing.Imaging.PixelFormat.Format24bppRgb, …
Run Code Online (Sandbox Code Playgroud)

.net c# gdi+ winforms

3
推荐指数
1
解决办法
4887
查看次数

标签 统计

.net ×2

c# ×2

gdi+ ×1

iis-express ×1

visual-studio-2008 ×1

windows ×1

winforms ×1