|
How are you drawing the image and which control are you using?
The StretchBlt function can stretch an image.
|
|
|
|
|
Currently i m using a Text control as a banner,coz i want to display the dialog name at the center of banner.
can i also this for image,or use Picture control for image.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
You can only display text in a text control.
For an image, you will need a picture control.
|
|
|
|
|
I want to use both,text in the center of banner,and image at top upper side of dialog and form.
please tell me how can i do this.
thanks in advance.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
Why don't you simply place a text box in the middle and a picture control at the top of the dialog?
|
|
|
|
|
ok,now please tell me how can i stretch the image?
please if possible please explain me with example.
thanks.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
Use LoadImage to load the image.
Here you can specify the width and height needed.
Associate a CStatic object to the picture control.
Now use CStatic::SetBitmap to show the bitmap.
|
|
|
|
|
everything is working fine now,only one problem is there,image not displayed at back of text control.
i m place text control in top center,and stretch the image from top-left to top-rite.
its stretch succussfully,but the back of text contol hide some portion of image please tell me now wat can i do?
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
What if you "printed" the text on the image so that they are rendered together (as one)?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
The text control has a property called Transparent .
Set this to True .
|
|
|
|
|
CDC* dc=this->GetDC();
HDC memdc;
this->GetClientRect(&rect);
CBitmap bitmap;
bitmap.LoadBitmapA(IDB_HEADER);
BITMAP bm;
bitmap.GetBitmap(&bm);
int w = bm.bmWidth;
int h = bm.bmHeight;
memdc=::CreateCompatibleDC(dc->m_hDC);
::SelectObject(memdc,bitmap);
StretchBlt(dc->m_hDC,0,0,rect.Width(),50,memdc,0,0,w,h,SRCCOPY);
CString Title="";
m_Banner.GetWindowTextA(Title);
dc->SelectObject(m_Banner.GetFont());
dc->SetBkMode(TRANSPARENT);
dc->DrawText(Title, rect, DT_CENTER | DT_WORDBREAK);
i do like this.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
PLease help me.
i m stretching the image horizontally successfully.
i m using this code in OnPaint function.
when i change the DPI from 60 to 120,than than the form display with the vertical scrollbar,and when i scroll the form the stretched image is display distorted.
please help me how can i solve this.
thanks.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
Hi All
How to Print Unicode characters/Strings . I am able to print ansi characters ,but unicode it shows "???" .
My code to draw text in print DC
DrawText(
pDC->m_hDC,
(LPCTSTR)str,
str.GetLength(),
rcDataRect,
DT_WORDBREAK| DT_VCENTER | DT_LEFT
);
thanks
Bruno
|
|
|
|
|
I guess you need to select that particular font into the device context.
|
|
|
|
|
|
Hi all..
i need to know how we can display the last saved data in the listbox after closing and opening the exe again..
plz help
|
|
|
|
|
Serialize the data. If you're using MFC, see Serialization[^]
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
sonualex wrote: ...the last saved data...
Since you are saving the data, why can you not restore it? Or did I misunderstand your question?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hi David..
I have written few data in my edit box .. and saved it... I closed the exe.. the next time I open the exe I want to see the last saved data in that edit box... hope u got my question
can u help..
thanks in advance
|
|
|
|
|
sonualex wrote: ...the next time I open the exe I want to see the last saved data in that edit box...
Use SetWindowText() .
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
thanks for the reply david..
iam using a CString variable..
i shud keep the SetWindowText while saving the data or in OnInItDialog.. both i have tried but cudnt find any result...
|
|
|
|
|
Where are you saving the data to?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
iam saving the data to a text file.. but thats just for my understanding.. what i need is somekind of a temporary saving of data and then display the data once I open the application again
|
|
|
|
|
sonualex wrote: what i need is somekind of a temporary saving of data and then display the data once I open the application again
Which means storing the data in the registry (if the amount of data is small), or a file.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hello Friends
I want to use setWindowTitle in my win32 based application.
But I m not able to use.can you please tell me the header file to use this.
Thanks & Regards
Yogesh
|
|
|
|