Questions tagged [gdi]

Graphics Device Interface (GDI) is a device-independent, pure software graphics API under the Windows operating system for drawing graphic primitives and text. It is the underlying base used to render the Windows GUI elements.

Graphics Device Interface (GDI) is a device-independent, pure software graphics API under the Windows operating system for drawing graphic primitives and text. It is the underlying base used to render the Windows GUI elements.

More information at http://en.wikipedia.org/wiki/Graphics_Device_Interface

2158 questions
0
votes
1 answer

ATL CImage::SetPixel not working for monochrome BMPs (nBPP=1)

I'm trying to code a program that changes a BMP file and adds some modifications in particular locations. The BMPs I'm trying to modify are monochrome (1 bit per pixel) as the image size needs to be quite small. I'm using the ATL CImage class to do…
0
votes
0 answers

GDI compatiable with direct2d not working when using pushlayer and poplayer

I am working on a project, and try to convert GDI rendering into direct2d rendering. Sometimes I need to use ID2D1GdiInteropRenderTarget interface to rendering some GDI content to direct2d's render target. Here is the problem: If I use GetDC()…
zhufachang
  • 21
  • 5
0
votes
0 answers

Clearing the drawn rectangle

How can I clear a certain rectangle? I display the circles and the text inside each circle (TextOut) in the window. I try to implement it so that when the left mouse button is pressed on a certain circle, the circle and the text disappear, that is,…
Маlnyy
  • 1
  • 1
0
votes
1 answer

error C2248: 'CObject::CObject' : cannot access private member declared in class 'CObject' when I calling hDC.SelectObject function in MFC

I develop a simple program in MFC (Visual Studio 2013) for WinCE 2013, using GDI methods for drawing on device context. Unfortunatelly when I try to call SelectObject on context device handle i get error: "error C2248: 'CObject::CObject' : cannot…
0
votes
1 answer

What is, and why do I have to restore bitmap hdc or memory dc to the default state when cleaning up?

When I was looking at BitBlt() examples, I noticed almost all of them were saving the default state of the hdc for bitmaps and then restoring the hdc to the default state using SelectObject() at clean up. Including the source code for Nethack for…
0
votes
0 answers

the rectangle drawed by the Rectangle function(WinGDI.h) cannot display in Windows 7 64 bit system

Question: I find that the rectangle drawed by Rectangle function(included in WinGDI.h) will not show in windows 7 sysytem(64 bit), but it can display in windows 10. Is there any differences between win7 and win10? And are there other ways to do draw…
0
votes
0 answers

GDI canvas limits for long line/stroke painting?

I'm drawing a timeline in my application which can be zoomed in and out. But from a certain zoom, long lines cease to be painted. I discovered this had something to do with how long the line is. For a zoom down to nanoseconds, I can have a line as…
tomascz
  • 235
  • 1
  • 13
0
votes
2 answers

Change Static Text Color in MFC

I am trying to change the color of static text (and also checkbox items) in a dialog window in my MFC application. Following this (MFC - change text color of a cstatic text control) and similar suggestions, I did the following on ON_WM_CTLCOLOR()…
Kevin
  • 21
  • 1
  • 6
0
votes
1 answer

Draw Resource Icon on Button

I would like to draw my program's icon on an "owner-drawn" button. This could be either an icon in the resource file, or the generic Windows icon. But, even after endless searching, I have not been able to find the code for this. I have come…
anachronon
  • 17
  • 5
0
votes
0 answers

Scaling and Rotating together using wingdi function(SetWorldTransform)

I am using ExtTextOut wingdi function to draw text. Also, I am using SetWorldTransform for scaling text but now I want to rotate text(at all angles) too. How can I change/pass parameters to it so it will scale as well as rotate too? Below is the…
Abhishek Prajapati
  • 345
  • 1
  • 4
  • 15
0
votes
1 answer

How does D3D11 render pixels with an alpha value of 0 in the texture as transparent?

I used DrawIconEx (GDI/D3D11 interoperability and CopyResource) to generate an ID3D11Texture2D which has many pixels with an alpha channel value of 0. this texture has been verified by D3D11_USAGE_STAGING/Map to view the pixel value and ScreenGrab…
fredirty2017
  • 103
  • 11
0
votes
1 answer

How to zoom,resize a bitmap on graphics path and save using VB.net

I am working on watermarking image. In the below code I load the image to the graphics path using resource image and adding text on it. When I add the image through open file dialog it paints on the form with original size but I need to resize it,…
user676589
0
votes
4 answers

Change Image color

I am working on a project where in the shopping cart a user can select a certain color for an item. The problem is there are tons of color choices available but the manufacturer has only provided with one product image. Now I need to come up with a…
Robert
  • 724
  • 1
  • 11
  • 25
0
votes
1 answer

StretchBlt draw a blank bitmap

Im using the default Windows.h functions to draw. I use StretchBlt to draw a bitmap. but it(StretchBlt) draws a blank bitmap (i.e its total blackness if I dont use WHITENESS in rop). I have a struct to draw the components The section of the…
0
votes
1 answer

Program fail after EndPage() fucntion

I am working with C++ MFC framework. Unfortunatelly I met some trouble with EndPage() function. I debugged code and got that program fail after calling EndPage() function. I have no idea why I put code snippet below: void Druk::DrawECG(short *…