|
I have on the screen a rich edit control (CRichEditCtrl) that needs to be printed/drawn on a different device. There is some graphics item also being drawn. I have tired different items to draw this text out and their results. These are:
- Using Format Range to output the text.
- The text comes out looking good. It does not line up with the graphics that are displayed on the screen in a WYSIWYG format. As an example; drawing a line at the end of a string on the screen. When printed this same string/line does not line up as it appears on the screen. The height of the font (lines are drawn at top and bottom) seem to indicate that the font height is correct.
- Using ExtTextOut with Kerning pairs to output the text.
- This palces the strings out nicely. The graphics looks pretty good when using variable pitch fonts.
- Using Courier New Regular, it too looks pretty good.
- Using Courier New Bold does not look good. The width of the text is smaller than it appears on the screen. The height again appears to be correct (with the line above the text and below).
- Using TextOut to output the text.
- This does not even appear to be close!
So, my question is there a better approach than the ones I have tried. I have the requirement to create a WYSIWYG editor that contains text/graphics. At first, I chose the Rich Text control so the users have the ability to change fonts within the control. With out using the FormatRange to print the text, I have to scan each character looking for a change in the font. The other problem, in the MSDN documentation, it states that to have a WYSIWYG text using the CRichEditCtrl, you need to associate the control with a printer. The problem is, when the user creates the document, this will not be known. I need to be able to have a device independent control and drawing.
If you are interested in seeing the test code that I'm using, please email me and I can zip it up and send it.
Any help would be appreciated.
Larry J. Siddens
Cornerstone Communications
TAME THE DOCUMENT MONSTER
www.unifier.biz
|
|
|
|
|
I'm now trying to get the position of the characters in the control, then outputting them seperately. Seems better, the graphics is much closer to what is on the screen. It is off some (about 1/2 of a character.) I'm wondering if it is a round off error?
Larry
Larry J. Siddens
Cornerstone Communications
TAME THE DOCUMENT MONSTER
www.unifier.biz
|
|
|
|
|
In progam I need to do own tray how I can do this?
|
|
|
|
|
What is Own Tray? I have never heard of this.
Magnus
|
|
|
|
|
Are you asking how to add your program's icon to the tray in the lower right corner of the taskbar? If not, I do not understand your question.
|
|
|
|
|
Sorry for bad english....
My program works instead of standard shell Explorer.
I it is necessary to do in program something like standard tray.
Take any advices. For earlier thank you.
|
|
|
|
|
i want to embedd Microsoft Speech Recognition Engine in my VC++ application what can i do.
i am using windows 2000 operating system on my pc.
i am very thankful to u if any one tell me all the API related to this SDK and send me any simple Applicaiton that uses "Microsoft Speech Recognition Engine" using VC++.
Thanks in Advance
Faizi
|
|
|
|
|
|
I'm trying to use the GetNumberFormat API for integer values. No fractional digits and no decimal seperator should appear in the output. I want to use the API to account for locale settings. The results should look similar to the file sizes in Explorer's File Properties dialog.
|
|
|
|
|
Ok, so what's the problem? Do you have a code snippet that is producing a compiler or run-time error?
NUMBERFMT fmt = {0,0,3,"",",",1};
char szNumber[16] = "123456",
szFmtNumber[16];
GetNumberFormat(GetThreadLocale(), 0, szNumber, &fmt, szFmtNumber, sizeof(szFmtNumber));
|
|
|
|
|
I don't get an error, I don't want to use the NUMBERFMT structure but use the user locale settings for the number format, only without the fractional part. Maybe there's an API to get the number format, but apparently it's not GetNumberFormat And I wanted to avoid having to call GetLocaleInfo for each member of the NUMBERFMT struct.
|
|
|
|
|
You can't eat your cake and have it too. The whole premise behind using locale settings is so that applications won't make assumptions as to what the user wants. If the user sets up their machine to have , (comma) as the thousands separator, you mustn't override that with something else, or remove it altogether. Same goes for fractional digits, decimal points, negativity, etc.
I have a slightly similar situation with the project I am working on. It's a scheduling application, which makes heavy use of dates and times. The application has to work no matter what locale it is in, or what regional settings are in place. Luckily, the NLS functions minimize the pain.
|
|
|
|
|
Hi All,
I Want to develop a plugin for Adobe photoshop...I dont have any idea how to proceed with the idea, does anyone has any clue..how to start with it...any idea or pointers or tutorials..will be very helpful..Looking forward to all you guys for help???please...Thanks a lot in advance..
Himanshu
|
|
|
|
|
|
Has any one ever tried to integrate visualization toolkit in Visual C++?
I am new to both Visual C and VTK.So I have serious problems.
I have added the path for VTK libraries and headers to tools->options->directories
and projects->setting->links
but I still get following errors:
Linking...
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/sample.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
Can anyone help?
Regards
|
|
|
|
|
i have a problem.i want to split a CString into a CStringArray which of each element holds a fixed length characters.
for example:
CString str;
CStringArray strArray=new CStringArray();
str="abcd";
afert spliting action,the result should be below:
the value of strArray[0] is "ab"
the value of strArray[1] is "cd"
how can i do?
thanks!!
Habbit--Beginner In MFC
|
|
|
|
|
<code>
{
#define STR_WIDTH 2
CStringArray arrStrings;
CString strSource(_T("abcdefghi"));
int nPosition(0);
while(nPosition < (strSource.GetLength()-1))
{
arrStrings.Add(strSource.Mid(nPosition,STR_WIDTH));
nPosition+=STR_WIDTH;
}
}</code>
or something of this effect. NB: this is untested.
I Dream of Absolute Zero
|
|
|
|
|
that's fine!
you are a good man!
|
|
|
|
|
Hi !
I'd like to have in my application a console window. To do it, I just have a normal multiline edit control, which I would have to use to implement by myself the console functionalities.
I tried to think how to do it, but I have no idea how to solve these points :
-How can I make sure the cursor will stay at the prompt if the user click anywhere else ?
-How can I make sure that, even if the cursor stays at the prompt, the user will be able to select some text and copy it.
-How can I make sure that any keyboard input will be captured by my console window ?
Any suggestions or help will be greatly appreciated !
Thanks !
Jerome
|
|
|
|
|
Jerome Conus wrote:
I'd like to have in my application a console window. To do it, I just have a normal multiline edit control...
An edit control implies a GUI application.
If you meant something else, I missed it. Please elaborate more.
|
|
|
|
|
Yes, it is a GUI application, but the user is allowed to display a small terminal window (console window) in which he/she will type some commands to display internal states of the application.
I hope I made myself clear, now !
Jerome
|
|
|
|
|
Yes, more clear, but still not feasible to my knowledge. In other words, I know of no way to put a console window on top of a GUI window such that it acts like any other type of control.
What you could do, however, is to use two edit controls, one for input and the other for output. You'd type commands into the one box, send them to a hidden console window, and capture the output in the other edit control. See here and MSDN article Q190351 for a better explanation.
|
|
|
|
|
I know exactly what you mean and I am trying to do the same thing. We don't want a "console" as in a DOS prompt, we want a control that lets us display a prompt, get user input, take some action, display results in the same window. MatLab and SciLab do this to allow the user to enter commands to do math and then it prints out the result in the window.
|
|
|
|
|
hi,ive just started to use visual c++,i'm working on program that can draw different shapes,the problem is that i dont know how to save the drawing in an appropriate format which i can open latter.plz help.urgent
|
|
|
|
|