Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

The church saves sinners, but science seeks to stop their manufacture. -- Elbert Hubbard


devel / comp.os.ms-windows.programmer.win32 / GdipCreateBitmapFromScan0 - how to make it own the raw pixel data ?

SubjectAuthor
o GdipCreateBitmapFromScan0 - how to make it own the raw pixel data ?R.Wieser

1
GdipCreateBitmapFromScan0 - how to make it own the raw pixel data ?

<uk1vf9$3oddv$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=1183&group=comp.os.ms-windows.programmer.win32#1183

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: address@is.invalid (R.Wieser)
Newsgroups: comp.os.ms-windows.programmer.win32
Subject: GdipCreateBitmapFromScan0 - how to make it own the raw pixel data ?
Date: Mon, 27 Nov 2023 12:44:21 +0100
Organization: A noiseless patient Spider
Lines: 26
Message-ID: <uk1vf9$3oddv$1@dont-email.me>
Injection-Date: Mon, 27 Nov 2023 11:44:41 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="287b7beea169dea9296de0a9c3460bfc";
logging-data="3945919"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19CJdSmLX0kN2t19RwxDFuJm08SEGJT4hZ+K9ERjEhKyQ=="
Cancel-Lock: sha1:raJk00sI6Crz1Gm7kxw0PW9KCTU=
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-RFC2646: Format=Flowed; Original
 by: R.Wieser - Mon, 27 Nov 2023 11:44 UTC

Hello all,

I was using GdipCreateBitmapFromScan0 feeding it raw RGBA data, and deleted
the fed data afterward. Than I saved the resulting bitmap to a file.

To my surprise the file was fully empty (and no error!) ...

It looks like that, when I use the above call, I need to keep the raw RGBA
data available - which is quite different as, for example,
GdipCreateBitmapFromFile works.

Is there a way to tell GdipCreateBitmapFromScan0 to become owner of the raw
RGBA data, so that it, when GdiPDisposeImage is called, /all/ the image data
is discarded (and I do not need to discard the raw RGBA data myself) ?

Remark:

I've found some github sourcecode(?) for the GdipCreateBitmapFromScan0
function, which clarifies the above behaviour. I /could/ hack something
together to store (a ptr to) a GdipAlloc-ed block of memory (loaded with the
raw pixel data) into the GpBitmap structure, but I would rather not...

Regards,
Rudy Wieser

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor