|
Hi all,
I'm switching from GDI to GDI+. With GDI, I was able to make the background color transparent using this tutorial.
http://winprog.org/tutorial/transparency.html[^]
I'm looking for a way to accomplish the same thing. I basically wanna turn the color black transparent in my bitmaps. Surely, there has to be a way to do that...
|
|
|
|
|
first thing:
if u have an image which is having transparent color then gdi+ automatically handles it
otherwise convert the pixel format to PixelFormat32BppARGB
secondly
the A part of ARGB holds the transparency value
change this value for the pixels to be transparent.
enjoy
|
|
|
|
|
refer to Color class of GDI+
|
|
|
|
|
I am using either map or vector to store the data. Now my data is in Struct. How do I store this data coming in...using vector or map....
Thanks!!
|
|
|
|
|
Vector:
#include <vector>
struct Whatever
{
int x;
};
int Store(Whatever const& w, std::vector<Whatever>& vw)
{
vw.push_back(w);
}
Map (presuming int as key):
#include <map>
struct Whatever
{
int x;
};
int Store(int id, Whatever const& w, std::map<int, Whatever>& miw)
{
miw.insert(std::make_pair(id, w));
}
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi
I designed a Toolbar class which is derived from CToolBar. The "AddButton" can not load bitmap for the buttons.
bool CMyToolbar::AddButton(int nIndex, UINT Cmd, UINT BitmapResId)
{
TBBUTTON tb;
tb.idCommand = Cmd;
tb.fsState = TBSTATE_ENABLED;
tb.fsStyle = TBSTYLE_BUTTON;
tb.dwData = 0;
tb.iString = NULL;
GetToolBarCtrl().InsertButton (nIndex, &tb);
GetToolBarCtrl().LoadImages(BitmapResId, AfxGetInstanceHandle());
return true;
}
Can you help to locate the BUG?
Best regards,
|
|
|
|
|
You probably need to set tb.iBitmap .
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
i want to create MFC based project in visual studio c++ 2005 and want to run and see my window(such as add buttons, sample text boxes, and other control objects) that i have write code.
plz help me. i want to create MFC based project and run..........
|
|
|
|
|
Try Wizard(File - New - Project)
|
|
|
|
|
As the other one suggested, using the wizard is a good start.
I suggest you use google to find a good beginner's tutorial; or use your local public library (or book store) to find a beginner MFC book.
This signature was proudly tested on animals.
|
|
|
|
|
In Visual Studio 2005:
Click File->New->Project
In the wizard under the visual C++ label you should have "MFC", then on the right side select the most suitable project type you need.
When the wizard is finished hit F5 to compile and run your the test application Visual Studio generated for you. There should be buttons and sample text i believe.
RM
|
|
|
|
|
13 essential skill in vc++ by steven holzner
is a good book for starters
--------------------------------------------
Suggestion to the members:
Please prefix your main thread subject with [SOLVED] if it is solved.
thanks.
chandu.
|
|
|
|
|
|
Maybe he's just a retard.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
John Simmons / outlaw programmer wrote: Maybe he's just a retard.
FTFY
___________________________________________
.\\axxx
(That's an 'M')
|
|
|
|
|
you asked before, and got several answers which seemed to be good starting points. I personally defended you from some of those who despaired at your original post. we should be helpful to those trying to learn, I felt.
but you didn't reply to those answers and have just posted essentially the same question again.
So - did you not bother to read those answers? did you not understand them?
If you don't even TRY to help yourself, you're going to find it pretty hard to get help from anyone - and I think you have already outstayed your welcome on CP
___________________________________________
.\\axxx
(That's an 'M')
|
|
|
|
|
Hay,
I looking for open source code in c language which schedule/deschdule a functions that will run in a new threads, so for example I can schedule the function to run every 30 minutes in new tread.
I want to use this source in my program as an infrastructure service.
I prefer using a source which will compiled on Linux and Windows platforms.
Please, any help - link
|
|
|
|
|
You mean code to create a thread?
just use
DownlinkThread = CreateThread(
NULL, // default security attributes
0, // use default stack size
Func, // thread function
0, // argument to thread function
0, // use default creation flags
&MsgThreadId); // thread identifier
The thread function is
WORD WINAPI Func( LPVOID lpParam )
{
while(1)
{
Sleep(30 * 60 * 1000);
}
return(0);
}
Substitute CreateThread with pthread_create and Sleep with uSleep for the Linux version
|
|
|
|
|
I know how to di it, I looking for more complicated thread events infrastructure which I can schedule to promise order and timing of events.
What aboute to schdule event to run (every 30 seconds, or to kill all created threads in one time.
I looking for the source of it as part of sharing code via the internet, and also learn new ideas.
BTW I found till now the "cheap thread" - a library of portable C routines to implement cooperative multitasking with prioritized scheduling, but they actully not using thread creation.
Any other links?
|
|
|
|
|
I created an MFC application and added Printing and Print Preview capability to a CMyFormView derived from CFormView. The problem I have is
that the "Prev Page" and "Zoom Out" buttons on the Print Preview toolbar are
always disabled. The "Two Pages" button and "Next Page" are enabled and work
correctly.
For the Prev Page button, I set CPrintInfo::SetMaxPage() and CPrintInfo::SetMinPage(). However, this doesnt work to enable the Prev Page button. In debug mode, I could see that CPrintInfo::m_nCurPage value was corrent within OnPrint() method when the program is in print preview. Anybody knows how to enable Prev Page button in Print Preview dialog?
Thanks
Sheng
|
|
|
|
|
I have to have a list of choices in a text menu for a console app in C. The text menu is to be populated from strings read from an INI file.
Anyone ever done anything like this?
For example:
[Model-A]
1="XYZ, Location = ABC"
2="GHI, Location = DEF"
I want to read the section then populate some strings based on the number of keys read. The string then is parsed using the string delimiter.
Appreciate the help.
Jer 29:11
|
|
|
|
|
Well, if you're doing any of this in C++, CodeProject has quite a few good examples[^] to get you started. Otherwise, I'm sure someone[^] has come up with a solution
Adam Maras | Software Developer
Microsoft Certified Professional Developer
|
|
|
|
|
I do have an IniFile Class but the majority of code is ANSI C. I have an INI file that is read and choice are presented to the user with a static text menu. If the INI file changes (grows) then I have to rev. code. I would rather rev. the INI file.
Jer 29:11
|
|
|
|
|
|
Choice 'C' but not using C# which the link in choice 'B' is based upon.
Jer 29:11
|
|
|
|