gdi+

How to convert an opencv mat image to gdi bitmap

余生长醉 提交于 2020-01-03 06:22:04
问题 I want to convert an openCV Mat file into a GDI+ BitMap image. I cannot find any information on how to do this? I think there is no straight way of doing this, but I hope that it is not involved of writing it to a file and reading back (http://opencv-users.1802565.n2.nabble.com/Convert-IplImage-to-Bitmap-td3784378.html ) I need to write something such as this: #include <windows.h> #include <gdiplus.h> #include <stdio.h> using namespace Gdiplus; Bitmap GetBitMap(cv::Mat inputImage) { Bitmap

How to determine endpoints of Arcs in GraphicsPath PathPoints and PathTypes arrays?

我只是一个虾纸丫 提交于 2020-01-03 03:56:06
问题 I have the following PathPoints and PathTypes arrays (format: X, Y, Type): -177.477900, 11021.670000, 1 -614.447200, 11091.820000, 3 -1039.798000, 10842.280000, 3 -1191.761000, 10426.620000, 3 -1591.569000, 10493.590000, 3 -1969.963000, 10223.770000, 3 -2036.929000, 9823.960000, 3 -2055.820000, 9711.180000, 3 -2048.098000, 9595.546000, 3 -2014.380000, 9486.278000, 3 Here is what this GraphicsPath physically looks like. The 2 Arcs are very distinguishable: I know that this GraphicsPath

Erase to Transparency

﹥>﹥吖頭↗ 提交于 2020-01-03 02:54:32
问题 So I'm trying to make a 32x32 block back to transparent but everytime I try to set it to transparent it just keeps what ever is already there, I want to erase what's on the image to transparent, here's my code I tried. public Bitmap erase_tile(Bitmap bitmap, int x, int y) { Graphics device = Graphics.FromImage(bitmap); Brush brush = new SolidBrush(Color.FromArgb(0, Color.White)); device.FillRectangle(brush, new Rectangle(x * 32, y * 32, 32, 32)); return bitmap; } 回答1: All transparency is

Can I get a bitmap of an arbitrary window in another application process?

☆樱花仙子☆ 提交于 2020-01-02 19:27:11
问题 I am trying to automate a third-party Win32 application where I want to capture the graphics content of a particular window at defined time intervals. I am in the early phases of this, and I'm currently trying to use the Microsoft UI Automation API via C# to do most of the interaction between my client app and the external app. I can now get the external app to do what I want it to do, but now I want to capture the graphics from a specific window that seems to be some third-party owner-drawn

.net onpaint vertical sync

旧时模样 提交于 2020-01-02 06:24:38
问题 I'm trying to implement some animation using winforms and gdi+, but I get a lot of tearing moving sprites inside a control. Is there a way in managed .net to have the overriden Control.OnPaint method wait for the vertical retrace of the monitor? 回答1: Are you already using double buffering? If not I would suspect that would remove the tearing, and it is simpler than trying to wait for the vertical retrace. 来源: https://stackoverflow.com/questions/819762/net-onpaint-vertical-sync

.net onpaint vertical sync

家住魔仙堡 提交于 2020-01-02 06:24:09
问题 I'm trying to implement some animation using winforms and gdi+, but I get a lot of tearing moving sprites inside a control. Is there a way in managed .net to have the overriden Control.OnPaint method wait for the vertical retrace of the monitor? 回答1: Are you already using double buffering? If not I would suspect that would remove the tearing, and it is simpler than trying to wait for the vertical retrace. 来源: https://stackoverflow.com/questions/819762/net-onpaint-vertical-sync

Change image color with transparent background

﹥>﹥吖頭↗ 提交于 2020-01-02 06:13:53
问题 I need to load an image with green circle over a transparent background into a bitmap image using c# (System.Drawings). That's the easy part. However I need to change the color of the circle before adding it to the bigger image, without affecting the transparency of the surrounding. In my case I need to change the circle color to yellow and add it as a sun. I can't use fixed yellow circle image because the desired color is dynamic. So in the code below, how can I change the color of the image

Bitmap Graphics vs WinForm Control Graphics

情到浓时终转凉″ 提交于 2020-01-02 05:27:09
问题 I'm just using a .NET port of Pdfium named PdfiumViewer. It just works very well once rendered in the WinForm controls but when I try to render it on a Bitmap to show in the WPF windows (or even saving to disk) the rendered text has problem. var pdfDoc = PdfiumViewer.PdfDocument.Load(FileName); int width = (int)(this.ActualWidth - 30) / 2; int height = (int)this.ActualHeight - 30; var bitmap = new System.Drawing.Bitmap(width, height); var g = System.Drawing.Graphics.FromImage(bitmap); g

Creating a Hand-Drawn effect using .NET

杀马特。学长 韩版系。学妹 提交于 2020-01-01 19:40:52
问题 I'd like to write a piece of code which creates images similar in style to those rendered by 'Balsamiq Mockups' or 'yUML' using the .NET framework. Can anybody tell me how to achieve the hand-drawn pencil effect using GDI+? The text can obviously be done using the right font - my question is how to render the lines, boxes and circles. Thanks! 回答1: GDI+ is best suited for drawing right-angle-type graphics, but you can use it to produce an effect like this: alt text http://img7.imageshack.us

How can I create a Base64-Encoded string from a GDI+ Image in C++?

眉间皱痕 提交于 2020-01-01 19:32:24
问题 I asked a question recently, How can I create an Image in GDI+ from a Base64-Encoded string in C++? , which got a response that led me to the answer. Now I need to do the opposite - I have an Image in GDI+ whose image data I need to turn into a Base64-Encoded string. Due to its nature, it's not straightforward. The crux of the issue is that an Image in GDI+ can save out its data to either a file or an IStream*. I don't want to save to a file, so I need to use the resulting stream. Problem is,