|
I built your project and played with it a bit but was not able to eliminate the issue. I consulted some of our DX code and things are very similar. We do create a DC render target instead of an HWND render target and set the flags to be GDI compatible but everything else looks similar. Our content is hosted within a WPF window so that's another difference.
Is this a high-DPI issue by chance? I run at 125% and didn't try your app at 100% (96 dpi). Perhaps some sizes need to be scaled differently.
I see that things stretch as the window is resized. So perhaps the drawing is extra compressed which causes the bitmap to be resampled?
Sorry I'm not much more help. I certainly feel your pain though.
John
|
|
|
|
|
I have now tested with several different font sizes. Looks ok at 36pt. Real bad result at 12pt: Even the two lines of text (rendered as one single text block) seem to have different sizes, see screenshot. This is definitively not ClearType.
I guess now I missed somewhere to enable ClearType and will give a close look to the sample Richard MacCutchan indicated to me.
Stretching of the text block upon resizing of the window is an undesired effect caused by the very simple design of the test, should be done better in a 'real' application.
|
|
|
|
|
I have also tried to switch from 100% to 125% -- same result (25% larger than in previous test, and my desktop got 'reorganized' by Windows). Gone back to 100%
|
|
|
|
|
Meanwhile, I have modified the test to a sole C++ application, and Ido still get the same (non-ClearType like) result. I am reposting this in the Graphics forum.
|
|
|
|
|
Hi Guys,
I am getting flicker while painting a border on control, bannerbar(its derived from CWnd only). So the case if control is getting focus , border should get paint otherwise not.
I am handling OnsetFocus and OnKillfocus and calling Paintborder() in which I checked if banner got focus(by checking m_BannerHasFocus flag) i will call parent->InavlidateRect() here i passed banner rect as argument.
In Onpaint I am taking PS_DOT pen (if its have focus) and PS_NULL if don' have focus.
I am getting flicker while its getting/loosing focus Even i pass FALSE parameter in InvalidateRect, which will not erase background.
Please help me out. I pasted source code here. Thanks
void CBannerBar::OnSetFocus(CWnd* pOldWnd)
{
CBaseWnd::OnSetFocus(pOldWnd);
// TODO: Add your message handler code here
m_BannerHasFocus = true;
PaintBannerBorder();
}
void CBannerBar::OnKillFocus(CWnd* pNewWnd)
{
CBaseWnd::OnKillFocus(pNewWnd);
// TODO: Add your message handler code here
m_BannerHasFocus = false;
PaintBannerBorder();
}
void CBannerBar::PaintBannerBorder()
{
//Invalidate the control in order to hide the focus rectangle.
CRect rect;
GetWindowRect(&rect);
CWnd* pParent = GetParent();
if (!rect.IsRectEmpty() && pParent != NULL)
{
pParent->ScreenToClient(rect);
pParent->InvalidateRect(rect, FALSE);
}
}
void CBannerBar::OnPaint()
{
CPaintDC dc(this); // device context for painting
// create a brush of the background color and paint the window with it
CBrush brush (BACK_COLOR);
dc.FillRect(&dc.m_ps.rcPaint, &brush);
brush.DeleteObject();
CDC* pDC = GetWindowDC();
CRect rect;
GetWindowRect(&rect);
rect.OffsetRect(-rect.left, -rect.top);
COLORREF dColour = GetSysColor(COLOR_HIGHLIGHT);
if (m_BannerHasFocus)
{
dColour = RGB(255, 0, 0);
}
CPen pen(m_BannerHasFocus ? PS_DOT : PS_NULL, 1, dColour);
CPen* penOld = (CPen*)pDC->SelectObject(&pen);
pDC->SetBkMode(TRANSPARENT);
pDC->MoveTo(rect.left, rect.top);
pDC->LineTo(rect.right - 1, rect.top);
pDC->LineTo(rect.right - 1, rect.bottom - 1);
pDC->LineTo(rect.left, rect.bottom - 1);
pDC->LineTo(rect.left, rect.top);
pDC->SelectObject(penOld);
ReleaseDC(pDC);
// Do not call CBaseWnd::OnPaint() for painting messages
}
|
|
|
|
|
You may want to try this in the C / C++ / MFC forum. This is C++ / CLI.
|
|
|
|
|
Good news for us C++/CLI devs! (a small but proud group)
A comment by Adam Welch [MSFT] in the vcblog post titled: Debug Visualizers in Visual C++ 2015[^] states that Microsoft is working on updating the Mixed Mode debugger to support debug visualizers. This is something I've personally requested for YEARS.
So I'm very happy to see that news and thought I'd pass it along here.
John
modified 8-Oct-15 9:55am.
|
|
|
|
|
Solve this. I have a malware spyware on this computer right now and a Samsung dealer with remote support put it here. It is in internet explorer my curser, files, net mass downloading,making other profiles and making your screen look normal. I found it in internet explorer's setting and right clicked and got some words that didn't make sense I followed it to a site that was and is still hooked to this computer probably watching me write this comment. I am not important, why do they want to spy on me? I watched it and got into their files where they write C++ code into everything. I had the internet off. My android phone off. When I turned my phone on it popped up a big red warning so I turned it off really fast, then waited 10 min turned it on and hit lookout really quick and blocked everything. Well I finally turned my phone back on and it is in there. I think it is a window's product because admittedly my windows is not genuine .They keep file logs of everything. They watch and listen to you. They have a bunch of squares they called emulation. they have a console veiw where they put enabled words into the code. They have a search and a Rendering box at the bottom At the top it says Elements,Network,Sources,Timeline and Profiles. I was so busy trying to get my profile back away from them I was actually reading the script that popped up when I clicked help telling me how to hack someones computer using C++ and code words. They have call stacks,DOM breakpoints,XHR breakpoints,Event listener breakpoints,It tells you how to go to the computers profile page and make names similar so the user won't know and take system control and ownership and permissions away. When the caught me I kept opening more windows and pushing buttons and deleting stuff etc. But they shut me down and I turned my computer back to an earlier time and they are still here. They caught me watching them I was trying to delete the extra accounts they made and they shut me down. but it had all the products they use to infect you could click on the one you needed and It had windows xp, vista, 7, 10 Linux, x box 360, x box one, Firefox opera, that new quota is them too.Android, The name of the company had a help website for big businesses. I wish I could have gotten the name it started with a bunch of xx's I have an old windows xp notebook I let my Grandson play on and I fiddled with it this morning until it became diseased I found the port and I am actually watching it now but it is way less suffocated than the one on my Window's 7 and android phone. Lookout did not log it and I have not asked for my stuff back yet but I know it is on my phone even with it being blocked every way possible. Any ideas on how to get this off? I tried to post this to comments in CW but it would not let me. I am really not a paranoid nut. I guess gmail is safe for now.
|
|
|
|
|
What does this have to do with C++/CLI?
Also, here's some whitespace " ", you really need it.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
I am a 60 year old woman with no computer skills. I put it under this heading because it was using C++ to hack peoples computers. I was typing fast so I could list everything I was seeing before they found out and blocked it again. I looked up white space so I guess that was an insult on my post being not grammatically correct.Instead of being a jerk you could have used your"jerk space" to tell me where I should have posted it.
|
|
|
|
|
Member 11983864 wrote: it was using C++ to hack peoples computers I think you have been watching too many spy films.
|
|
|
|
|
|
...and what does this have to do with Managed C++/CLI?
"I've seen more information on a frickin' sticky note!" - Dave Kreskowiak
|
|
|
|
|
Nothing whatsoever, but it is interesting to read OP's first and second comments.
|
|
|
|
|
Yes, I saw the OP's comments
"I've seen more information on a frickin' sticky note!" - Dave Kreskowiak
|
|
|
|
|
Hello,
I have a byte array that i want to set on a sqlserver database with ADO.NET.
I have an error message : Cannot convert 'signed char *' to 'System::Object ^'
What is wrong ?
Thanks in advance.
SqlConnection ^connection = gcnew SqlConnection(connectString);
connection->Open();
String ^ myRequete = "UPDATE COM_PKCS12 SET PKCS12 = @myPKCS12 WHERE ID = '" + System::Convert::ToString(id) + "'";
SqlCommand ^command = gcnew SqlCommand( myRequete, connection);
SByte * testByteArray = pkcs12Data->array;
command->Parameters->Add(gcnew SqlParameter("@myPKCS12", SqlDbType::VarBinary));
command->Parameters["@myPKCS12"]->Value = testByteArray;
int affectedrows = command->ExecuteNonQuery();
connection->Close();
|
|
|
|
|
Your code is vulnerable to SQL Injection[^].
NEVER use string concatenation to build a SQL query. ALWAYS use a parameterized query.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hello everybody!
at first I apologize for my weak English!
I use a shared library generated by MATLAB 2012b in VC++ 2012.
In my shared libray I have a function that takes two arguments and calculates normxcorr2 between them and return maximum calculated value:
function max = Normed_CC(template, image)
....
Now I want to send two variables of type cv::Mat from my vc++ program to it.
My problem is when I convert cv::Mat to mxArray and then send these new objects to "Normed_CC", normxcorr2 in Matlab side arise an exception with this theme:
"template at least must have two item".
sorry I don't remember exactly now because I'm not in work now and don't have access to my code...!
please help me to resolve my issue.
thanks in advance.
|
|
|
|
|
i'm a beginner and want to learn but i have problem !!
"error c2679 binary '<< ' no operator found which takes a right-hand operand of type "
when i used "cin"
my code is a simple as i said i'm beginner
it's :
#include <string>
#include <iostream>
using namespace std ;
int main ()
{
int age,weight ;
float bmi , height ;
string name , z ;
//for name
cout<<"Enter your name "<<endl ;
="" cin="">>name>>endl ;
//for age
cout<<"Enter your age "<<endl ;
="" cin="">>age>>endl ;
//for weight
cout<<"Enter Your Weight "<<endl ;
="" cin="">>weight>>endl ;
// for height
cout<<"Enter your Height In Meters"<<endl ;
="" cin="">>height>>endl ;
bmi=weight/(height*height) ;
if (bmi<18.5)
z= "You Are Underweight" ;
else if ((bmi>18.5) && (bmi<24.9))
z= "You Are Normalweight" ;
else if ((bmi>24.9) && (bmi<29.9))
z= "You Are Overweight" ;
else z= "obesity " ;
cout<<"Your BMI "<<"is "<
|
|
|
|
|
Part of your error message is missing, and you forgot to show which line produces the error.
|
|
|
|
|
Hi guys,
So VS 2015 has arrived and I'd like to retarget my /clr projects to build against .NET 4.6. The project Properties page shows ".NET Target Framework Version" => "v4.5.2". But this field is non-editable (Configuration Properties > General, Project Defaults, .NET Target Framework)
I updated the SDK targeting quite easily to target the Windows 10 SDK by selecting "10.0.10240.0" in the Target Platform Version combo. Why no similar combobox for .NET targeting? grr.
I feel like I'm missing something simple but MS has never really made it simple for us C++/CLI devs.
I think must resort to hand-editing the .vcxproj files directly? Surely not.
The Add Reference dialog isn't much help either but it does confirm that I'm targeting 4.5.2.
Have you upgraded your projects yet? Is there an easy way to switch them to targeting 4.6?
John
PS. The 'help' is worthless in the properties dialog. It takes me to a "Cannot find requested topic..." page. Help Viewer content and linking has really gotten worse in 2015 in my experience so far.
|
|
|
|
|
Answering my own question for future visitors.
You must hand-edit the vcxproj but it's a pretty simple change.
Old:
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
New:
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
John
|
|
|
|
|
Hi Guys!,
I'm developing program which receives name from user and create a new directory, then I've to a file with different name to that directory..
Idea is something like this:
- Name of directory to be created :
- Name of file : this file need to be saved to the created directory
I came across the use of 'mkdir', but i dont know how to use it properly
Can someone help me on this?
Thank you
|
|
|
|
|
|
That helps!. Thank you so much
|
|
|
|