|
OK,
For example,
I want to display the bitmap on a red background.
The bitmap image has also a background ( a black pen on a gray background ).
I want the bitmap background to be transparent, so the image (black pen)will apear on red background.
danginkgo
|
|
|
|
|
Then you have to go for option given by Paresh i.e. TrasparentBlt.
Regards,
Sandip.
|
|
|
|
|
OK, thanks
danginkgo
|
|
|
|
|
|
No, because the background is white, but there are some other white pixels within the bitmap. I don't want that all the white pixels to be transparent.
The alpha channel is defined only for the background pixels.
danginkgo
|
|
|
|
|
Changing direction for the solution, I wrote some software a while ago that put together irregular chunks of bitmaps (a jigsaw game).
pDC->SetTextColor (RGB(255,255,255));
pDC->SetBkColor (RGB(0,0,0));
pDC->BitBlt (pt.x, pt.y, m_rcOriginal.Width () + (2*m_nBorderSize), m_rcOriginal.Height () + (2*m_nBorderSize), &m_dcMaskBW, 0,0, SRCAND);
pDC->BitBlt (pt.x, pt.y, m_rcOriginal.Width () + (2*m_nBorderSize), m_rcOriginal.Height () + (2*m_nBorderSize), &m_dcTile, 0,0, SRCPAINT);
The SetText/BkColor are because the source DC was a 1bit colour depth DC, and acted as a mask. The background was white, and the middle area was black. So it made a black area on the destination.
The second BitBlt ORed in a DC which had the interesting bits of the picture. The area I wanted to be transparent was black, not grey.
This would mean adapting your code to two DCs, but that should not be too hard. It also would not work if you wanted partial transparency, but it does not appear that you do.
Lastly, you could get flicker if you were unlucky - so my whole drawing code is wrapped using Keith Rule's excellent CMemDC class.
Flicker Free Drawing In MFC[^]
Iain.
Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.
|
|
|
|
|
OK, thank you
danginkgo
|
|
|
|
|
Yesterday, I gave you code that demonstrates AlphaBlend() does indeed work.
Did you verify that your bitmap actually has alpha channel values set to
something other than 255?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
i am trying to send a CList of CString elements using SendMessage and WM_COPYDATA to another process. both processes are owned by me.
but the problem is at the receiving end that it gives access violation when i access list elements.
simple data members like int, char array are accessible.
i would like to know whether clist can be send using sendmessage.
thanks
|
|
|
|
|
MSDN documentation for WM_COPYDATA says
Remarks
The data being passed must not contain pointers or other references to objects not accessible to the application receiving the data.
Regards,
Sandip.
|
|
|
|
|
The documentation of WM_COPYDATA says that the data being passed must not contain pointers or other references to objects not accessible to the application receiving the data. The CList contains CStrings as the elements certainly encapsulate pointers which are not accecable by the remote process. So it should not be possible to send a CList object to another process by WM_COPYDATA.
|
|
|
|
|
You can easily serialize the CStrings into a byte stream and send them to the other process.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi,
I am currently using the dhtml control to assign the url fo picture element within the web page. After assigning url to image the thick blue border is gets displayed arround it.
For assigning Url I am creating MAP arround the image.
And also this sometimes displays and sometimes not.
I also viewed the HTML source for the wev bage I could not found any attribute which displayes this blue border.
I also previously posted this issue with othere forum and I found replay that I have to set explicitly "border=0" for that object.
But this is also not working.
Pleae help me for this... It's very urgent.
Thank you.
|
|
|
|
|
Hi,
I need to user IsUserAnAdmin api. This is available in shell32.dll. I can see this api through dependency walker. But the header file (shlobj.h) available in \Program Files\Microsoft Visual Studio\VC98\Include is not having this declaration. Can I know whether I need to upgrade any thing or replace any include,binaries.
Thanks,
Venkat
|
|
|
|
|
The documentation for the IsUserAnAdmin[^] states that:
This function is a wrapper for CheckTokenMembership. It is recommended to call that function directly to determine Administrator group status rather than calling IsUserAnAdmin.
Note This function is available through Windows Vista. It might be altered or unavailable in subsequent versions of Microsoft Windows.
It's not a good idea to use this function, but reading the documentation is. In fact, is you look at the documentation for CheckTokenMembership[^] you'll find sample code that pretty much does what you're after.
Steve
|
|
|
|
|
Thanks Steve. But I am also getting a compilation error while using CheckTokenMembership( )
|
|
|
|
|
First read this[^]. Since the minimum OS required for the CheckTokenMembership[^] function is Windows 2000 add/modify your stdafx.h file so it contains the following:
#define _WIN32_WINNT 0x0500
#define WINVER 0x0500
Note: I haven't tried this myself.
Steve
|
|
|
|
|
Thanks Steve.. But its still not working.
|
|
|
|
|
Ok, your original post contains the following:
\Program Files\Microsoft Visual Studio\VC98\Include
Looks like you're using MSVC6, which was released in 1998. Since Windows 2000 was released in (wait for it...) 2000 it's too old. Update to a newer SDK in addition to my previous suggestion. The latest version of the SDK that can be used with MSVC6 can be found here[^] (although I haven't downloaded from here myself).
Steve
|
|
|
|
|
I trying to create button with both icon and text using CBitmap::SetIco() but have some problem.
1. how can i move the icon to the left most of the button ?
2. The icon load from resource using AfxGetApp()->LoadIcon() doesn't have a correct size.
eg the size of icon is 64 * 64 but it alway appear as 32 * 32
are there any function that can load an icon as it original size
3.since I want both text and icon and also want my button
to retain the windows current theme (XP,Vista),so I dont using owner draw button
Thank in advance
|
|
|
|
|
I can't answer all of your questions, but I can answer one.
Instead of LoadIcon, use LoadImage, then you can specify the size of icon you're interested in.
Iain.
Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.
|
|
|
|
|
Hello everyone,
Here is the !pe output from WinDbg when there is an exception. It shows exactly the function name where exception occurs.
My question is, how to show the line in the source code which triggers the exception?
Here is WinDbg output.
0:000> !pe
Exception object: 0000000002651ac0
Exception type: System.Exception
Message: Hello Exception Debug
InnerException: <none>
StackTrace (generated):
SP IP Function
000000000012EFF0 00000642801501F4 TestDebug!TestDebug.Program.foo()+0x64
000000000012F030 000006428015014D TestDebug!TestDebug.Program.Main(System.String[])+0x2d
StackTraceString: <none>
HResult: 80131500
thanks in advance,
George
|
|
|
|
|
First check whether the source debugging is turned on or not. Also try configuring the source search path from File Menu.
Also try with the following commands
.lines enable source line information<br />
bp main set initial breakpoint<br />
l+t stepping will be done by source line<br />
l+s source lines will be displayed at prompt<br />
g run program until "main" is entered<br />
pr execute one source line, and toggle register display off<br />
p execute one source line
Please check WinDBG help file and confirm the steps specified under "Debugging in Source Mode"
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|
|
Thanks Sarath,
I have tried to type .lines and WinDbg displayed "Line number information will be loaded". Seems I enabled source code debugging, correct?
Here is my code, does it because it is managed code, and WinDbg has no ability to show managed code line number?
namespace TestDebug
{
class Program
{
static void foo()
{
int a = 100;
throw new Exception ("Hello Exception Debug");
}
static void Main(string[] args)
{
foo();
}
}
}
regards,
George
|
|
|
|
|
This is C#. This forum is for C++/MFC.
Steve
|
|
|
|