What are the fastest GDI+ rendering settings?

There is quite a lot of post about rendering high quality graphics, like this one High Quality Image Scaling Library I need to render about 6k+ object (line and ellipse) in a graphics with GDI+, at a framerate of around 10fps. So I need the lowest quality property possible for my graphics. Here is what I have done : public static class GraphicsExtensions { public static void ToHighQua

什么是最快的GDI +渲染设置?

有很多关于渲染高质量图形的文章,比如这个 高质量图像缩放库 我需要在GDI +的图形中渲染约6k +对象(线条和椭圆),帧率为10fps左右。 所以我需要我的图形可能的最低质量的财产。 这是我所做的: public static class GraphicsExtensions { public static void ToHighQuality(this Graphics graphics) { graphics.InterpolationMode = InterpolationMode.HighQualityBicubic; graphics.Composit

how to get .bak extension while creating backup in 3 tier project

while click the backup btn it opened a savefiledialog box but i couldnt find .bak extension at save as type code: private void backupdb_Load(object sender, EventArgs e) { label4.Visible = false; DataSet ds = SqlGetData.GetData1("select srvname from sysservers where srvproduct='SQL Server'"); for (int m = 0; m < ds.Tables[0].Rows.Count; m++) { cbserver.

如何在创建3层项目备份时获得.bak扩展名

点击备份btn它打开一个savefiledialog框但我找不到.bak扩展名保存为类型代码:private void backupdb_Load(object sender,EventArgs e) {label4.Visible = false; DataSet ds = SqlGetData.GetData1("select srvname from sysservers where srvproduct='SQL Server'"); for (int m = 0; m < ds.Tables[0].Rows.Count; m++) { cbserver.Items.Add(ds.Tables[0].Rows[0][m].ToStri

Why can't I see any selected items?

I try to do somthing when the user select item in the ListView. I have tried this code: private void listView1_SelectedIndexChanged(object sender, EventArgs e) { q = listView1.SelectedItems[0].Index; } but it doesn't work and throws an exception that says that the count of 'listView1.SelectedItems' is 0. Why doesn't it work? Always check for the

为什么我看不到任何选定的项目?

我尝试在用户在ListView中选择项目时做某事。 我试过这段代码: private void listView1_SelectedIndexChanged(object sender, EventArgs e) { q = listView1.SelectedItems[0].Index; } 但它不起作用,并抛出一个异常,说'listView1.SelectedItems'的计数是0。 为什么它不起作用? 始终检查列表视图项数。 如果项目是空的,那么将会有一个例外。

Using System.Drawing.DrawRectangle to draw Selection Rectangle to select things

I have a Windows Forms application and need to be able to select objects on the form, in the same way that you select files on the Desktop by left-clicking and dragging over the files, like below: I have the following code which I've written by myself, but it's terrible. It's not right. I'm not too worried about the "selection" part of it right now, I'm mainly co

使用System.Drawing.DrawRectangle绘制选择矩形来选择事物

我有一个Windows窗体应用程序,需要能够选择窗体上的对象,就像您通过左键单击并拖动文件来选择桌面上的文件一样,如下所示: 我有我自己写的以下代码,但它很糟糕。 这是不对的。 我现在不太担心它的“选择”部分,我主要关心如何画这样的画面? private void splitContainer1_Panel1_MouseMove(object sender, MouseEventArgs e) { if (mouseDown) { // TODO: Draw Rectangle (so you can select elements o

Coordinate Mismatch Problem

loaded the jpg to picture box (in Size mode as Zoomed). I drawn a rectangle on the picture box and taken the coordinate. opens the jpg in paint and observed the coordinate (where i drawn rectangle on the picture box). when i compare the rectangle coordinate(x and y) with paint coordinate it not the same. I changed the Size mode to normal and observed that the coordinates are same but the I

坐标不匹配问题

将jpg加载到图片框(大小模式下为缩放)。 我在图片框上绘制了一个矩形并取得了坐标。 在paint中打开jpg并观察坐标(我在图片框上绘制矩形的地方)。 当我比较矩形坐标(x和y)与油漆坐标不一样。 我将尺寸模式更改为正常,并观察到坐标相同,但图像尺寸过大,因此显示部分。 所以使用缩放大小模式属性。 说大小为2825x3538的图像,并将图片框大小模式保持为“正常”,图像部分显示在图片框中。 所以我改变了图片框模式

Canvas toDataURI() on chrome security issue

I am having an issue with Canvas on chrome. I know that this is mentioned a lot but i was not able to find a solution that suites me. Basically, i am designing a website that does the following steps: - Loads an SVG image template from the hosting server into an object. - Manipulates that SVG (Coloring, hiding and showing layers etc...) - Then send the manipulated version to the server t

Canvas toDataURI()在chrome安全问题上

我在Chrome上遇到了Canvas问题。 我知道这被提及很多,但我无法找到适合我的解决方案。 基本上,我正在设计一个网站,执行以下步骤: - 将托管服务器中的SVG图像模板加载到对象中。 - 操纵SVG(着色,隐藏和显示图层等) - 然后将操纵的版本发送到服务器,以便插入到pdf文档中并通过电子邮件发送。 我的问题是最后一步。 我使用的方法包括: - 获取SVG的内容文档并序列化其XML。 var s = new XMLSerializer()

buffering *framework* in C and Windows GDI

Background : My client has a very extensive proprietary forms library which is effectively implemented in C (actually, it's a proprietary object-oriented language that basically wraps Windows controls and interacts with them with SendMessage() , SetStyle() , etc.) Problem I want to solve : Whenever I drag/resize a top-level window (or drag a splitter) in an app implemented in the above fram

在C和Windows GDI中缓冲* framework *

背景 :我的客户端有一个非常广泛的专有表单库,它有效地用C语言实现(实际上,它是一种专有的面向对象语言,基本上封装了Windows控件,并使用SendMessage() , SetStyle()等与它们交互) 我想解决的问题 :每当我在上述框架中实现的应用程序中拖动/调整顶层窗口(或拖动分隔线)时,都会出现大量闪烁。 顶层窗口被重新绘制,并且它包含的任何控件都会重新绘制。 问题1 :有没有办法通过手术将双缓冲引入到表单库中。 特别

Rendering controls on glass: Solution found, needs double

I (finally!) found a way of rendering Windows.Forms controls on glass that doesn't seem to have any major drawback nor any big implementation time. It's inspired by this article from Coded, which basically explains how to natively override the painting of controls to draw over them. I used that approach to render the control to a bitmap and paint it back with GDI+ and the appropriate a

玻璃上的渲染控件:找到解决方案,需要翻一番

我(终于!)找到了一种在Windows上呈现Windows.Forms控件的方式,它似乎没有任何主要缺点,也没有任何大的实施时间。 它的灵感来自Coded的这篇文章,它基本上解释了如何在本地重写控件的绘画来绘制它们。 我使用该方法将控件渲染为位图,并使用GDI +和适当的Alpha通道在NativeWindow的绘制区域上绘制回来。 这个实现很简单,但可以通过可用性来完善,但这不是这个问题的关键。 但结果令人非常满意: 但是,有两个方面需

Why does DrawImageUnscaled cause flickering when used from WM

I'm currently building a control derived from System.Windows.Forms.ContainerControl that has a border area I need to paint myself. Since there's no OnPaintNonClientArea to override, I built it myself like this (handling of other messages like WM_NCCALCSIZE , WM_NCHITTEST etc. removed for brevity): protected override void WndProc(ref Message m) { switch (m.Msg) { case WM_NCPAINT:

为什么从WM中使用DrawImageUnscaled会导致闪烁

我目前正在构建一个派生自System.Windows.Forms.ContainerControl的控件,该控件具有我需要绘制自己的边框区域。 由于没有OnPaintNonClientArea覆盖,我自己像这样构建它(处理其他消息,如WM_NCCALCSIZE , WM_NCHITTEST等,为简洁起见而删除): protected override void WndProc(ref Message m) { switch (m.Msg) { case WM_NCPAINT: IntPtr hDC = NativeApi.Methods.GetWindowDC(m.HWnd); if (hDC != I

Custom control under modaldialog not repainting when moving dialog

What causes this ? Other controls are shown fine ... public CustomControl() { SetStyle(ControlStyles.ResizeRedraw, true); SetStyle(ControlStyles.OptimizedDoubleBuffer, true); SetStyle(ControlStyles.UserPaint, true); } The customcontrol is placed in a TableLayoutPanel. ................... Edit: For clarification: Suppose you have a window-sized control wi

移动对话框时,modaldialog下的自定义控件不会重新绘制

这是什么原因? 其他控件显示正常... public CustomControl() { SetStyle(ControlStyles.ResizeRedraw, true); SetStyle(ControlStyles.OptimizedDoubleBuffer, true); SetStyle(ControlStyles.UserPaint, true); } customcontrol放置在TableLayoutPanel中。 ................... 编辑:澄清:假设你有一个窗口大小的控件,顶部有一个小模式对话框。 当你移动对话窗口时,它就像你