|
Hi Friends,
I'm newbie to the forum and MFC programming as well. I want to know 'How to get the image contents from the clipboard and write into a BMP file using MFC', Please do the needful.
Thanks ahead for every one.
|
|
|
|
|
Easy tiger, there's no need to shout!
|
|
|
|
|
Durga.Varun wrote: I'm newbie to the forum and MFC programming as well.
Hi there! Welcome aboard.
Durga.Varun wrote: I want to know 'How to get the image contents from the clipboard and write into a BMP file using MFC',
You need to read a book on MFC (if you are any good at Windows programming, then you could skip other chapters, just read the basics of the framework and jump on to the chapter that talks about dealing with bitmaps and GDI in MFC). After you finish it, you will be all set to go.
Durga.Varun wrote: Thanks ahead for every one.
Most welcome.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Thanks, I'll get on with some MFC books or on-line stuffs
|
|
|
|
|
|
Thanks for the link, I'll go through that.
|
|
|
|
|
hello all
i am using VS 6.0, VC++, Win32
My Task is to display png image on Transparent window.....
i used SetLayeredWindowAttributes to make my window transparent and it works fine......but the problem is my image also gets transparent and nothing is displayed ......
can anybody suggest me how to overcome this problem.....i.e only window should become transparent but not the image.....
Thankx:::
|
|
|
|
|
You can use an image with a solid colour applied in the parts that should be transparent. You then display the image using alpha keying, which renders the image except pixels that are this colour.
Here is code that displays an an image with 75% opacity, except for pixels that are RGB(255,0,0) - which are not displayed at all.
SetLayeredWindowAttributes(hwnd, RGB(255,0,0), (75*255)/100, ULW_COLORKEY|LWA_ALPHA);
If you remove the |LWA_ALPHA part, you get full opacity on all pixels except the red ones, which are not shown at all.
|
|
|
|
|
Thankx For ur reply
But it gives compilation error as
ULW_COLORKEY undefined
|
|
|
|
|
Oops, sorry about that - i forget which one it is, you need one of these #defines (I think it's the first one)
#define _WIN32_WINNT 0x0601
#define _WIN32_IE 0x0300
|
|
|
|
|
in both #defines i got the same error as
error C2065: 'ULW_COLORKEY' : undeclared identifier
|
|
|
|
|
I think you need one of these (put that into the PreProcessor settings of your project):
_WIN32_IE=0x0500
WINVER=0x0500
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
Taken from winuser.h (mingw 3.4.5)
#if (_WIN32_WINNT >= 0x0500)
#define LWA_COLORKEY 0x01
#define LWA_ALPHA 0x02
#define ULW_COLORKEY 0x01
#define ULW_ALPHA 0x02
#define ULW_OPAQUE 0x04
#endif
|
|
|
|
|
Hi all,
I am converting a double value to CString using format but it is giving negative value,
double val3 = val2/(1024*1024);
CString test_size;
test_size.Format(_T("%d"),val3);
AfxMessageBox(test_size);
Can anybody please tell me what is the error. i am coding in vc2008
|
|
|
|
|
What is val2?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
double
double val0 = c*bps;
double val1 = val0*spt;
double val2 = val1*h;
double val3 = val2/(1024*1024);
|
|
|
|
|
the answer depends on val2 ,so debug and see whats tha value coming for val2. use breakpoints.
||SnAkeBed||
|
|
|
|
|
For answering ur question please tell what is val2 and y u r using "%d"
||SnAkeBed||
|
|
|
|
|
SnaKeBeD wrote: For answering ur question please tell what is val2 and y u r using "%d"
My question itself was, what is "val2". May be you wanted to reply to the OP?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Double and integer are represented as a different binary format.
You should casting double to integer before passing a parameter.
test_size.Format(_T("%d"),(int) val3);
|
|
|
|
|
You are trying tackling with variable of type double variable. If you really wanna to cast the double into integer use casting as :
test_size.Format(_T("%d"),(int) val3);
or use proper format specifier :
test_size.Format(_T("%f"), val3);
- Malli...!
|
|
|
|
|
VCProgrammer wrote: Can anybody please tell me what is the error.
Yes: you haven't properly read the documentation about format specification fields, see for instance [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi all,
I need help in solving a problem using farpoint spreadsheet ActiveX control in vc6.
Application was developed by some other team long time back. i need to update the application, when i tried to open the application in vc6
application loading with the following error
ActiveX COntrol cannot be instantiated.
The activeX control "{E2454650-4D87-1102-B8B2-0000C00A958C} is not registered on this computer. Register the control and try again.
I tried registering using regsvr32 the following files came along with the application,which i think are the files of farpoint
fpspr70.dep (DOn know what to do with this file )
FPSPR70.ocx (registered using regsvr32)
fpspru70.dep(DOn know what to do with this file )
fpSpru70.ocx (registered using regsvr32)
spr32d70.dll<Not allowing me to register)
spr32du70.dll(Not allowing me to register)
SS70PP.dll (registered using regsvr32)
I need to know the exact reason fot the error and how to solve it.
Any help or ideas would be greatly appreciated.
Thank you
||SnAkeBed||
|
|
|
|
|
HI
I m havin a listbox and button.Once the user presses the button , a popup dialog should appper .That dialog contains a textbox .The data of the etxbox should be added to listbox in the previous window .
can anyone suggest me a idea?
Br
Gany
|
|
|
|
|
if any problem mail me r email id i ll mail u whole project
/////resource.h code
#define IDD_DIALOG1 101
#define IDD_DIALOG2 102
#define IDC_LIST1 1000
#define IDC_EDIT1 1001
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 103
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1002
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
////
////.rc file:::
u need to add to rc file for 2 dialog box
///
///main.cpp
#include <windows.h>
#include "resource.h"
HINSTANCE gInstance;
HWND ghwnd;
INT CALLBACK WndProc2(HWND hwnd2, UINT msg, WPARAM wParam, LPARAM lParam)
{
char Buffer[MAX_PATH];
switch(msg)
{
case WM_INITDIALOG:
return TRUE;
case WM_COMMAND:
{
switch((WPARAM)wParam)
{
case IDOK:
GetDlgItemText(hwnd2, IDC_EDIT1, Buffer, sizeof(Buffer));
SendMessage(GetDlgItem(ghwnd, IDC_LIST1 ), LB_ADDSTRING, 0, (LONG)Buffer);
EndDialog(hwnd2, 1);
return TRUE;
}
return TRUE;
}
}
return FALSE;
}
INT CALLBACK WndProc(HWND hwnd1, UINT msg, WPARAM wParam, LPARAM lParam)
{
ghwnd = hwnd1;
switch(msg)
{
case WM_INITDIALOG:
return TRUE;
case WM_COMMAND:
{
switch((WPARAM)wParam)
{
case IDOK:
DialogBox(gInstance, MAKEINTRESOURCE(IDD_DIALOG2), hwnd1, WndProc2);
return TRUE;
}
return TRUE;
}
case WM_CLOSE:
EndDialog(hwnd1, 1);
break;
}
return FALSE;
}
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCommandLine, int nShowCmd)
{
gInstance = hInstance;
DialogBox(hInstance, MAKEINTRESOURCE(IDD_DIALOG1), NULL, WndProc);
return 0;
}
|
|
|
|