how to write a string to my picture which is maintained by a Bitmap(GDI+) object?
-
I have a parent window, it has a Bitmap(GDI+) data member which draws a picture as background when OnPaint is called. I create an Edit control and type a string in it. now I want to write the string to the background picture, at the exact position the Edit control be. how to do that? help please:confused: I ever called DrawText in OnOK, find when OnPaint is called, my string will be covered by background. so I want to make the string be part of background picture, but I don't konw how to do. help, help, help....... -- modified at 2:39 Thursday 18th May, 2006
-
I have a parent window, it has a Bitmap(GDI+) data member which draws a picture as background when OnPaint is called. I create an Edit control and type a string in it. now I want to write the string to the background picture, at the exact position the Edit control be. how to do that? help please:confused: I ever called DrawText in OnOK, find when OnPaint is called, my string will be covered by background. so I want to make the string be part of background picture, but I don't konw how to do. help, help, help....... -- modified at 2:39 Thursday 18th May, 2006
you can see example in msdn CString str; CEdit m_Edit1; m_Edit1.GetWindowText(str); graphics.DrawString( A2W(str), 11, &myFont, origin, &blackBrush);_**
**_
whitesky
-- modified at 2:01 Thursday 18th May, 2006
-
I have a parent window, it has a Bitmap(GDI+) data member which draws a picture as background when OnPaint is called. I create an Edit control and type a string in it. now I want to write the string to the background picture, at the exact position the Edit control be. how to do that? help please:confused: I ever called DrawText in OnOK, find when OnPaint is called, my string will be covered by background. so I want to make the string be part of background picture, but I don't konw how to do. help, help, help....... -- modified at 2:39 Thursday 18th May, 2006
-
I have a parent window, it has a Bitmap(GDI+) data member which draws a picture as background when OnPaint is called. I create an Edit control and type a string in it. now I want to write the string to the background picture, at the exact position the Edit control be. how to do that? help please:confused: I ever called DrawText in OnOK, find when OnPaint is called, my string will be covered by background. so I want to make the string be part of background picture, but I don't konw how to do. help, help, help....... -- modified at 2:39 Thursday 18th May, 2006
Use DrawText or Textout API's Knock out 'T' from CAN'T , You 'CAN' if you think you 'CAN' :cool:
-
I have a parent window, it has a Bitmap(GDI+) data member which draws a picture as background when OnPaint is called. I create an Edit control and type a string in it. now I want to write the string to the background picture, at the exact position the Edit control be. how to do that? help please:confused: I ever called DrawText in OnOK, find when OnPaint is called, my string will be covered by background. so I want to make the string be part of background picture, but I don't konw how to do. help, help, help....... -- modified at 2:39 Thursday 18th May, 2006
like this
USES_CONVERSION; Graphics graphics(GetDC()->m_hDC) ; Image * img ; ImageAttributes imAttrib; img = Image::FromFile(A2W("c:\\A.jpg")) ; graphics.DrawImage(img,Rect(0,0,378,350), 0,0,img ->GetWidth(),img ->GetHeight(),//if picture is 378*350 UnitPixel,&imAttrib); CString str; str="Hello frined"; //m_Edit1.GetWindowText(str); Font Font(L"System", 16); PointF origin(50,50); SolidBrush Brush(Color(255,255,255)); graphics.DrawString(A2W(str),str.GetLength(),&Font,origin,&Brush);
_**
**_
whitesky
-
you can see example in msdn CString str; CEdit m_Edit1; m_Edit1.GetWindowText(str); graphics.DrawString( A2W(str), 11, &myFont, origin, &blackBrush);_**
**_
whitesky
-- modified at 2:01 Thursday 18th May, 2006
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' :cool:
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"
-
I have a parent window, it has a Bitmap(GDI+) data member which draws a picture as background when OnPaint is called. I create an Edit control and type a string in it. now I want to write the string to the background picture, at the exact position the Edit control be. how to do that? help please:confused: I ever called DrawText in OnOK, find when OnPaint is called, my string will be covered by background. so I want to make the string be part of background picture, but I don't konw how to do. help, help, help....... -- modified at 2:39 Thursday 18th May, 2006