Hi everyone, I have a HBITMAP with alpha channel information. The alpha channel should already be premultiplied.
Nevertheless, when using GDI's AlphaBlend(..) function, the bitmap seems to have "black borders", means the semi-transparent areas are simply black.
Does this mean I am doing something wrong? Or is AlphaBlend that limited?
I guess I should avoid legacy GDI AlphaBlend, maybe some has a clue what alternatives I'd have for a dialog based application?
Is there something better in GDI+ for bitmaps with transparency? I am not really convinced to go for D2D for this bitmap only.
I'm developing on OS X 10.8.3. The following code is simple. It can perform two operations. If the read function is uncommented then the program will open the file at "address" and transfer all of its contents into data. If instead, the memcpy function is uncommented the program will copy the mmapped contents into data. I am developing on a mac which caches commonly used files in inactive memory of RAM for faster future access. I have turned off caching in both the file control and mmap becuase I am working with large files of 1 GB or greater. If i did not setup the NOCACHE option, the entire 1 GB would be stored in inactive memory.
If the read function is uncommented, the program behaves as expected. Nothing is cached and everytime the program is ran it takes about 20 seconds to read the entire 1 GB.
But if instead the memcpy function is uncommented something changes. Still i see no increase in memory and it still takes 20 seconds to copy on the first run. But every execution after the previous one, copies in under a second. This is very analogous to the behavior of caching the entire file in inactive memory, but I never see an increase in memory. Even if I then do not mmap the file and only perform a read, it performs in the same time, under a second.
Something must be getting stored in inactive memory, but what and how do I track it? I would like to find what is being stored and use it to my advantage.
I am using activity monitor to see a general memory size. I am using Xcode Instruments to compare the initial memcpy execution to an execution where both read and memcpy are commented. I see no difference in the Allocations, File Activity, Reads/Writes, VM Tracker, or Shared Memory tools.
If you want a string that is not constant, that would be assigned differently, and the answer would depend on whether you mean "assign memory space" or "assign the characters forming the string" when you say "assign", as these are two separate activities in C.
What do you want to know? What have you tried? What books and/or articles have you read, and what is it you do not understand? Who was that masked stranger?
Last Visit: 31-Dec-99 19:00 Last Update: 24-Feb-24 18:36