|
maybe he might want to so this :-
replyprefix + "\r\n" + m_Reply
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
Hi, I've got a a CImageList which is loaded from a bitmap which uses approx 100 colors. When I display an image from it, it drops back to only using 16 colors. I've looked at all the help for CImageList and am at a bit of a loss. My guess is that it is something to do with palletes, but I often have trouble with this stuff. Any suggestions most welcome.
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
How are you creating the imagelist ? Are you specifying ILC_COLOR8 ( or higher ) ? If you go ILC_COLOR16 or higher then you'll have no palette to worry about at all.
How are you loading the images and putting them in ? I seem to recall having to load them as DIBSections.
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
Hi Christian,
I'm using using CImageList::Create() - flavour no 1. So you don't get to specify the ILC_xxx value. I assume it comes straight from the bitmap resource.
m_ItemImages = new CImageList;
BOOL bStat = m_ItemImages->Create( nBitmapID, nImageWidth, 0, crMask );
I've looked at CImageList::Create() and it calls ImageList_LoadBitmap()
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
How are you using the image ? Have you tried throwing the whole imagelist to the screen to see if it's 16 color ?
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
Christian Graus wrote:
How are you using the image ? Have you tried throwing the whole imagelist to the screen to see if it's 16 color ?
Well it is used in this particular case in a custom tree control that I've written. It does all of its own drawing, and doesn't use the MS Tree Control at all.
m_ItemImages->Draw( pDC, pNode->GetImage(), CPoint( x, y + ( ( GetRowHeight() - GetImageHeight() ) / 2 ) ), ILD_NORMAL );
draws a image from the list. If I look at the bitmap in Paintshop Pro or VC's Image editor I see everything ok. There is only one image which is actually > 16 colors. I did a screen shot grab to get this, and then replaced the pallete in the original imagelist bitmap (which was only 16 bits deep) with the pallete from the screen grab. I did all of this in Paintshop Pro.
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
I'm sorry it took me so long to reply - would you believe I was waiting for my daughter to get off the PC, and I feel asleep ? I slept from 6:30 pm to 10:30 pm. I've been sick this week....
Anyhow, I remembered having the same problem, and sure enough, if I added a 24 it mapage to my resources, and created a CImageList from it, I got a 16 color image. To get it to display in 24 bit, I needed to create the image list and the bitmap seperately, then pass in the bitmap, like this:
CImageList il;
il.Create(45, 40, ILC_COLORDDB|ILC_MASK, 8, 1);
CBitmap bm;
bm.LoadBitmap(IDB_BITMAP1);
il.Add(&bm, RGB(0,0,0));
il.Draw(pDC, 0, CPoint(0,0), ILD_NORMAL);
voila - 24 color image drawn to the screen from an image list.
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
Hi Christian,
I owe you one. Works a treat. I can't believe the MS Docs don't mention this issue, but then again yes I can.
Hope your feeling better. Nothing much worse than trying to cut code when you feel lousy.
Thanks again.
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
Neville Franks wrote:
I owe you one. Works a treat. I can't believe the MS Docs don't mention this issue, but then again yes I can.
I had to dig out the source from my very first app, because I remember trying to find the solution in order to create high colour toolbars. From memory I found the answer in MSJ.
Neville Franks wrote:
Hope your feeling better. Nothing much worse than trying to cut code when you feel lousy.
Yes, thanks. It's been a bit up and down, but I'm feeling a lot better now.
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
Hello.
I custom CSliderCtrl,so I can draw some bitmap on it.But I can't drag the thumb when the slider's height is very small(few pixel),I want to modify thumb's rect,how can i do ?
my English is poor.
|
|
|
|
|
I have a class CMyHttpClient which is derived from CHttpClient and my app dialog class is CNetServerDlg. How do I get a function called in CMyHttpClient to send this information to CNetServerDlg? Did this make any sense at all? Can anyone help me with this? Thanks.
- Matt Newman
- Matt Newman
-Sonork ID: 100.11179:BestSnowman
|
|
|
|
|
If CNetServerDlg is the main dialog in your dialog based application use AfxGetMainWnd to get a pointer to it and cast it to (CNetServerDlg*) and do your stuff
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
Boy its easier than I thought. Thanks
- Matt Newman
- Matt Newman
-Sonork ID: 100.11179:BestSnowman
|
|
|
|
|
I am a situation which I would rather not have. I have inherited a Source Safe repositiory and the none of the guys who worked on the project originally are around anymore and never left the info about the password and in their wisdom never used the agreed admin password.
Is there a way I can generate a password in file so that I can get access to this source code again.
Happy programming!!
|
|
|
|
|
Hi I wanted to create a function that takes 3 integer color values, between 0-255. The function uses a variable of the type COLORREF which is a hexadecimal value. How can I can convert the three decimal values into a COLORREF value;
How can I make decimal 255, 0, 255 into 0x00ff00ff
Thank you,
SAK
|
|
|
|
|
The RGB macro converts three unsigned chars into a COLORREF value. The GetRValue, GetGValue, GetBValue macros pull them out again.
COLORREF magenta = RGB(255,0,255);
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
|
I wouldn't make that into a function. Just use the macro as if it was a function.
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
Jon Hulatt wrote:
I wouldn't make that into a function. Just use the macro as if it was a function.
He's saying he's written a function which takes three unsgined chars and *uses* a COLORREF, not that it's point of existence is to create one. At least, I *hope* that was what he was saying....
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
Okay, sounds strange. I have an MDI app that has forms for child windows. I thought using cs.style|= DS_CONTEXTHELP in CChildFrame::PreCreateWindow would display the little ? icon in the top right corner in the top right of the window. No luck.
Any ideas? The frame is set as a WS_DLGFRAME.
Giles
|
|
|
|
|
|
They only way I know of implementing context help in this regard is to use the standard MFC context help button that by default would be in your toolbar if you enabled it in your MFC app. If its not there, you fcan add a toolbar button with the ID of ID_CONTEXT_HELP.
This will get the basic context help working for your form. If you individual item help for controls. Its a bitmore involved than this. I originally worked through this problem with Bill Heffner on the CodeGuru question board middle of last year and we got to a solution. The URL for the thread is:
http://63.236.73.79/cgi-bin/bbs/wt/showpost.pl?Board=vc&Number=298883&page=1&view=collapsed&mode=threaded&sb=5&category=
Sorry to reference you to a CodeGuru thread, but I don;t really have the time at the moment to work through the whole problem again. If you get stuck, I should be able to help further, but try looking at the thread first and trying whats in it.
HTH
Roger Allen
Sonork 100.10016
|
|
|
|
|
Thanks Roger, I'll give it a whirl.
Giles
|
|
|
|
|
I am working on an addin for VS and I am having trouble debugging it. Since the addin runs from within VS, I am choosing MSDEV.EXE as my executeable for the debugging session, but of course it doesn't have any debug info. It won't stop on my breakpoints or anything. Has anyone done this or have any ideas? Thanks.
|
|
|
|
|
I haven't tried this with an addin, but it works for a service. Add a call to DebugBreak() to your code where you want the breakpoint, then build it. Start MSDEV, and locate the process in Task Manager. Right-click it, select Debug and attach the debugger. Now, when you execute the code with the DebugBreak, you'll get an error message. You should be able to open the Stack Window, find your code and place breakpoints whereever you like.
Hope this helps.
------------------------
Derek Waters
derek@lj-oz.com
|
|
|
|