|
sashoalm wrote: This problem might be because 256-color/16-color bitmaps don't use RGB values. May be they use palettes somehow.
You are correct, obviously you cannot put RGB(R, G, B) into 4 or 8 bits. The early bitmap types could select a subset of the RGB spectrum and did so by first selecting a palette of colours and then using the color value as an index into the palette set. So the bottom line is that you cannot use all the new functionality with the old 16/256-colour bitmaps.
|
|
|
|
|
Richard MacCutchan wrote: You are correct, obviously you cannot put RGB(R, G, B) into 4 or 8 bits. The early bitmap types could select a subset of the RGB spectrum and did so by first selecting a palette of colours and then using the color value as an index into the palette set. So the bottom line is that you cannot use all the new functionality with the old 16/256-colour bitmaps.
Yes, we can!
|
|
|
|
|
Rozis wrote: Yes, we can!
How?
|
|
|
|
|
Richard MacCutchan wrote: The early bitmap types could select a subset of the RGB spectrum and did so by first selecting a palette of colours and then using the color value as an index into the palette set.
Can you give an example for using a palette?
How do I construct one, and do I select it into the DC with SelectObject?
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
sashoalm wrote: Can you give an example for using a palette?
I'm afraid I have not used this functionality for years so can only vaguely remember how it all fits together. You can probably find some information via Google, or Rozis has made a suggestion below as to how to convert to 24-bit.
|
|
|
|
|
The book Programming windows of charles Petzhold explains it pretty well
|
|
|
|
|
Rozis wrote: The book Programming windows of charles Petzhold explains it pretty well
I agree, all his books are really good. The version I had was Programming windows 3.1, which is a bit old now!
|
|
|
|
|
Maybe i can help you...
sashoalm wrote: This problem might be because 256-color/16-color bitmaps don't use RGB values. May be they use palettes somehow.
Only 24-bit bitmaps use no colortable, each pixel is 3 bytes in memory being 8 bits for red, 8 for green and 8 for blue. Transparency is implemented as an extension on this: instead of 3 bytes it uses 4 bytes for a pixel (8 bits for transparency level called 'Alpha'). 256- and 16-color bitmaps use a colortable.
TransparentBlt() has 2 levels of transparency: global and per pixel. Global transparency will make all your pixels - for example - 50% transparent. This only works for 24- and 32-bits bitmaps.
Per pixel transparency uses the setting of the alpha. So a 32-bitmap is required. With this you can set the transparency per pixel. One thing to know is that pixel-transparency expects your values for RGB are 'pre-multified', meaning:
alpha:=.. // alpha holds the alpha of the pixel
factor:=alpha/255
r:=r*factor
g:=g*factor
b:=b*factor
I'm not sure what your problem exactly is but i bet the solution is to 'transform' the bitmaps to a 24-bit version. With CreatecDIbitmap() you can do this...
Rozis
|
|
|
|
|
|
vtech22 wrote: As a final project...
...and have no clue were to even start
So where did you start with the other non-final projects?
Who gave you this assignment?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
|
vtech22 wrote: ...they just told me what to do...
And you don't have access to any of those past projects?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
nope after each assignment is done she takes them and thats the last we see of any of them (personally i think she's not that great of a teacher anyway all she ever said was read the book and that deffinitly doesnt help when you already dont know whats going on)
|
|
|
|
|
So none of this looks familiar:
void main( void )
{
printf("1) Option 1\n");
printf("2) Option 2\n");
printf("3) Option 3\n");
printf("4) Some other menu\n");
printf("5) Exit\n\n");
int nChoice = 0;
do
{
printf("Option: ");
scanf("%d", &nChoice);
} while (nChoice >= 1 && nChoice <= 4);
}
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
vtech22 wrote: personally i think she's not that great of a teacher
You'd be surprised (but I wouldn't) how often this excuse is trotted out as some sort of reason why we should do other people's work. Maybe you should have taken her advice and read some books, or even the notes you made of each assignment.
|
|
|
|
|
|
You're in college now studying computers in some technical fashion and didn't already know simple programming when you started? Way behind the curve.
You measure democracy by the freedom it gives its dissidents, not the freedom it gives its assimilated conformists.
|
|
|
|
|
vtech22 wrote: ive read every chapter shes told us to read. yeah i understand what there saying in the book but the book we were required doesnt so much as teach you how to code as tell you the different names for things and why there used if my assignment was to right the deffinitions to different programming terms id have no problem
OK, so the teacher was useless and the book is useless, so you now have two reasons why you think we should do your work for you. May I suggest you try a simpler course, more in keeping with your abilities and willingness to learn.
|
|
|
|
|
Hello,
I need to have a hor. scrollbar, even if there are not enough columns to fill the window. By starndard it disappears in this situation.
Can anyone help?
Thanks, GE
|
|
|
|
|
gerens wrote: ...even if there are not enough columns to fill the window.
What would you expect it to do in this situation?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
He probably wants to have the scrollbar shown all the time. When there are not enough columns to fill the window, the scrollbar is just disabled but still shown.
|
|
|
|
|
I have a CListView with fixed columns on the left side. Works fine with the keyboard. But if I scroll at the end of my list, I cannot scroll back to the beginning with the mouse (because the scrollbar is not shown).
Thanks, EG
|
|
|
|
|
gerens wrote: But if I scroll at the end of my list...
You indicated earlier that there are not enough columns to fill list control, so what's to scroll?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
An example:
I have 8 columns. 2 of them fixed, 6 others shown and 2 outside the window.
If I scroll one column to the left, everything is ok. HScrollbar is showm and I can scroll back.
If I scroll two columns to the left, all columns are now within the window, the HScrollbar disappears and I csn't scroll back with the mouse (only with the keyboard).
Of course it would be a solution to always fill the window with empty colums (like in Excel), but I hope there is another way.
Thanks, GE
|
|
|
|
|
Hi,
If there 2 windows T1 and T2. How T1 will notify T2 by sending a message?
How 2 achieve this 1) if they are child and parent windows or
2) both are independent windows
Thanks in advance
MSR
|
|
|
|