Similar Threads
1. Problem w/bitmap from CreateDIBSection
I use CreateDIBSection() in my OnDraw() to display graphics on the
screen and to send images to the printer (both via StretchDIBits()).
It works great.
I am now using the same code to copy the image to the clipboard. (I
do make sure the size of the image is dword-aligned, or at least I
think I am.)
When I paste my image as a DIB (e.g., from Word, select Paste Special
and DIB), it works fine. However if I paste in Word (etc) as a DDB
bitmap, the image is slightly messed up, with a column of pixels that
should be on the left side of the image appearing on the right (e.g.,
the image should look like "1234567" but it looks like "2345671").
I am especially puzzled, because the DIB looks fine. I'm not even
sure who created the non-DIB ("bitmap") version on the clipboard.
Any ideas?
Thanks,
Steve
2. Manipulating bits in 1Bpp Bitmap class - CSharp/C#
3. Display bitmap as compressed ASCII string of set bits
Dear Group.
For an application I am developing I need to display a 64 bit bitmap
as a compressed ascii string of bits. This is to allow for the
easier understanding of the bits for the users.
For example in the bitmap if bits, 1,2,3,4,5,6, 17,18,19 and 63 are
set they would like to display a string 1-6,17-19, 63.
Is there a easy way to do this in Csharp or do I need to roll my own?
Any suggestions on the best way to do this if I need to roll my own?
Thanks
David
4. about 64-bits encryption and 128-bits encryption
5. shifting bits, shift 32 bits on 32 bit int
Noticed something odd in the way bit shifting was working today.
As far as I have ever heard, shifting will shift in zeros(signed ints
aside)
However I foudn something odd when I am shifting exactly the number of
bits in a value... i.e.
uint32_t x = 5;
uint32_t y = x << 32;
uint32_t z = x << 32;
In the above example y and z are both still 5. Why is this?
Now I understand doing a shift like this seems silly, but in this code
sometimes the resulting shift validly turns out to be exactly the
number of bits in that data type, and expects the result to be 0.
I can change the code to handle this special case... I was just
wondering why this was happening..
6. bits of this, bits of that
7. Can we replace 8 bits by 2 bits?
[cross-posting deleted]
Ondra Holub wrote:
> Umesh napsal:
> > This is a basic thing.
> > Say A=0100 0001 in ASCII which deals with 256 characters(you know
> > better than me!)
> > But we deal with only four characters and 2 bits are enough to encode
> > them. I want to confirm if we can encode A in 2bits(say 00), B in 2
> > bits (01), C in 2 bits(10) and D in 2 bits by some program. I only use
> > this four alphabet in my work. Can u pl write a sample program to reach
> > my goal?
[...]
> If you really need to save couple of bytes, you should write some
> wrapping class which overloads operator[] and hides all these bit
> operations. It would be something like std::vector<bool> not for 1 bit
> values, but for 2 bit values.
How about std::bitset?
Cheers! --M
8. 9 bits crammed in to 8 bits space...