gdi

Drawing video with text on top

穿精又带淫゛_ 提交于 2019-12-30 08:54:10
问题 I am working on an application and I have a problem I just cant seem to find a solution for. The application is written in vc++. What I need to do is display a YUV video feed with text on top of it. Right now it works correctly by drawing the text in the OnPaint method using GDI and the video on a DirectDraw overlay. I need to get rid of the overlay because it causes to many problems. It wont work on some video cards, vista, 7, etc. I cant figure out a way to complete the same thing in a more

Are GDI, GDI+ and OpenGL really obsolete/deprecated? [closed]

天大地大妈咪最大 提交于 2019-12-30 03:45:36
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 2 years ago . If you open the page "Graphics and Gaming (Windows)" on microsoft.com the last category is described as Legacy Graphics: Technologies that are obsolete and should not be used in new applications. This category includes (among others) the following APIs: GDI GDI+ OpenGL What's

How can I render a square bitmap to an arbitrary four-sided polygon using GDI?

与世无争的帅哥 提交于 2019-12-29 03:38:05
问题 I need to paint a square image, mapped or transformed to an unknown-at-compile-time four-sided polygon. How can I do this? Longer explanation The specific problem is rendering a map tile with a non-rectangular map projection. Suppose I have the following tile: and I know the four corner points need to be here: Given that, I would like to get the following output: The square tile may be: Rotated; and/or Be narrower at one end than at the other. I think the second item means this requires a non

Is there a faster alternative to GDI GetPixel()?

帅比萌擦擦* 提交于 2019-12-28 03:00:52
问题 I'm using GetPixel() from gdi32.dll in a .NET app to sample the colour of a pixel anywhere on the screen. It works ok but it is a major performance bottleneck for me. Is there a faster way of doing it? 回答1: Fast access to pixels are possible using LockBits() method of the Bitmap . This will return to you an object containing a pointer to the start of the pixel data and you can use unsafe code to access the memory. http://www.bobpowell.net/lockingbits.htm 回答2: GetPixel is slow for two reasons:

How to use %d in C++, particularly in DrawText() [duplicate]

故事扮演 提交于 2019-12-26 23:56:02
问题 This question already has an answer here : How can I use DrawText() to display a variable? (1 answer) Closed 6 years ago . so ive heard of %d, but i dont know how to use it. here is what i want to do: DrawText (hdcWindow, "PLACE IN QUESTION" , -1, &rc, DT_SINGLELINE); at the "PLACE IN QUESTION" i want to display text and a variable like "text %d" or something, but I don't know the syntax, and how do I dictate what %d will represent when it is displayed? 回答1: DrawText doesn't work like printf

How to use %d in C++, particularly in DrawText() [duplicate]

孤街浪徒 提交于 2019-12-26 23:54:43
问题 This question already has an answer here : How can I use DrawText() to display a variable? (1 answer) Closed 6 years ago . so ive heard of %d, but i dont know how to use it. here is what i want to do: DrawText (hdcWindow, "PLACE IN QUESTION" , -1, &rc, DT_SINGLELINE); at the "PLACE IN QUESTION" i want to display text and a variable like "text %d" or something, but I don't know the syntax, and how do I dictate what %d will represent when it is displayed? 回答1: DrawText doesn't work like printf

How to use %d in C++, particularly in DrawText() [duplicate]

蓝咒 提交于 2019-12-26 23:53:32
问题 This question already has an answer here : How can I use DrawText() to display a variable? (1 answer) Closed 6 years ago . so ive heard of %d, but i dont know how to use it. here is what i want to do: DrawText (hdcWindow, "PLACE IN QUESTION" , -1, &rc, DT_SINGLELINE); at the "PLACE IN QUESTION" i want to display text and a variable like "text %d" or something, but I don't know the syntax, and how do I dictate what %d will represent when it is displayed? 回答1: DrawText doesn't work like printf

How to use %d in C++, particularly in DrawText() [duplicate]

你。 提交于 2019-12-26 23:53:24
问题 This question already has an answer here : How can I use DrawText() to display a variable? (1 answer) Closed 6 years ago . so ive heard of %d, but i dont know how to use it. here is what i want to do: DrawText (hdcWindow, "PLACE IN QUESTION" , -1, &rc, DT_SINGLELINE); at the "PLACE IN QUESTION" i want to display text and a variable like "text %d" or something, but I don't know the syntax, and how do I dictate what %d will represent when it is displayed? 回答1: DrawText doesn't work like printf

GDI+绘图基础,绘制表格

自作多情 提交于 2019-12-26 08:29:53
GDI+绘图基础 编写图形程序时需要使用GDI(图形设备接口Graphics Device Interface),从程序设计的角度看,GDI包括两个部分:GDI对象和GDI函数。 GDI对象定义了GDI函数使用的工具和环境变量,GDI函数对象绘制各种图形。在C#中,进行图形程序编写时用到的都是GDI+版本,是GDI的进一步扩展,它使我们变成更加方便。 GDI+概述 GDI+是微软提供的新的图形设备接口,通过托管代码的类来展现。GDI+主要提供了三类服务: 二维矢量图形 图像处理 文字显示 GDI+比GDI的优越性主要展现在2个方面: 扩展了新功能 变成更加简易灵活 Graphics类 Graphics类封装一个GDI+绘图页面,提供将对象绘制到显示设备的方法,与特定的设备上下文关联。所有的画图方法都被包括在Graphics类中,在绘制任何对象时,我们首先要创建一个Ggraphics实例,这个实例相当于创建了一块画布,有了画布才可以使用各种画图方法绘图。 绘图程序的设计一般分为两个步骤: (一)创建Graphics对象; (二)使用创建的Graphics对象的方法绘图、显示文本或处理图像。 使用Graphics 创建Graphics对象 利用Paint事件中的PaintEventArgs在窗体或控件的Paint事件中接收对图像对象的引用。在为控件创建绘制代码时,通常用此方法。

Keep only red channel of an image using GDI()

我是研究僧i 提交于 2019-12-25 07:10:05
问题 I initially had a color image which i made it grayscale by copying only red channels i.e, first 8 bits of RGB(24bit). This was done as some processing required the image to be grayscale.After the processing i have to display this image on screen using GDI. So i have to copy put the gray values into red chanel of the final output. Something like setpixel(i,j,RGB(grayvalue,0,0)). How do i achieve this using GDI? 回答1: As suggested by David, its been solved with solution mentioned in the