|
I am trying to find out the width of data that is writtern in unicode.Is there any API for this.
I find GetTextMetrices but it does not give me correct width for unicode true type font.
Thanks in Advance
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
Check that all is written in Unicode. Maybe you havent supported the font name properly
Some code to look at it would be nice.
Greetings from Germany
|
|
|
|
|
Shilpi Boosar wrote: I find GetTextMetrices but it does not give me correct width for unicode true type font.
How are you using it?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
If GetTextMetrics does not return the proper width, which it does not for some fonts such as ALISON, then one should use the GetCharABCWidthsFloat function.
RECT ImageRect = {0};
TEXTMETRIC tm = {0};
GetTextMetrics(ImageDC, &tm);
ImageRect.bottom = tm.tmHeight;
ABCFLOAT ABCWidths = {0};
double left = 0.0;
double right = 0.0;
double pos = 0.0;
for (std::tstring::iterator it = ImageText.begin(); it != ImageText.end(); ++it)
{
if (GetCharABCWidthsFloat(ImageDC, *(it), *(it), &ABCWidths))
{
pos += ABCWidths.abcfA;
left = min(left, pos);
pos += ABCWidths.abcfB;
right = max(right, pos);
pos += ABCWidths.abcfC;
}
}
ImageRect.right = (long)((right - left) + 0.5);
You may be right
I may be crazy
-- Billy Joel --
Within you lies the power for good - Use it!
|
|
|
|
|
|
After intalling "WindowsXP-KB918997-v6-x86-ENU.exe" ,whenever I am building my project,it is showing error "CanNot open include file "winsock2.h"".But the file winsock2.h is there in my system and I have also included the correc path.What could be the reason?Can anybody help?
|
|
|
|
|
an89 wrote: I have also included the correc path
How did you specify that? I.e. have you set properly the include search path of Visual Studio ?
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]
|
|
|
|
|
Yes I have included proper path in visual studio.Still,its giving same error.
|
|
|
|
|
Hi,
I am working on an MFC Application in which there is chat option with sending emoticons/smiley features.
I am having the codes for each emoticons. When the emoticons button is clicked i want its code to de added in the EditBox.
Now the problem i am facing that I am unable to put the code of smiley at the cursor position. Rather I am able to put it either at the begining of the text or at the end of the text.
please help me.
Thanks In Advance.
Dhiraj Kumar Saini
modified on Monday, October 27, 2008 5:35 AM
|
|
|
|
|
Dhiraj kumar Saini wrote: ...I am unable to put the code of smiley at the cursor position.
How are you obtaining such?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
when i pass value for the sfo.pFrom="d:\\Test\\*.txt\0" it delete the file. But i dont know where my software will install. I have also used to get the path by "GetModuleFileName (hMod, szName, sizeof(szName))" and it return the path like "D:\OHWR\ISS\something.exe". After that i add double slash and kept the path in a variable like "D:\\OHWR\ISS\\*.txt\0". When i used the variable in "sfo.pFrom=3rd variable" It not works.
My code are given below. I am trying it from last week. i have post this msg several time.
---------------------------------
char true_path[100];
//returns the path where .exe install---------
TCHAR szName [MAX_PATH];
HMODULE hMod = GetModuleHandle (NULL);
GetModuleFileName (hMod, szName, sizeof(szName));
Return_Path(true_path, szName); //returns the path with double slash like "D:\\Test\\*.txt\0"
//Remove the files from specified Foleder-------------------
SHFILEOPSTRUCT sfo;
sfo.pTo = NULL;
sfo.hwnd = NULL;
sfo.wFunc = FO_DELETE;
sfo.pFrom = true_path;
sfo.fFlags = FOF_FILESONLY | FOF_NOERRORUI | FOF_SILENT | FOF_NOCONFIRMATION | FOF_NOERRORUI;
SHFileOperation(&sfo);
|
|
|
|
|
double backslash is a bug if it is already a string variable!!!
or maybe the "*" in the filepath isnt such a good a idea
Greetings from Germany
|
|
|
|
|
Sk Mohiuddin wrote: After that i add double slash...
Why? It's not necessary, and may even lead to problems.
Sk Mohiuddin wrote: ...It not works.
Is this supposed to be a helpful description?
Sk Mohiuddin wrote: i have post this msg several time.
And you have yet to answer any questions.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
i need convert file GIF to file BMP. please guide.
guide for me struct file GIF.thanks very much.
|
|
|
|
|
have you looked at CImage (MFC class)? I believe it provides what you need...
|
|
|
|
|
|
Check following thread. You need to do similar thing for GIF to BMP
BMP to JPEG[^]
I hope it helps.
Regards,
Sandip.
|
|
|
|
|
hi. thank very much. i don't know CImage. I wish your help.
|
|
|
|
|
What help you need??
You just need to copy paste the code from that post and change the parameter passed to Save to what ever format you want.
You can always refer to documentation for help CImage[^]
I hope it helps.
Regards,
Sandip.
|
|
|
|
|
this is CImage of .net 2003. i need VC++6.0. wish your help
|
|
|
|
|
Cant you use the "Search" Box for that tasks?
Greetings from Germany
|
|
|
|
|
int nmaxint = std::numeric_limits<int>::max();</int>
this line generates two compile errors when I built in vs2005 sp1.
error C2589: '(' : illegal token on right side of '::'
error C2059: syntax error : '::'
I don't think there are something wrong in this line.
PLZ help
A Chinese VC++ programmer
|
|
|
|
|
sorry, I mean std::numeric_limits<int>::max(); the "<int>" part was ripped.
A Chinese VC++ programmer
|
|
|
|
|
I think this error is coming because of the max() macro.
Try one thing. Just above the include of limit.h, put #undef max
|
|
|
|
|
Naveen wrote: #undef max
Maybe you are right! When I choose the "Go To Definition" menu item in the context menu, the ide open "windef.h", not STL's limit.
It does work when I undef max.
A Chinese VC++ programmer
|
|
|
|