line thinkness
-
Your code is fine, I called it this way:
case WM_PAINT:
hdc = BeginPaint(hWnd, &ps);
paint_line(hWnd, hdc, 0, 0, 400, 400, 5, RGB(255,0,0));
EndPaint(hWnd, &ps);
break;and got a beautiful red thick line in my window. :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
OK, could you try with
300
only, please ? :)virtual void BeHappy() = 0;
-
Place a breakpoint on the beginning of your
paint_line
method and once it gets hit, check thethickness
parameter's value to see if it really is not 0 or 1.> The problem with computers is that they do what you tell them to do and not what you want them to do. < > Sometimes you just have to hate coding to do it well. <
-
No probs, here[^] you can find info about the mapping modes as mentioned by someone, try setting the MM_TEXT mapping mode before drawing your line and see what results that produces.
> The problem with computers is that they do what you tell them to do and not what you want them to do. < > Sometimes you just have to hate coding to do it well. <
-
Probably a special DC Mapping Mode[^] was set in the calling context... :) (For example: Carlo Pallini has given his calling context - there are no modifications of the DC Mapping Mode there, so it is possible to "feel" the arguments by
2
or5
too :) )virtual void BeHappy() = 0;
-
Probably a special DC Mapping Mode[^] was set in the calling context... :) (For example: Carlo Pallini has given his calling context - there are no modifications of the DC Mapping Mode there, so it is possible to "feel" the arguments by
2
or5
too :) )virtual void BeHappy() = 0;
-
No probs, here[^] you can find info about the mapping modes as mentioned by someone, try setting the MM_TEXT mapping mode before drawing your line and see what results that produces.
> The problem with computers is that they do what you tell them to do and not what you want them to do. < > Sometimes you just have to hate coding to do it well. <
-
Eugon I think i need to learn About setting Modes its my pleasure to talk with you thanks a lot it really helped me arun
You are welcome, Arun ! :) (please observe the function that does call
paint_line(..)
- maybe, there is some variable likefloat fZoomingFactor
there, so you could call the function likepaint_line(.., thickness * fZoomingFactor, ..)
:) )virtual void BeHappy() = 0;
-
You are welcome, Arun ! :) (please observe the function that does call
paint_line(..)
- maybe, there is some variable likefloat fZoomingFactor
there, so you could call the function likepaint_line(.., thickness * fZoomingFactor, ..)
:) )virtual void BeHappy() = 0;
-
I am using pen to plot lines in graph hpen = CreatePen(PS_SOLID, thickness, rgb); even after giving the thinkness parameter as 5 . thickness of the line still remain same as if we put zero... is there any thing i m missing to add or any code or api to increase thickness of the line pls help me to come out of this mess thanks in advance............
//Create pen based on your requirement. HPEN hPen= CreatePen(PS_SOLID, thickness, RGB(0,0,0)); //Select the created pen in Device context. If you want to capture capture the old pen. Once you are //done with the drawing select the old pen back and destroy the pen you have created. HPEN hOldPen = (HPEN) SelectObject(hdc, hPen); //Do your drawing here. ... ... ... //Select the old pen back so that the newly created pen will get deselected. SelectObject(hdc, hOldPen ); //Delete the pen. DeleteObject(hpen); Use above mentioned code to draw your line with thickness.
Raj Jaiswal