Udo Schneider <
[hidden email]> wrote in message news:<
[hidden email]>...
> Hi,
>
> I'm having a few performance problems with Canvas>>#pixelAt:put: to fill
> a large canvas pixel by pixel (using C doesn't help here ... SetPixelV
> seems to be the problem here).
>
> My approach is now to use an ByteArray of x*y*Bpp entries and to fill it
> in directly. The question now is how to get a DIBSection from this?
>
> Thanks,
>
> Udo
Udo --
How about this:
| dib dibSize bits |
dibSize := (32 * 32) * 4. " Four bytes for 32bpp "
dib := DIBSection width: 32 height: 32 depth: 32.
KernelLibrary open zeroMemory: (dib imageBits) length: dibSize.
bits := ByteArray fromAddress: (dib imageBits) length: dibSize.
0 to: (dibSize - 4) do: [:idx | bits dwordAtOffset: idx put: idx].
bits inspect.
Regards,
Jeffrey D. Panici
Worker Bee Solutions, Inc.