Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21089

two working modules, but they don't works together

$
0
0
I have two modules:

1) module to do: ScreenShot -> StdPicture.
2) Another module to do: StdPicture -> extract .bmBits pointer (a pointer to the bitmap_pixels_information) and sets the bitmap's memory area on a 2D variable like "dim pixels(0 to (bmWidth*4)-1, 0 to bmHeight-1) as Byte".

so you then can access like pixels(x*4,y) = RedColor, pixels(x*4+1,y) = GreenColor , etc.

or you can use VarPtr(pixels(0,0)) as a RAW buffer pointer. (my intention this time).


the first module works ok if you do set Form1.picture = ScreenShot, or set P = Screenshot then SavePicture, all works ok.

the second module works ok if you do, Set pic = loadpicture ("blabla.bmp").

but the output of the first module don't works as input for the second module.... the second module can read WIDTH and height properties, but the .bmBits parameter (what I am interested ON) it RETURNS .bmBits = 0, in other words the GetObjectA function don't returns the pointer to the in-memory bitmap-area.

And I don't knows why?, maybe is a "glue" problem. ¿Anybody can helpme?

Viewing all articles
Browse latest Browse all 21089

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>