Hey peeps!
I am trying to make a .dll to replace this function:
function _BlendImages(src1,src2,dest)
REM ** Function to blend two images with eachother. ***
REM ** Make SURE the images are of EQUAL size! ***
REM ** In image2, RGB(0,0,255) equals transparent. ***
make memblock from image 1,src1
make memblock from image 2,src2
mSize = get memblock size(1)
make memblock 3, mSize
width = memblock dword(1,0)
height = memblock dword(1,4)
depth = memblock dword(1,8)
write memblock dword 3,0,width
write memblock dword 3,4,height
write memblock dword 3,8,depth
i = 12
for y=1 to height
for x=1 to width
skipblend = 0
col1b = memblock byte(1,i)
col1g = memblock byte(1,i+1)
col1r = memblock byte(1,i+2)
col2b = memblock byte(2,i)
col2g = memblock byte(2,i+1)
col2r = memblock byte(2,i+2)
if col2b=255 and col2g=0 and col2r=0 then skipblend=1
write memblock byte 3,i,col1b
write memblock byte 3,i+1,col1g
write memblock byte 3,i+2,col1r
write memblock byte 3,i+3,0
if skipblend=0
write memblock byte 3,i,(col1b + col2b) / 2
write memblock byte 3,i+1,(col1g + col2g) / 2
write memblock byte 3,i+2,(col1r + col2r) / 2
write memblock byte 3,i+3,0
endif
i = i + 4
next x
next y
make image from memblock dest,3
delete memblock 1
delete memblock 2
delete memblock 3
endfunction
I have finally found out how to actually make a dll and call the function in DBP, but how do i actually get the memblock pointer to c++ and access it in the c++ code?
I have been messing around with pointers... but can't seem to get it to work...
If anyone could point me in the right direction, I would be really appreciative.
A simple example to show how i get the data through pointers and alter it.
- enderleit
[href]www.eleit.dk[/href]