|
in fact, what I realy want is not type string on window directly. I have a Bitmap object, I want add the string into the picture, then every time the picture be drawed(OnPaint function be called), the string will show out.
I want the string to be part of the background picture, splice them as one picture.;)
sorry, my English not very good, sometimes I expressed wrong ideas. thank you.
|
|
|
|
|
Use DrawText or Textout API's
Knock out 'T' from CAN'T ,
You 'CAN' if you think you 'CAN'
|
|
|
|
|
in fact, what I realy want is not type string on window directly. I have a Bitmap object, I want add the string into the picture, then every time the picture be drawed(OnPaint function be called), the string will show out.
I want the string to be part of the background picture, splice them as one picture.
sorry, my English not very good, sometimes I expressed wrong ideas. thank you.
|
|
|
|
|
When you type the text after that you can check the value of Enter Key and set make the edit control transparent.
Cheers
"Peace of mind through Technology"
|
|
|
|
|
like this
<br />
USES_CONVERSION;<br />
Graphics graphics(GetDC()->m_hDC) ;<br />
Image * img ;<br />
ImageAttributes imAttrib; <br />
img = Image::FromFile(A2W("c:\\A.jpg")) ;<br />
graphics.DrawImage(img,Rect(0,0,378,350),<br />
0,0,img ->GetWidth(),img ->GetHeight(),
<br />
CString str;<br />
str="Hello frined";<br />
<br />
Font Font(L"System", 16);<br />
PointF origin(50,50);<br />
SolidBrush Brush(Color(255,255,255));<br />
graphics.DrawString(A2W(str),str.GetLength(),&Font,origin,&Brush);<br />
<br />
whitesky
|
|
|
|
|
sorry, I think I express the wrong idea. please read my reply to other persons. thank you.
|
|
|
|
|
Asking for help!!!
|
|
|
|
|
Please tell me Difference between "C structure" and "C++ structure".
|
|
|
|
|
The variables in C structure are by default public but in C++ they are private
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
is it true that constructor will be called for class but there will be no constructor for the structure
|
|
|
|
|
Structures don't have constructors and how can they be called if they don't exist.
Yes but still what you say is correct. It would be better to initialize the member's of the structure somewhere(more preferrably the constructor of the class) before using them.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
We may have a Constructer's for C++ Structures(look the Following code)
C++ Structure's can be initialized/copied by overloading the Assignment Operator Like following
struct Mypoint
{
int x,y;
Mypoint() : x(0),y(0){};
const Mypoint &operator = (const Mypoint &me)
{
x=me.x;
y=me.y;
return *this;
};
Knock out 'T' from CAN'T ,
You 'CAN' if you think you 'CAN'
|
|
|
|
|
_AnShUmAn_ wrote: It would be better to initialize the member's of the structure
you can create Construtor in Structure, see the example i have quoted in post above you!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
NiLeSh KoRpE wrote: there will be no constructor for the structure
Have a try!
#include<stdio.h>
#include <malloc.h>
struct ab
{
ab()
{
printf("alok");
}
};
main()
{
ab a;
int *hello;
printf("Hi, Enter any value > ");
hello=(int*)malloc(sizeof(int));
scanf("%d",hello);
}
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
_AnShUmAn_ wrote: The variables in C structure are by default public but in C++ they are private
have you tried that?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Ok, I tried your code.
Its working fine.
Thanks for the update and clarification.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
_AnShUmAn_ wrote: Thanks for the update and clarification.
It's OK,I learn a lot while dicussing with you!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Hi !!!
YOu haven't right.
By !!!
-:KNOX:-
|
|
|
|
|
|
C allows struct, union, and enum types to be declared within function prototype scope, e.g.:
extern void foo(const struct info { int typ; int sz; } *s);
int bar(struct point { int x, y; } pt)
{ ... }
C also allows structure types to be declared as function return types, as in:
extern struct pt { int x; } pos(void);
C++ does not allow either of these, since the scope of the structure declared in this fashion does not extend outside the function declaration or definition, making it impossible to define objects of that structure type which could be passed as arguments to the function or to assign function return values into objects of that type.
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
Hi
I have image, that changes its position for every 1 sec.like a progress bar. Here I am drwing it using TransparentBlt() here the top position is -x. Now I am not able to erase the top -x portion. If I do InvalidateRect(), whole main window flickers. How can this be resolved?
|
|
|
|
|
WM_NCPAINT[^]
"What classes are you using ? You shouldn't call stuff if you have no idea what it does" Christian Graus in the C# forum
led mike
|
|
|
|
|
Non client area meant as out side the client area of that child window, but it is a part of the main window client area.
|
|
|
|
|
Can anybody please let me know in brief (if possible kindly give link or Example) Early and late binding VC++/C++.
|
|
|
|
|