|
hello frds ,
i stuck at the point of filling pixels in bitmap file....
Problem:
i have to genarate a .bmp file thas why i write a BITMAPFILEHEADER and BITMAPINFOHEADER structure in file.
now i face difficult to fill colors in that file.
i am not getting what is palatte and rgb quad.
I directly put the value of rgbquad in file like
fwrite(&rquad,sizeof(rquad),1,image);
it doent work!!!
reply
thanks in advance !!
Rahul here
|
|
|
|
|
Hi rahul.shendurnikar,
Do you want to create bitmap and draw color on the bitmap
|
|
|
|
|
hello frds ,
i stuck at the point of filling pixels in bitmap file....
Problem:
i have to genarate a .bmp file thas why i write a BITMAPFILEHEADER and BITMAPINFOHEADER structure in file.
now i face difficult to fill colors in that file.
i am not getting what is palatte and rgb quad.
I directly put the value of rgbquad in file like
fwrite(&rquad,sizeof(rquad),1,image);
it doent work!!!
reply
thanks in advance !!
Rahul here
|
|
|
|
|
What does __RPC_FAR do?
typedef /* [unique] */ IDispatch __RPC_FAR *LPDISPATCH;
What does this signify?
Thanks for helping!
---
With best regards,
A Manchester United Fan
The Genius of a true fool is that he can mess up a foolproof plan!
|
|
|
|
|
Save My Soul - (SMS) wrote: What does __RPC_FAR do?
typedef /* [unique] */ IDispatch __RPC_FAR *LPDISPATCH;
What does this signify?
16 bit environments used to have near and far pointers, and __RPC_FAR used to indicate a far pointer. It is provided for compatibility reasons, it is defined as nothing.
Nibu thomas
Software Developer
|
|
|
|
|
Hi all,
How can I change the font of the dialog dynamically. I have tried SetFont from OnInitDialog() function.But it dosen't work.
Please help me
Thanks in advance
Naveen.R
nave
|
|
|
|
|
1. place the following string somewhere in your "stdafx.h" file:
#include <afxpriv.h>
2. override DoModal() function in your dialog class:
int CSampleDialog::DoModal()
{
CDialogTemplate dlt;
int nResult;
// load dialog template
if (!dlt.Load(MAKEINTRESOURCE(CSampleDialog::IDD))) return -1;
// set your own font, for example "Arial", 10 pts.
dlt.SetFont("Arial", 10);
// get pointer to the modified dialog template
LPSTR pdata = (LPSTR)GlobalLock(dlt.m_hTemplate);
// let MFC know that you are using your own template
m_lpszTemplateName = NULL;
InitModalIndirect(pdata);
// display dialog box
nResult = CDialog::DoModal();
// unlock memory object
GlobalUnlock(dlt.m_hTemplate);
return nResult;
}
It may be reasonable to choose a font for your dialog box according to user-specified schemes (those in Control Panel / Display / Appearance). Unfortunately I was unable to find any simple ways to get font settings for the dialog boxes. A possible alternative is to use font settings for icon titles and some related controls (like tree and list controls), that can be retrieved by SystemParametersInfo() function. Here is a simple procedure that returns the face name and the size in points for this font:
void GetSystemIconFont(CString& strFontName,int& nPointSize)
{
LOGFONT lf;
// get LOGFONT structure for the icon font
SystemParametersInfo(SPI_GETICONTITLELOGFONT,sizeof(LOGFONT),&lf,0);
// getting number of pixels per logical inch
// along the display height
COLOR="#990000">
HDC hDC = ::GetDC(NULL);
int nLPixY = GetDeviceCaps(hDC, LOGPIXELSY);
::ReleaseDC(NULL,hDC);
// copy font parameters
nPointSize = -MulDiv(lf.lfHeight,72,nLPixY);
strFontName = lf.lfFaceName;
}
Ashok Reddy
|
|
|
|
|
1. place the following string somewhere in your "stdafx.h" file:
#include <afxpriv.h>
2. override DoModal() function in your dialog class:
int CSampleDialog::DoModal()
{
CDialogTemplate dlt;
int nResult;
// load dialog template
if (!dlt.Load(MAKEINTRESOURCE(CSampleDialog::IDD))) return -1;
// set your own font, for example "Arial", 10 pts.
dlt.SetFont("Arial", 10);
// get pointer to the modified dialog template
LPSTR pdata = (LPSTR)GlobalLock(dlt.m_hTemplate);
// let MFC know that you are using your own template
m_lpszTemplateName = NULL;
InitModalIndirect(pdata);
// display dialog box
nResult = CDialog::DoModal();
// unlock memory object
GlobalUnlock(dlt.m_hTemplate);
return nResult;
}
It may be reasonable to choose a font for your dialog box according to user-specified schemes (those in Control Panel / Display / Appearance). Unfortunately I was unable to find any simple ways to get font settings for the dialog boxes. A possible alternative is to use font settings for icon titles and some related controls (like tree and list controls), that can be retrieved by SystemParametersInfo() function. Here is a simple procedure that returns the face name and the size in points for this font:
void GetSystemIconFont(CString& strFontName,int& nPointSize)
{
LOGFONT lf;
// get LOGFONT structure for the icon font
SystemParametersInfo(SPI_GETICONTITLELOGFONT,sizeof(LOGFONT),&lf,0);
// getting number of pixels per logical inch
// along the display height
COLOR="#990000">
HDC hDC = ::GetDC(NULL);
int nLPixY = GetDeviceCaps(hDC, LOGPIXELSY);
::ReleaseDC(NULL,hDC);
// copy font parameters
nPointSize = -MulDiv(lf.lfHeight,72,nLPixY);
strFontName = lf.lfFaceName;
}
Ashok Reddy
|
|
|
|
|
Thanks ashok..it works.
Should i have to overide the Create() function so that the font will change when dialog is created as Modless?
nave
|
|
|
|
|
Yes..
Override create for modeles dialog.
Try that and revert me back whether it works fine or not.
Thanks & Regards,
Ashok
|
|
|
|
|
Halo Naveen,
I think you have not updated your dialog data after setting the font. After you finish setting the font in dialog, do UpdateData(0); If the problem is something else, I could give you a small sample code snippet on how to set a font. Please let me know of anything.
Regards,
Rajesh R. Subramanian
You have an apple and me too. We exchange those and We have an apple each.
You have an idea and me too. We exchange those and We have two ideas each.
|
|
|
|
|
Can u show me the sample? I have tried updateData(0). it dosen't work
nave
|
|
|
|
|
Please send me the site addresses for changing the skin.
Is there any possibility to change the skin through code?
Please reply ASAP.
Thanks & Regards,
Ashok.
Ashok Reddy
|
|
|
|
|
Skinning[^] a dialog.
Nibu thomas
Software Developer
|
|
|
|
|
|
|
what I know is the path of the file.
and I want to adjust the size of the image on the dialog, too.
Thank you very much!!!
-------------------
I am learning C++ and English
|
|
|
|
|
You can use a combination of LoadImage and StretchBlt .
Nibu thomas
Software Developer
|
|
|
|
|
And
CBitmap and StretchDIBits
|
|
|
|
|
I think this way is good
#include AtlImage.h
CImage m_Image;
m_Image.Load("c:\\picture.bmp");
//m_Image.BitBlt(GetDC()->m_hDC,CRect(0,0,800,600),CPoint(0,0));
m_Image.StretchBlt(GetDC()->m_hDC,CRect(0,0,200,200),CRect(0,0,800,600));
|
|
|
|
|
Hi ewighell,
There are some steps of doing this:
[1] Load the bmp in mem. Your can use CBitmap::Load to do this. the CBitmap class can give you a handle (HBITMAP) to this bitmap.
[2] Create a dc by using CDC::CreateCompatibleDC; select the bmp handle into this dc (CDC::SelectObject).
[3] Override the dialog's OnPaint function. use CDC::Bitblt or CDC::StretchBlt to render the bmp on to dialog surface.
Regards,
Chris
|
|
|
|
|
Hi guys,
what is DLL Hell?. whether Assembly is alternate to DLL?.
Any help in this regards are greatly appreciated.
Thanks n regards
Vivek.S
You only have to do a very few things right in your life so long as you don't do too many things wrong.
|
|
|
|
|
|
|
i want to read value of cookie from webpage thorogh MFC by passing the cookie information(name etc) throgh URL.
please reply me how it is possible.
Bankey Khandelwal
Software Engineer
|
|
|
|