|
Hi Guys!
I got a project and I need making about 15 Buttons Bitmapped!
(CBitmapButton derived class)
The bitmapping done but one problem:
- I need the bitmaps to be transparented with any selected color, the color that is actually the background of the whole bitmap if you know what I mean? ie. the RGB(255,0,255) is the back of a bitmap.
- I tried the region (RGN) stuff but has a problem with loading the rest of the images! (3 state images), it just blits the 1st in the sequnce.
In advacnce, I Thank you!
|
|
|
|
|
I believe MaskBlt allows you to blt images using colour keys. It is not supported by Windows 95, so I'm not sure ( I wrote my own so I had W95 support ). I don't believe there is any way to get the colour keying you want unless you build it yourself.
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
I! Okay Mate!
Is there a way of having a sample? ( You can *hotmale* me? )
Thank you.
|
|
|
|
|
How would I "hotmale" you (sic) when you posted anonymously ?????
Anyhow, I'd rather post here, just in case anyone else is watching. Here is a function from a toolbar class I am about to submit here. It takes a bitmap ID, a position and a colour to mask. You should be able from this to see how to draw your buttons onto a new bitmap using a mask colour - to set a background colour just do a FillSolidRect across the DC first.
void CGSToolbar::OnChangeButton(int BitmapID, int Position,COLORREF Transp)
{
// This one takes a resource ID and uses a transparent colour key.
// I only needed the key here, so I only put it in once, but it would
// be very easy to port the transparency code to the function above, if desired.
CImageList* pImageList = GetToolBarCtrl().GetImageList();
ASSERT(pImageList);
CBitmap pButton,pMask;
pButton.LoadBitmap(BitmapID);
BITMAP bm; //windows bitmap structure
::GetObject(pButton,sizeof(BITMAP),&bm);
// Create a mask using magenta as transparent
CDC MaskDC,PicDC;
MaskDC.CreateCompatibleDC(NULL);
pMask.CreateBitmap(bm.bmWidth,bm.bmHeight,1,1,NULL);
MaskDC.SetBkColor(RGB(0,0,0));
MaskDC.SetTextColor(RGB(255,255,255));
MaskDC.SelectObject(pMask);
MaskDC.BitBlt(0,0,bm.bmWidth,bm.bmHeight,NULL,0,0,BLACKNESS);
PicDC.CreateCompatibleDC(NULL);
PicDC.SelectObject(pButton);
PicDC.SetBkColor(Transp);
MaskDC.BitBlt(0,0,bm.bmWidth,bm.bmHeight,&PicDC,0,0,SRCINVERT);
PicDC.SetBkColor(RGB(0,0,0));
PicDC.SetTextColor(RGB(255,255,255));
PicDC.BitBlt(0,0,bm.bmWidth,bm.bmHeight,&MaskDC,0,0,SRCAND);
PicDC.DeleteDC();
MaskDC.DeleteDC();
pImageList->Replace(Position,&pButton,&pMask);
GetToolBarCtrl().SetImageList(pImageList);
Invalidate();
}
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
Thank you Christian! You are very much appreciated, including your sense of humour!
|
|
|
|
|
Hi,
How can I set the text/background color for message boxes?
Thank you.
|
|
|
|
|
How can I display a tooltip without moving the mouse over a control?
Thank you.
|
|
|
|
|
i wrote this class called "CShowTooltipAutomaticallyWithoutMouseMovement" that does exactly....
ok ... no ... sorry ... i didnt ... and i'll tell you why free of charge
imagine having a dialog box with 6 edit controls all showing tootips at the same time with no way to remove them ... it gets uglier when you consider that some of the edit boxes might be obscured by the tooltips of other edit boxes
maybe a slight redesign of the interface you are trying to achieve would make things easier and clearer for both you and your users
and i'm sorry ... i'm not meaning to be rude or anything but a little thought on interface design does go a long way
mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them
|
|
|
|
|
Hello, the codegurus around the world.
This requirement may be possible if we use Timer and SendMessage with
the dummy Mousemove and mouse position?
Unfortunetly, I don't have much time to try this
since I have my own project...
So, if anyone have a time, please write this cool class
Have a nice day!
-Masaaki Onishi-
|
|
|
|
|
masaaki i was kinda kidding
maybe its a cultural thing?
mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them
|
|
|
|
|
I search a class to create access database with tables,rows,all data types...
Thanks!
|
|
|
|
|
whilst i'm sure there is a class out there (as there is for anything nowadays) maybe you should just produce a sql script and execute it from within a setup program ... works for me
mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them
|
|
|
|
|
Is anyone knows how to Send a Broadcast over LAN but in function Send(...) define the addresses to send the way that it sends a Broadcast to LAN but not sends it to himself.
Thanks.
|
|
|
|
|
Is anyone knows how to Send a Broadcast over LAN but in function Send(...) define the addresses to send the way that it sends a Broadcast to LAN but not sends it to himself.
Thanks.
|
|
|
|
|
Is anyone knows how can isend a broadcast on the LAN through UDP protocol without
sending it to my self also?
( I'm talking about CAsyncSocket level ).
Thanks.
|
|
|
|
|
surely you just ignore messages that you know originated from you so to speak
mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them
|
|
|
|
|
<<< In the name of GOD >>>
Hi all.
How many messages is in MFC ???
In Class wizard is 2 kinds :
Group 1: Before the message name is V character. Example : OnCommand
Group 2: Before the message name is W character. Example : WM_CREATE
Please explain to me about different kinds.
Thanks.
Hadi Rezaie
|
|
|
|
|
<<< In the name of GOD >>>
Hi all.
When i use of SetCapture() statment in program,
In fact my mouse pointer is capture, it mean i can't
any work with mouse, For example i can't click on
buttons or menu , ...
Please explain to me how can i use of SetCapture()
with good performance.
My source code :
void CTestDlg::OnOK()
{
HCURSOR h_Cursor;
h_Cursor = AfxGetApp()->LoadCursor(IDC_MYPOINTER);
SetCursor(h_Cursor);
SetCapture();
}
Thanks.
Hadi Rezaie
Hadi Rezaie
|
|
|
|
|
from your code snippet i assume you have a mdi or sdi app that shows a dialog box where you set the mouse capture ... if you look at msdn for SetCapture() you will see it says that all mouse messages are directed to the window with capture (your dialog) regardless of where the mouse is ... hence your other bits wont get to see mouse messages
also if your dialog is modal it will consume any other messages for your app until it is dismissed
hope this helps
mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them
|
|
|
|
|
Salam Hadi! Chetovri?
Why/What do you need SetCapture() for, and why in such a function OnOK() would you need to change the cursor?
Where do you exactly want your cursor to change? I'll help you, excpect an email from me soon.
|
|
|
|
|
I think you need to handle the WM_SETCURSOR message .
Good luck,
Dror
|
|
|
|
|
Hi and thanks for your time!
I am working on a project and can not get MAPI to work in my NT Service (W2K) . I have the service logging in as "LocalSystem" (have also tried my Domain account but nothing happens) and there is no dependencies. The same code (minus some NT Service stuff) works in a normal MFC Exe. Here is the code:
...
...
...
LPMAPISESSION lpSession;
pMapiInit.ulVersion = MAPI_INIT_VERSION;
pMapiInit.ulFlags = MAPI_NT_SERVICE;
FLAGS flFlag = MAPI_NO_MAIL | MAPI_NEW_SESSION | MAPI_NT_SERVICE;
hr = MAPIInitialize(&pMapiInit);
if (!HR_SUCCEEDED(hr))
{
MessageBox (NULL, "MAPIInitialize failed.", "", MB_OK);
goto cleanup;
}
hr = MAPILogonEx(0L, (LPTSTR)"dmadden", (LPTSTR)NULL, flFlag, &lpSession);
if (HR_SUCCEEDED(hr))
{
// I never get here!!!!!
}
...
...
...
I would really appreciate help!!
Thanks in advance,
Dan
|
|
|
|
|
is "dmadden" the local system account?
mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them
|
|
|
|
|
Thanks for taking the time to respond!
I'm new at this Services game...dmadden is my domain account. Could you tell me what I need to do to get this reading the right one (if this is incorrect...remember it doesn't work even if I set it up to use my Domain account)? The Service needs to connect to a Domain account when it starts. The Server will (of course) also be in the Domain (not to mention the Server where the mailbox resides).
Thanks in advance,
Dan
|
|
|
|
|
Daniel two questions:
(1) Which account are you installing this app into the SCM??
(2) Have you tried specifying your FULL domain name for the account name??
(ie. instead of "dmadden" have you tried "<domain>\dmadden"??
|
|
|
|