After I call TextOut, it creates whitespace under the text over my colorful background???
very annoying!
Any ideas?
After I call TextOut, it creates whitespace under the text over my colorful background???
very annoying!
Any ideas?
Code:#include <cmath> #include <complex> bool euler_flip(bool value) { return std::pow ( std::complex<float>(std::exp(1.0)), std::complex<float>(0, 1) * std::complex<float>(std::atan(1.0) *(1 << (value + 2))) ).real() < 0; }
Have you tried SetBkColor()??
No, but will it work if the background is a loaded bitmap?
Anyway thanks for the tip, I'll try it as soon as I can get to my compiler...(sigh) one week away....!
Code:#include <cmath> #include <complex> bool euler_flip(bool value) { return std::pow ( std::complex<float>(std::exp(1.0)), std::complex<float>(0, 1) * std::complex<float>(std::atan(1.0) *(1 << (value + 2))) ).real() < 0; }
I've not tried it, but you could try;
Code:SetBkMode(hdc,TRANSPARENT);
Ok I'll definately try it...
Thanks fordy...
Code:#include <cmath> #include <complex> bool euler_flip(bool value) { return std::pow ( std::complex<float>(std::exp(1.0)), std::complex<float>(0, 1) * std::complex<float>(std::atan(1.0) *(1 << (value + 2))) ).real() < 0; }
Your device context will always be set to the default background color when it's created. If you change it, you must also 'tell' the device context what color it is, or it will print using the default background color. You can do as Fordy said, or you can call:
CDC::SetBkColor(COLORREF color);
(easiest way to do this would be using the RGB(0,0,0) macro)
This function will return the previous color the device context was using.
I just finished reading a chapter all about this, gotta show off my knowledge
Yes but again, the problem is, my background is a bitmap I've loaded!
I do have a little experience using bitshifting on bitmaps upon other bitmaps(such as background), but I do not *grok* how to do this with text created with TextOut....arghh!
Then CDC::SetBkMode(TRANSPARENT); should work. Does it? or did you get a chance to try it yet?
Unfortunately, I'll be away from my compiler for a few days, but, yes I will try it.
Also, if it doesn't work, I think i know what will...it's a little worked-up, but it may be the only solution:
-Calculate the area/position of the rect that the text will occupy
-Copy this area of the background to a temp DC
-TextOut the text
-OR the stored pixels onto the text area
This operation could easily be encapsulated in a function....
...will update y'all either way....