We help IT Professionals succeed at work.

Draw a line

win32 asked
Medium Priority
Last Modified: 2013-11-20
How can you draw a line i a CBitmap ?

Lets say I want to draw a line in a bitmap, that has the color deph of 8 bits.. What I need to do is assign those 8 bit to a number, where the line is drawn.. I only need the line drawing algorithm for knowing where to put my values (a mask)

Can that be done, without reenventing LineTo ??

Watch Question

First u create a memory dc
Bitblt this bitmap into memory dc
Draw the line into memory dc
U can get bitmap bits from the memory DC by GetDIBits
U can simply write to this bits to file, by first adding BITMAPHER and data...

I think u need a "bitmap - means a bitmap file"......?
If yes this will solve ur problem


Explore More ContentExplore courses, solutions, and other research materials related to this topic.