Click here to Skip to main content
15,908,661 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: title bar Pin
namaskaaram19-Jan-05 18:19
namaskaaram19-Jan-05 18:19 
GeneralRe: title bar Pin
Member 2996919-Jan-05 20:07
Member 2996919-Jan-05 20:07 
GeneralRe: title bar Pin
toxcct20-Jan-05 2:19
toxcct20-Jan-05 2:19 
GeneralRe: title bar Pin
Garth Watkins19-Jan-05 20:34
Garth Watkins19-Jan-05 20:34 
GeneralRe: title bar Pin
Member 2996919-Jan-05 23:40
Member 2996919-Jan-05 23:40 
GeneralRe: title bar Pin
David Crow20-Jan-05 2:39
David Crow20-Jan-05 2:39 
Questionhow to code app to play internet radio Pin
don7cry19-Jan-05 16:44
don7cry19-Jan-05 16:44 
Generalraster to vector graphics Pin
ninpo19-Jan-05 16:34
ninpo19-Jan-05 16:34 
I'm trying to draw a line over a bitmap that is not coming from one of the corners of a pixel,
It can be from the center or any other place as well as the corners of a pixel, currently
if you draw a line, using LineTo(int,int) what happens is the line doesn't start from the
center of the pixel it starts from typically the left upper corner of the pixel,
given a line say that is drawn in paint by pixels, what i want to do is draw a real line (vector type not raster)
that doesn't concern it's self with the actual pixel, similar to a trace program for raster to vector graphics (Adobe Streamline).
they have bitmapped lines, then they draw vector line types over the top of the bitmapped ones,
and when you look at the line it looks as if it was centered on the pixels if it was a vertical or horizontal.
I want to do the same thing....

I was looking at LineDDA but that didn't work I tried LineTO and that didn't work, LineToEx() as well if I have say pixels
50,50 to 150,50 the line that you draw is on the left side of the pixels and is not centered...?

I basically have a bitmap that displays fine, it is in a scrollview and moves, zooms, pans and the scroll perfectly

int py=GetScrollPos(SB_VERT);
CSize sz(GetTotalSize());

// TODO: calculate the total size of this view
int x=(int)( ima->GetWidth()*m_pDoc->m_ZoomFactor);
int y=(int)(ima->GetHeight()*m_pDoc->m_ZoomFactor);
SetScrollSizes(MM_TEXT, CSize(x,y));

Now I realize I am using MM_TEXT so can you create another Mapped cordinate system on top of a bitmap, and how do you do this?


HEre is the basic idea of what i do to draw a bitmap, now I want to draw on top of the bitmap to (but not actually in the bitmap )
(* TAKE A LOOK AT ADOBE streamline *) that is what I want to do....

void OnDraw(CDC* pDC)
{
CVtestDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);

BOOL bPrinting = pDC->IsPrinting();



CMemDC* pMemDC = NULL;
if (!bPrinting)
pDC = pMemDC = new CMemDC(pDC);

/* more stuff */

SetStretchBltMode(hdc,COLORONCOLOR);
SetDIBitsToDevice(hdc, x, y, cx, cy, 0, 0, 0, cy,info.pImage,(BITMAPINFO*)pDib,DIB_RGB_COLORS);

/*all done now */
delete pMemDC;
}




Any ideas, I'm sure this is very easy.... a simple source code example of a line would be greatly appreciated.
(I will extend this too arcs as well latter)
GeneralFTA Tool Help Pin
XiaoYu19-Jan-05 15:38
XiaoYu19-Jan-05 15:38 
QuestionHow to integrate C++ application with ASP.net web-application? Pin
webdevelopex19-Jan-05 15:34
webdevelopex19-Jan-05 15:34 
AnswerRe: How to integrate C++ application with ASP.net web-application? Pin
basementman20-Jan-05 4:31
basementman20-Jan-05 4:31 
GeneralRename CTreeCtrl item Pin
LiYS19-Jan-05 15:11
LiYS19-Jan-05 15:11 
QuestionHow to retrieve the current path of an explorer window? Pin
gly19-Jan-05 14:57
gly19-Jan-05 14:57 
AnswerRe: How to retrieve the current path of an explorer window? Pin
Abhi Lahare19-Jan-05 22:21
Abhi Lahare19-Jan-05 22:21 
AnswerRe: How to retrieve the current path of an explorer window? Pin
ThatsAlok19-Jan-05 23:04
ThatsAlok19-Jan-05 23:04 
AnswerRe: How to retrieve the current path of an explorer window? Pin
22491720-Jan-05 1:36
22491720-Jan-05 1:36 
QuestionHow to refresh the explorer in my own program? Pin
gly19-Jan-05 14:54
gly19-Jan-05 14:54 
Questionhow put symbol?? Pin
cell5119-Jan-05 14:46
cell5119-Jan-05 14:46 
AnswerRe: how put symbol?? Pin
Antony M Kancidrowski20-Jan-05 2:42
Antony M Kancidrowski20-Jan-05 2:42 
AnswerRe: how put symbol?? Pin
David Crow20-Jan-05 2:48
David Crow20-Jan-05 2:48 
AnswerRe: how put symbol?? Pin
basementman20-Jan-05 4:42
basementman20-Jan-05 4:42 
GeneralQuery Pin
Anonymous19-Jan-05 14:28
Anonymous19-Jan-05 14:28 
GeneralSerialization for WTL app Pin
peterchen19-Jan-05 12:36
peterchen19-Jan-05 12:36 
GeneralRe: Serialization for WTL app Pin
Shog919-Jan-05 12:42
sitebuilderShog919-Jan-05 12:42 
Generaltreectrl Pin
Shotgun19-Jan-05 9:13
Shotgun19-Jan-05 9:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.