|
See if this article is of any help.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Is there such a code:
How to make screenShot to file...
Or how to save CBitmap,or hBitmap to file ?
(to BMP or JPG)
thanks.
|
|
|
|
|
use
KeyBD_Event() to Fire VK_SNAPSHOT (resemble PrtScr Button);
and Then COpy The BItMapDAta From using
OpenClipBoard and GetClipBoardData() api to get into HBITMAP HAndle
-----------------------------
"I Think It will Work"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
I found direct way how to get BMP
from desctop, without emulation user.
How to save it so BMP or better to JPG, GIF ?
CBitmap::serialize() ?
It only saves BMP ?
|
|
|
|
|
Hai,
HBITMAP bmp1;
bmp1=SHLoadDIBitmap(_T("D:\\Code Guru\\a.bmp"));
While I am debugging bmp1= not used, sometimes garbage value:
how shall I find the width and height of the bmp1.
BITMAP bminfo;
bmp1.GetBitmap(&bminfo);
When I use the above, It shows an error.
left of '.GetBitmap' must have class/struct/union type
Is there any other function instead of GetBitmap.
pDC->StretchBlt(0,0,rc.Width(),rc.Height(), &dcMem, 0, 0, bminfo.bmWidth, bminfo.bmHeight, SRCCOPY);
Note:
compatible for WinCE
DARWIN PAUL RAJ
|
|
|
|
|
S.DARWIN PAUL RAJ wrote:
HBITMAP bmp1;
bmp1=SHLoadDIBitmap(_T("D:\\Code Guru\\a.bmp"));
While I am debugging bmp1= not used, sometimes garbage value:
and
S.DARWIN PAUL RAJ wrote:
BITMAP bminfo;
bmp1.GetBitmap(&bminfo);
Buddy bmp1 is amember of HANDLE,and HANDLE is neither CLASS,STRUCT or UNION
-----------------------------
"I Think It will Work"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Try:
HBITMAP hBitmap = SHLoadDIBitmap(_T("D:\\Code Guru\\a.bmp"));
if (NULL != hBitmap)
{
CBitmap *pBitmap = CBitmap::FromHandle(hBitmap);
BITMAP bmInfo;
if (pBitmap->GetBitmap(&bmInfo) != 0)
{
...
}
}
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Thank you,
I got the result
CBitmap bmp;
HBITMAP bmp1;
bmp1 =SHLoadDIBitmap(_T("D:\\codeproject\\a.bmp"));
bmp.Attach(bmp1);
BITMAP bminfo;
bmp.GetBitmap(&bminfo);
CDC dcMem;
HBITMAP hbmpOld;
dcMem.CreateCompatibleDC(pDC);
hbmpOld =(HBITMAP)dcMem.SelectObject(&bmp);
pDC->StretchBlt(0,0,rc.Width(),rc.Height(),&dcMem, 0,0, bminfo.bmWidth, bminfo.bmHeight, SRCCOPY);
dcMem.SelectObject(hbmpOld);
Still one more problem,
When I stretched this bitmap into the entire screen, the controls(Button) which I placed above the bitmap not moved with bitmap, I want that todo,
Give your hand on this issue
regards
DARWIN PAUL RAJ
|
|
|
|
|
Hi,
I have a CEdit control which I move around to enable in-place editing of text elements within a List control. I use SetWindowPos to move it and am trying to use ModifyStyle to switch it between left justified text and center justified. However, ModifyStyle seems to have no impact on the text justification, any idea what I'm doing wrong?
Thanks,
Simon
|
|
|
|
|
srev wrote:
...any idea what I'm doing wrong?
Possibly nothing. Some styles cannot be changed at runtime. One solution would be to create two separate edit controls: one that has the ES_LEFT style and the other that has the ES_RIGHT style. Switch back and forth between the two as necessary. This is guaranteed to work.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Anyone knows how to capture events from the back/forward buttons in a 5-button mouse?
I've search far and wide and I have found nothing so far. This generally means that either it is really hard to do or it is too simple to bother.
How about it folks? Any thoughts, leads, discussion, will be appreciated.
Be well all.
|
|
|
|
|
I want to do a remote sensing image processing application, but the remote sensing images are always very large, ordinary image processing is not suitable, so I need some suggestion and help.
swandream
swandream
|
|
|
|
|
You need to tile the images, so you only handle/load/unload a few visible tiles at a time; I think the TIFF file format support that.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
I don't know how to process such situation as there is a image with 2002 pixels in width and 2004 pixels in height, if I tile it with block size 100*100, then the width will has 2 pixels remainder while the height has 4 pixels,how to deal with these remainders?
I have another question, how to process the gigabyte image, you just told me how to display. if I want to do some filters on the image, should I impose the filter methods to the whole image or only to the tile that can be seen. If I select latter, then how to deal with panning and scaling? thanks.
swandream
|
|
|
|
|
for the first part, I would think that you will need to create tiles that will not be full; just think what happens if you load an image in an image editor and the image is smaller than the viewport, you will see the background.
for the second part, you have the choice to either process the currently visible tiles, and when panning/scaling happens, process as needed, but depending on the filter, it will be really time consuming.
Depending on the application, can the user wait a few seconds/minutes ( depending on the image size ) to process the full image ? or that the user needs fast interaction, and "live" with lower quality processing, until, the full processing is asked for.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Hi everyone,
I would like to store a float (4 bytes) into an array of BYTE[4] byte by byte. How can I do it. I tried reinterpret_cast but that does not seem to work. Plus, I cannot use any MFC classes. Is there no way to cast a float into an array of bytes?
Thanks,
Pankaj
Without struggle, there is no progress
|
|
|
|
|
Hi,
Never mind this. I figured it out.
Best,
Pankaj
Without struggle, there is no progress
|
|
|
|
|
How did you do it then?
(so if I would ever need it I will know).;)
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
At a guess, he used a union
union
{
float f;
byte fb[4];
} name;
name.f = 1.0;
name.fb[0] etc...
If you vote me down, my score will only get lower
|
|
|
|
|
Hi
I am in the process of upgrading an older program written using MCF (in Visual 4.2).
Now I'm using VS .NET 2003 (still just C++). Some parts of the new program use Windows.Forms (external dll).
Is there an easy way of integrating the two - for example press a .NET button (e.g. of type System::Windows::Forms::ToolBarButton) to open a MFC dialog (of type CDialog)?
I don't want to rewrite everything as Windows.Forms (e.g. convert "CDialog" to "System::Windows::Forms::Form")
|
|
|
|
|
Hi!
I´ve a problem with EnumFontFamilies function.
There are fonts in my system (Arial Unicode MS, Batang, SimSun, PMingLiU,...) when I use EnumFontFamilies it returns some fonts two times. The second time with @.
Examples:
Arial Unicode MS @Arial Unicode MS
Batang @Batang
SimSun @SimSun
PMingLiU @PMingLiU
In the folder Fonts only there is a file and in the registry only there is a key for each font.
This problem only happens with some fonts.
Why? How is possible?
Thanks!
|
|
|
|
|
How about a snippet of code that produces the problem?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
// Load fonts
CClientDC dc(this);
EnumFontFamilies(dc, NULL, (FONTENUMPROC) MyEnumFont, (LPARAM) this);
int CALLBACK MyEnumFont(
ENUMLOGFONT FAR *lpelf, // pointer to logical-font data
NEWTEXTMETRIC FAR *lpntm, // pointer to physical-font data
int FontType, // type of font
LPARAM lParam // address of application-defined data
)
{
// TTF or Type1
if(!((lpntm->tmPitchAndFamily & TMPF_VECTOR) &&
(lpntm->tmPitchAndFamily & TMPF_DEVICE)) &&
!((lpntm->tmPitchAndFamily & TMPF_VECTOR) &&
(lpntm->tmPitchAndFamily & TMPF_TRUETYPE)) )
return TRUE;
// Then lpntm and lpelf contain an equal font to existing other one but with @
// For example I obtain SimSun and later @SimSun
...
}
Thanks!
|
|
|
|
|
HI ,,,
I m using VC++ 6 and DirectShow
Compiling in Release mood + Using MFC Static Library
following errors there ,,, but when i change to Shared DLL
there is no such error
Linking...
LINK : warning LNK4049: locally defined symbol "_strrchr" imported
thanx
Strmbasd.lib(wxdebug.obj) : error LNK2001: unresolved external symbol __imp__sprintf
Release/cam.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
|
|
|
|
|
Hello,
I have written a program which starts another program (VoicePad from IBM ViaVoice) via CreateProcess, searches its window on the desktop and sends WM_... messages via SendMessage/PostMessage. When the Open File Dialog box is launched, I can enter the filename via WM_CHAR and send a WM_COMMAND with IDOK to close the dialog box successfully.
Now my problem:
The program must be started hidden.
In CreateProcess's STARTUPINFO structure, I can specify SW_HIDE in wShowWindow, and the program does not display its application window.
However, the Open File Dialog box is always shown.
How can I hide the dialog box?
I know, the difficulty is that the dialog box belongs to a different process, but it is the single annoying thing which I have.
A thread which periodically checks if the dialog box is opened and
hides it instantly is not a good solution, since the dialog box
flashes a short time, and this is not what I want.
Regards,
Ulrich
|
|
|
|