gdi

What is the difference between GDI and GDI+?

99封情书 提交于 2019-12-22 01:42:38
问题 Are there any differences between those two libraries? 回答1: According to the wikipedia article on GDI: With the introduction of Windows XP, GDI was deprecated in favor of its successor, the C++ based GDI+ subsystem. GDI+ adds anti-aliased 2D graphics, floating point coordinates, gradient shading, more complex path management, intrinsic support for modern graphics-file formats like JPEG and PNG, and support for composition of affine transformations in the 2D view pipeline . 回答2: GDI is not

Convert CFF fonts into OpenType fonts programmatically

家住魔仙堡 提交于 2019-12-21 22:40:42
问题 Does anyone have any pointers where I can find extra information on how to create an opentype wrapper around a CFF font? Currently I have a parser for CFF files so I can get all sorts of information out of it (cmap, glyph names, widths, names etc etc). Given this information I am unable to create an Opentype (truetype format like) wrapper so I can use the font on Windows using GDI; GDI will not load the Opentype font and the only thing I know is that it fails to load the font. Does anyone

How to draw a single line using MouseMove Event

点点圈 提交于 2019-12-21 20:56:09
问题 I'm trying to draw a single line using OnMouseMove() event. My Problem is that everytime I move the mouse It leaves a trail. I tried to use the refresh method, but when I stop moving the mouse the line is gone. I don't want the line to be drawn OnPaint(); , Just want to draw it OnMouseMove() . EDIT: I'm using a transparent panel(cp.ExStyle |= 0x20;), so I cant use the graphics.Clear() and BackColor() Here's a Sample Image without the Refresh() : Here's my code: private void panel1_MouseMove

Hardware accelerate bitmap drawing in java

时光毁灭记忆、已成空白 提交于 2019-12-21 06:57:14
问题 I want to be able to draw consecutive bitmaps (of type BufferedImage.TYPE_INT_RGB) of a video as quickly as possible in java. I want to know the best method in doing so. Does anyone have any advice where I should start? From what I've read, 2 options are: 1) Use GDI/GDI+ routines in a JNI dll working with JAWT (Im on Windows) 2) Use Java3D and apply Textures to a Box's face and rotate it to the camera Im interesting in any advice on these topics as well as any others. I have done a decent

GDI fails conversion to indexed color with exact palette?

佐手、 提交于 2019-12-21 05:49:13
问题 Summary Using Windows GDI to convert 24-bit color to indexed color, it seems GDI chooses colors which are "close enough" even though there are exact matches in the supplied palette. Can anyone confirm this as a GDI issue or am I making a mistake somewhere? Maybe there's a "please check the whole palette for color matches" flag which I've failed to find? Note: This is not about quantizing. The source is 24-bit but contains 256 or fewer colors so an exact palette is trivial to calculate. The

Windows GDI

与世无争的帅哥 提交于 2019-12-21 05:05:55
TextOut (hdc, x, y, psText, iLength) ; TextOut向窗口的显示区域写入字符串。psText参数是指向字符串的指针,iLength是字符串的长度。x和y参数定义了字符串在显示区域的开始位置。hdc参数是「设备内容句柄」,它是GDI的重要部分。实际上,每个GDI函数都需要将这个句柄作为函数的第一个参数。 设备内容 读者可能还记得,句柄只不过是一个数值,Windows以它在内部使用对象。程序写作者从Windows取得句柄,然后在其它函数中使用该句柄。设备内容句柄是GDI函数的窗口「通行证」,有了这种设备内容句柄,程序写作者就能自如地在显示区域上绘图,使图形如自己所愿地变得好看或者难看。 设备内容(简称为「DC」)实际上是GDI内部保存的数据结构。设备内容与特定的显示设备(如视讯显示器或打印机)相关。 对于视讯显示器,设备内容总是与显示器上的特定窗口相关。 设备内容中的有些值是图形「属性」,这些属性定义了GDI绘图函数工作的细节。例如,对于TextOut,设备内容的属性确定了文字的颜色、文字的背景色、x坐标和y坐标映像到窗口的显示区域的方式,以及显示文字时Windows使用的字体。 当程序需要绘图时,它必须先取得设备内容句柄。在取得了该句柄后,Windows用内定的属性值填入内部设备内容结构。 当程序在显示区域绘图完毕后,它必须释放设备内容句柄

How to tell if a surrogate pair Unicode character is supported by the font?

北战南征 提交于 2019-12-21 04:20:59
问题 I was able to find the following method of determining if a Unicode-16 character is supported by a font. Unfortunately that doesn't work for surrogate pair Unicode characters, since WCRANGE struct supported by GetFontUnicodeRanges function returns only WCHAR (16-bit) parameters as output. Here's an example of what I'm trying to do: LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { static HFONT hFont = NULL; switch (message) { case WM_CREATE: { LOGFONT lf = {0};

Why does GetObject return an BITMAP with null bmBits?

冷暖自知 提交于 2019-12-21 03:57:08
问题 Context: I'm trying to take a screenshot of another window to feed it into OpenCV. I found some code on the web that should be able to convert a BITMAP to something OpenCV can work with. Unfortunately I ran into some trouble. Question: Why is the bmBits attribute/member always null? (I also tried with PrintWindow instead of BitBlt the result was the same) #include <iostream> #include <string> #include <Windows.h> int main(int argc, char* argv[]) { std::wstring windowName = L"Calculator"; RECT

RenderTargetBitmap GDI handle leak in Master-Details view

喜夏-厌秋 提交于 2019-12-21 03:42:13
问题 I have an app with a Master-Details view. When you select an item from the 'master' list, it populates the 'details' area with some images (created via RenderTargetBitmap). Each time I select a different master item from the list, the number of GDI handles in use by my app (as reported in Process Explorer) goes up - and eventually falls over (or sometimes locks up) at 10,000 GDI handles in use. I'm at a loss on how to fix this, so any suggestions on what I'm doing wrong (or just suggestions

Direct2D - Emulating Color Keyed Transparent Bitmaps

痴心易碎 提交于 2019-12-21 02:38:30
问题 I'm currently updating a Windows GDI application to use Direct2D rendering and I need to support "transparent" bitmaps via color-keying for backwards compatibility. Right now I'm working with a HWND render target and a converted WIC bitmap source (to GUID_WICPixelFormat32bppPBGRA). My plan so far is to create a IWICBitmap from the converted bitmap, Lock() it, and then process each pixel setting it's alpha value to 0 if it matches the color key. This seems a bit "brute force" - Is this the