|
Thank you for your comment.
But using GDI+, when you draw a text on transparnet background and save the image you will see that the font smoothing is completely good. It seems here font smoothing take place by Mixing Font color with Transparent color, using Alpha value in ARGB.
Also Applications like Photoshop do the job well. So there should be a win32(GDI)approach to drawing smooth text on transparent bitmaps.
in GDI+ the code is like to this:
Bitmap myBitmap=new Bitmap(100,100,Format32bppArgb);<br />
Graphic g=Graphics.FromImage(myBitmap);<br />
g.DrawString("Test", Font, Brushes.Black, 0, 0);<br />
myBitmap.Save("myBitmap.png",ImageFormat.Png);
|
|
|
|
|
How can I convert Glyph Index to Unicode encoding?
The GetCharacterPlacement API function is useful for convert a sequence of unicode carachters to Glyph Indices, but is there a solution for convert a sequence of Glyph Indices to unicode carachters?
(I asked this question in c# forum but I received no reply)
any help will be appreciated.
|
|
|
|
|
Is there any way to draw high quality text glyph by glyph using GDI+?
When we draw a String using GraphicsPath.AddString, The SubPathes in the main path are glyph outlines. but it seems in small fonts the quality of Drawing string this way is not acceptable.
Is the result of GraphicsPath.AddString equal to GetGlyphOutline API function?
(I asked this question in c# forum but I received no reply)
any help will be appreciated
|
|
|
|
|
Hello, This is Vikash
I have a project written in VC++.net 2005.
I am writing the same project in VB.net 2005.
Now the problem is in VC++.net, when i am using an array of bytes and adding bytes values, and while debugging when i see the values filled in the array, along with the byte it also shows some character.
Now I want to ask whether this is being shown by VC++ itself by default or something else.
Actually i have checked this and found that the character shown is actually the Character that the Byte represents as ASCII value.
eg. it shows 65 'A' as the value in the array element where 65 is the inserted byte.
Could you please tell me where this character is coming from.
Any help is appreciated.
Thanks in Advance.
|
|
|
|
|
VikashGohil wrote: Actually i have checked this and found that the character shown is actually the Character that the Byte represents as ASCII value.
eg. it shows 65 'A' as the value in the array element where 65 is the inserted byte.
You seem to have answered your own question. A byte with the value 65 represents the character 'A' in the ASCII encoding.
|
|
|
|
|
Hi,
Below is the line of code(C++) for Reading the Textfile line by line.
CString = strFilePath; // text path file path
ifstream Textfile;
Textfile.open(strFilePath,ios::in);
std::string value;
while(!Textfile.eof())
{
getline(Textfile,value); // Read line by line...
}
Textfile.close();
Now the question is I am having 40MB text file size. I need to read 1000 Lines in a single shot (And upto read 1000 times to reach the whole 40 MB size) not line by line. How to do this?
reg,
Subbu
|
|
|
|
|
you're still in the wrong forum.
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
All,
I have a C++/CLI assembly that is compiled for x64 and x86. These files get installed in C:\Program Files and Program Files (x86) respectively on 64 bit machines via a Visual Studio .NET 2008 setup project. I also need these two assemblies to be installed into the GAC so that other managed apps compiled as "Any CPU" will correctly load the right .dll. I can manually install these two assemblies into the GAC using "gacutil /i" but I'm having trouble figuring out how to set this up in a setup project in VS.NET 2008.
The setup project property "TargetPlatform" is configured for "x64".
The setup project File System looks like this:
Global Assembly Cache Folder\Managed.dll /* (x64) */
Global Assembly Cache Folder\Managed.dll /* (x86) */
Program Files (64-bit) Folder\{AppName}\Managed.dll /* (x64) */
Program Files Folder\{AppName}\Managed.dll /* (x86) */
Upon building the project, I get 2 warnings:
WARNING: Two or more objects have the same target location ('[gac]Managed\2.0.0.0_487e2f56c7456732\Managed.dll')
WARNING: Two or more objects have the same target location ('[gac]Managed\2.0.0.0_487e2f56c7456732\Managed.dll')
I'm suspecting that VS.NET 2008 won't support what I'm trying to accomplish but I wanted to do a sanity check with you guys first. If it is ineeded the case, does anyone have alternative approaches or installers that I can look into.
Thanks so much!
Jason Newell
www.jasonnewell.net
|
|
|
|
|
Hi,
I want to read Text File line by line and code follows;(with out using the << operator and char buffer)
ifstream Textfile;
Textfile.open(strFilePath,ios::in);
string value;
while(!Textfile.eof())
{
getline(Textfile,value);
}
Textfile.close();
When i am compiling the above code it throws the error as
error C3861: 'getline': identifier not found, even with argument-dependent lookup
How to rectify this error..
reg,
Subbu
|
|
|
|
|
Hi,
aren't you confusing standard C/C++ (see C/C++/MFC forum) with managed C++/CLI (this forum), where string class and File.ReadAllLines() would be useful (and getline is unheard of)?
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
If I'm not mistaken, geline() is a method - you need to call it on a
basic_istream object.
Maybe
Textfile.getline(Textfile,value);
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi,
I need the following Command need to be in a separate text file.
BYTE *Command;
long length;
// Assume Command holds some values after executing the Current Statement
OutEndpt->XferData(Command, length); //XferData used to transfer Data to USB
Now I need the Command to be write in a seaprate text file with the file length as length given above.
Anyhelp appreciated..
Thanks,
Subbu
|
|
|
|
|
Your question is unclear.
spalanivel wrote: I need the following Command need to be in a separate text file.
BYTE *Command;
long length;
How can this be in a text file?
spalanivel wrote: Now I need the Command to be write in a seaprate text file with the file length as length given above.
Are you using C++/CLI? If yes, classes under System::IO will help you to work with files. If you are using standard C++, you may need to check this[^] and this is not the right forum. Try C++/MFC forum instead.
|
|
|
|
|
Hi,
I'm pretty sure there is a quick answer to this, but I've spent hours on this an no progress...
SXSTrace shows that my DLL has a dependency of MS VC80 8.0.50727.4053 which exists on my development machine.
When I try to run my DLL on a Vista, or XP machine with .net3.5SP1, the highest version is .3053
How can I get Visual Studio 2005 to create a depend on an earlier version of MSVC80 ?
I have placed this line into my c++ file:
#pragma comment(linker, "\"/manifestdependency:type='win32' name='Microsoft.VC80.CRT' version='8.0.50727.762' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b'\"")
but this only succeeds in adding TWO dependency lines to my manifest:
<dependency>
<dependentAssembly>
<assemblyIdentity type='win32' name='Microsoft.VC80.CRT' version='8.0.50727.762' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' />
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly>
<assemblyIdentity type='win32' name='Microsoft.VC80.CRT' version='8.0.50727.4053' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' />
</dependentAssembly>
</dependency>
What is the correct way of doing this?
Many Thanks,
Dave Smith
--- EDIT: ---
Basically, I'm wanting to be able to bind to version 8.0.0.0 of VC80, not a particular version. This would solve my problem. Any suggestions on how to achieve it?
modified on Thursday, August 6, 2009 2:51 PM
|
|
|
|
|
|
I have a problem, i want to open an .xls file with one sheet in c++ builder and after that i opened the document i want to copy two columns in a .txt file with a tab between the columns.
|
|
|
|
|
Hi, I need your advice on the complexity involved in using a Windows forms GUI for a program that is written in unmanaged C++.
The program does data acquisition and live processing of data, all accomplished in native C++. I need to add a UI for the program that should basically allow the user to set the initial parameters, then once acquisition and processing begins the UI should show some status updates to the user and draw live plots of the processed data that the user would like to see.
I would rather use forms for the GUI due to the simplicity of the designer and ease of integration with VC++ (MFC is not an option), but I have only come to know of C++/CLI recently, which made me wonder about the difficulty involved with getting the form to call and interact with unmanaged code, compared to using a native C++ GUI design library like Qt (or something else you would suggest that is not MFC).
I have a short amount of time as I am on an internship, so I do not want to spend time learning the wrong library for the job. Any help you can provide would be greatly appreciated.
Thanks
|
|
|
|
|
If you don't expect portability, C++/CLI is worth trying. Developing a GUI with C++/CLI is trivial. You can do communication with your unmanaged API easily.
|
|
|
|
|
Portability isn't a priority since some of the core DLL's I am using only work with windows, though I suppose at least the Form code should be portable using Mono.
I have made a simple form and added a member function that is coded in native C++ (uses pointers, new/malloc, etc.) with no problems, so I guess my fears were unfounded. Though out of curiosity, how does this program work when some of its code is compiled to MSIL and others to machine code? and does that negatively affect performance during run-time?
|
|
|
|
|
Your native code will run at the usual speed, it won't operate any slower because it's running in the context of a managed application. The only performance issues you could potentially run into are the serialization/marshaling time required to use to convert your initial parameters from managed types to native types (negligible) and the resulting native data into managed types that can be plotted or otherwise shown on your form (probably negligible.) If you're talking about querying and plotting the data with seconds or more between each update, there shouldn't be much of a problem. If you're talking about updating multiple times per second, however, you could potentially run into some slow-downs.
Adam Maras | Software Developer
Microsoft Certified Professional Developer
|
|
|
|
|
Adding to the other reply, C++/CLI uses C++ interop to do managed - unmanaged communication. C++ interop is quite fast and you don't find much problems with that.
|
|
|
|
|
I have to convert a string of format "2009/07/30" to DATE in managed C++.
There is a parse method in DATE. But I don't know how to use that.
Please help me with the format.
|
|
|
|
|
DateTime myDate = DateTime::Parse("2009/07/30");
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
|
hello
I'm trying to pass multi-dimensional arrays from C# to un-managed WIN32 C++ dll - second parameter of each of the two functions exported below are meant to be OUTPUT parameter (memory allocated in C# however)
<br />
MATLABGENERICDLL_API void GetCurves(char* strParam, double * myCurve)<br />
{<br />
for(int i=0; i<10; i++)<br />
{<br />
if(i>0) {<br />
myCurve[i] = 1.01 * Curve[i-1];<br />
} else {<br />
myCurve[i] = 0.5;<br />
}<br />
}<br />
return;<br />
}<br />
<br />
MATLABGENERICDLL_API void GetMatrix(char* strParam, double ** myMatrix)<br />
{<br />
try {<br />
for(int i=0; i<10; i++)<br />
{<br />
for(int j=0; j<10; j++)<br />
{<br />
myMatrix[i][j] = 0.25;<br />
}<br />
}<br />
} catch( ...)<br />
{<br />
throw;<br />
}<br />
<br />
return;<br />
}<br />
GetCurves executed successfully, but not GetMatrix.
<br />
class Program<br />
{<br />
[DllImport(@"C:\MatlabGenericDll.dll")]<br />
private static extern string ToUpper2(string Src);<br />
<br />
[DllImport(@"C:\MatlabGenericDll.dll")]<br />
private static extern void GetCurves(string strParam, [In, Out] double[] myCurves);<br />
<br />
[DllImport(@"C:\MatlabGenericDll.dll")]<br />
private static extern void GetMatrix(string strParam, [In, Out] double[,] myMatrix);<br />
<br />
static void Main(string[] args)<br />
{<br />
string strTest = "abc";<br />
string strResult = null;<br />
<br />
double[] myCurve = null;<br />
double[,] myMatrix = null;<br />
<br />
try<br />
{<br />
strResult = ToUpper2(strTest);<br />
<br />
myCurve = new double[100];<br />
GetYieldCurves("AAA", myCurve); << For some reason, executed succssfully (Although I checked &myCurve - address seems to be different in C#/C++ layer so I really don't understand why it worked)<br />
<br />
myMatrix = new double[10, 10];<br />
GetMatrix("BBB", myMatrix); << System.AccessViolationException, complained saying memory probably corrupted.<br />
}<br />
catch (Exception ex)<br />
{<br />
Console.WriteLine(ex.ToString());<br />
}<br />
<br />
return;<br />
}<br />
}<br />
I'm not sure if I am doing right thing ... allocating memory from C# layer and if C# exe and C++ dll share same address space at all.
My end goal is: I actually also need to pass, from c# exe to unmanaged C++ dll, a two-dimensional array of undetermined size of different column types (string, doubles, int, DateTime)
Thanks!
http://msdn.microsoft.com/en-us/library/aa288453(VS.71).aspx
dev
modified on Thursday, July 30, 2009 2:00 AM
|
|
|
|