Sign in to follow this  

setdibits() alternative???

This topic is 3775 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, anyone know of a faster alternative to using win api's "setdibits()" func? [if you're not sure what it does, it takes a pointer to an rgbtriple or quad array (24/32bit) and copies the data into a bitmap handle since winAPI won't let you directly manipulate bitmaps (DIBs) in memory]. It's just so dam slow - please don't suggest directX! is there a way in assembly to access DIB directly, without the need to use "setdibits()"?????

Share this post


Link to post
Share on other sites
yeah, i know of it but can't get it to work...i mean, what the fu** is a void** in delphi?! how do i access the bytes? in delphi, pointers are defined as either generic ("x:pointer")or typed ("x:^integer") but i see now way of saying pointer to a pointer unless i go:
p:^byte;
q:pointer;
q:=p;
and then pass q as void ** arg in createdibsection()
would this be correct?
but then how would i access bytes?
would p now pointer to those bytes, or do i need to go through q?

Share this post


Link to post
Share on other sites
I'm really, really not knocking Delphi, but I have to say that I've always found SetDIBits to be blindingly fast when used from C++. Are you sure the slowdown isn't something to do with the Delphi runtime?

Share this post


Link to post
Share on other sites
Quote:
Original post by at_lowe
yeah, i know of it but can't get it to work...i mean, what the fu** is a void** in delphi?! how do i access the bytes? in delphi, pointers are defined as either generic ("x:pointer")or typed ("x:^integer") but i see now way of saying pointer to a pointer unless i go:
p:^byte;
q:pointer;
q:=p;
and then pass q as void ** arg in createdibsection()
would this be correct?
but then how would i access bytes?
would p now pointer to those bytes, or do i need to go through q?


It has been years since I even saw delphi code, but I guess you could try declaring a

x:^byte;

and then passing it as @x.

Share this post


Link to post
Share on other sites
Quote:
Original post by at_lowe
i see now way of saying pointer to a pointer unless i go:
p:^byte;
q:pointer;
q:=p;
and then pass q as void ** arg in createdibsection()
would this be correct?
No, with that definition of p you simply pass &p to CreateDibSection, and use p.
q is redundant.

Share this post


Link to post
Share on other sites
great! thanx iMalc and wack, i wasn't sure if i could simply do that :)
makes sense, afterall a void ** is a pointer to a pointer and that's what @p is.
cool!

Share this post


Link to post
Share on other sites

This topic is 3775 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this