|
Hello,
Is there a mean to draw a text in a rect, but I want the text fully fill the rect (bottom of the text == bottom of the rect).
For now,
I draw the text in a path.
I get path data, and I map all points to a rect of (1.f, 1.f).
And I fill the rect using matrix transformation.
My problem is that this method don't preserve anti-aliasing So I want to draw my text directly with GDI to fill the rect.
any suggestions
|
|
|
|
|
|
Those functions don't fill all the rect with the text.
I want for example do -> MyDrawText(10, 30, 50, 1000) to draw a text of width = 50-10 = 40 pixels and height of 970 pixels.
Not using font height and width.
Is it possible with GDI ? not GDI+
|
|
|
|
|
The easiest solution would probably be to draw the text into a memory DC, then use StretchBlt() to copy it to the screen and stretch it as tall as you want. The result probably won't look too pretty, though.
--Mike--
PROCRASTINATION: Hard work often pays off after time, but laziness always pays off now.
BUY MY SOFTWARE!! (please?) RightClick-Encrypt | 1ClickPicGrabber
My IntarWeb Homepgae!!!11
|
|
|
|
|
> The result probably won't look too pretty, though.
Yes
|
|
|
|
|
Use GDI+ with double buffering. I tried the following code in an SDI app and it looked pretty good to me.
void CTestView::OnDraw(CDC *pDC)
{
CRect rc;
GetClientRect(&rc);
Graphics g(*pDC);
Bitmap bmp(107, 15, &g);
Graphics memg(&bmp);
Font f(L"Arial", 16);
SolidBrush br(Color(255, 0, 0, 0));
memg.DrawString(L"Hello World", 11, &f, PointF(-3.0, -3.0), &br);
g.DrawImage(&bmp, 0, 0, rc.Width(), rc.Height());
}
While the antialiasing wasn't perfect, it definitely wasn't the blockness you get with straight GDI.
HTH
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
Addendum to my original reply
If you use a large font size, and a larger memory bitmap, the effect is even better.
ie, use a 72 point font, on a 600 x 100 memory bitmap
Bitmap bmp(600, 100, &g);
Graphics memg(&bmp);
Font f(L"Arial", 72);
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
Hello,
I wanna draw alti-aliased line in my application, but I don't know how to do it with GDI.
I'm pretty sure someone in the world has write this function for GDI. Do you know where to find it ?
Or just a method to smooth drawing routines of GDI..?
Thanks in advance for your help,
|
|
|
|
|
You can do it with GDI+.
There are several articles here on CodeProject about GDI+.
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
and without GDI+ ???
I've started my project without GDI+ and I don't want to use it now.
|
|
|
|
|
|
Hello Freinds
I have a question. Is it possible that I have an external variable(#extern) in my extension dll? I would be very glad if anyone help me.
Mohsen Kokabi
|
|
|
|
|
Hello, i tried making this app that sends a GET or POST command to a forum server to post a message.
Normally you would use the POST command since thats just what you use to post stuff. But i had made a program before that used the GET command to post things instead of the POST command like this:
Normally:
POST http://www.<theforum>.com/cgi/addmessage HTTP/1.0
Referer: blablabla
Host: blablabla
Content-length: blablabla
Cookie: blablabla
(these are not important)
fid=31613&name=me&subject=hello&message=mymessage // <--- the actual data
So thats what a normal POST command would look like, but you could also use GET for this like this:
GET http://www.<theforum>.com/cgi/addmessage?fid=31613&name=me&subject=hello&message=mymessage HTTP/1.0 // So basically just add a "?" to the url and put the data behind it //
Referer: blablabla
Host: blablabla
Cookie: blablabla
(the normal stuff again, not important, i know how to work this)
Now the problem is, i tried both these methods to post something, no cookies were involved and yes i do have a proxy but i just posted it there and that should work, because it does for the other application i wrote once, but it just doesnt seem to work for this one, now does anyone have any idea of what could be the cause, i was thinking maybe its the server, because you see, what i do is i build up a socket, i connect to my proxy, send the GET or POST header and i disconnect. Now this worked fine for my other program (where i used the GET to post data by the way) but it doesnt work here, so i thought maybe its because the server needs to terminate the connection and not me or otherwise it wont process the data sent? So i would have to receive on the socket i used for sending first and put it in a buffer? Or does this have nothing to do with it? Any ideas what might be causing it to fail?
Thanks for your help
Kuniva
--------------------------------------------
|
|
|
|
|
Just because a server supports POST does not mean it will support a GET. It is quite likely the server you are trying only accepts a POST for the particular URL
|
|
|
|
|
A couple suggestions :
- Are you sure the server still supports HTTP 1.0 ?
- Is the content-length header filled with the right buffer size ?
- Do you end the post data with a double EOL ?
- test with the Proxy-connection: keep-alive
Last but not least,
- Use wininet to manage all this for you
|
|
|
|
|
Thank you both for your replies, but i am sure neither of this is the problem. For the first reply: I tried both POST and GET, neither worked. For the second reply: I posted a message on the forum using my browser (internet explorer) and i captured the packets sent over my network. Then i sent the EXACT same data again using my application, so you see, it had nothing to do with Content-length, Proxy or whatever.
Thanks again for the replies but i'm affraid it will remain unsolved for now.
Kuniva
--------------------------------------------
|
|
|
|
|
I'm told in mbcs systems the file names are allowed to upto 32000 chars long, whereas I've been writing code that assumes they can't be more than MAX_PATH chars long. In order to create files we have to use the unicode version of CreateFile with "\\?\" prepended to a file name in case of local disks and "\\?\UNC\" prefix with paths having the Universal Naming Convention (UNC) format.
My question is is it enough for me to make sure I always use unicode versions of File I/O api's and check a file name if it starts with C:\ etc then I prepend "\\?\" to the file name without regard to the file length and if the filename starts with "\\" I prepend it with "\\?\UNC\" prefix? Do you see any gotchas here?
Mangu
|
|
|
|
|
Yes - this won't work on non-Unicode enabled systems (such as 9X.)
I have been dealing wiith multibyte and Unicode stuff for a while now, and have never come across a filename like "\\?\..." (even though I have seen references to it in documentation.)
You can pick your friends, and you can pick your nose, but you can't pick your friend's nose.
|
|
|
|
|
hi everybody.
I need to know if somebody is calling to modem on my pc,
for this i do following:
<br />
DWORD l_iResult = ::lineInitialize(&m_hTAPI ,NULL, lineCallbackFunc ,<br />
_T("MyApp"), &m_iNumberOfLineDevices);<br />
DWORD l_iResult = ::lineOpen( m_hTAPI , l_iDevLineID , &m_hLine , m_iTAPIVersion , 0 , 100 , LINECALLPRIVILEGE_OWNER ,LINEMEDIAMODE_DATAMODEM , NULL );<br />
DWORD dwLineStates = LINEDEVSTATE_CLOSE |LINEDEVSTATE_CONNECTED | LINEDEVSTATE_DISCONNECTED | LINEDEVSTATE_RINGING;<br />
DWORD lRes = lineSetStatusMessages(m_hLine, dwLineStates, 0);<br />
So , how can you see , I'll receive the event if somebody is calling to me , but i want to know who is it? that mean i want to know remote phone number.How can i do that?
Thanks to everybody who will react.
|
|
|
|
|
If your modem TSPI supports it, then you should recieve a LINE_CALLINFO message with the LINECALLINFOSTATE_CALLERID state.
You can use the lineGetCallInfo function to return the caller id.
A lot depends on the modem, and whether the telephone service provider is issuing the CLI. (Or if the CLI is blocked)
Michael
Wonder Woman, Wonder Woman.
All the world's waiting for you,
and the power you possess.
In your satin tights,
Fighting for your rights
And the old Red, White and Blue.
|
|
|
|
|
Arg.. getting a headache over this.. I create a static splitter window, and each pane loads another frame, and each frame loads another view.. I need to do this because both panes need independant toolbars. Anyways everything works fine untill you try and close the app.. then it blows up.. It fails when at CFrameWnd::OnDestroy(); and I can't figure out why.. If I replace one of the splitter panes with a standard CView then it works fine.. but if both panes are frames it blows up.. I just can't figure this out..
Any Ideas?
|
|
|
|
|
I had write a skinnable program which use bitmap to paint No-Client area, and i create
a RGN object from these bitmap, the problem is, when i sizing the window by mouse, it flicker,
how to solve this problem? Which message i need call SetWindowRgn to update the rgn of my window?
|
|
|
|
|
I have a CListCtrl in a tab within my dialog. I have hooked this list to the LVN_ITEMCHANGED message - ON_NOTIFY(LVN_ITEMCHANGED, IDC_LIST_SUBSCRIPTIONS, OnItemchangedListSubscriptions). However, my callback is not being called. I have other 'widgets' and they are working(ie buttons->ON_BN_CLICKED). I have my list displaying in report mode w/ columns,etc. I am running on Win2K/Visual Studio 6.0. Any help is appreciated
Thanks
|
|
|
|
|
LVN_ITEMCHANGED goes to the parent of the list - chances are, they are sent to the tab, rather than the dialog.
If you go to war, you will destroy a great country a stoned greek chick to the richest man of the world
sighist | Agile Programming | doxygen
|
|
|
|
|
Could you please tell me a work around? Should I try and catch it with OnNotify. Example please -
Thanks!
|
|
|
|
|