PDA

Click to See Complete Forum and Search --> : write memory video in visual basic onto a HDC


enoelis
Oct 10th, 2000, 08:56 AM
Hello, this is my first post, I have a big problem. I'm writting Geographic information sistems in visual basic, and I need speed to draw satelital images, the big problem is that the satelital images is a non supported format by a picturebox or any object in classic vb objects. my idea is to perform the image in memory and then draw it onto any DC, I'm using API's such SetPixelV, but is sooooooooo slow . . .!!! is there any way to make a buffer with the image (in facts, I do that) and then flush into a DC? I can't find the way to do it. sorry about my english, I hope yuo understand the problem.

Thanks A lot.

Mario Sileone

kedaman
Oct 10th, 2000, 09:23 AM
What format is the image? Do you have the colors in a byte array? If you have that then you may use CreateDIBitmap api to create a bitmap in memory and attach it to a DC

enoelis
Oct 10th, 2000, 09:41 AM
The format is LAN, this image can be from 1 byte to 7 bytes of color, and it's BIL format, for example the image had 10x10 bytes and 3 bytes of color, so the first row of the image in the file is like that

r r r r r r r r r r g g g g g g g g g g b b b b b b b b b b

then came the next row

r r r r r r r r r r g g g g g g g g g g b b b b b b b b b b

in the bitmap of 24 bits colors the image is like that

r g b r g b r g b r g b ......

I already have an array of rgb color for each pixel I have to draw, in facts, I can show the image pixel by pixel.

I hope you understand the format

thanks for the reply.

oetje
Oct 10th, 2000, 10:14 AM
To draw very fast on a picture box:http://www.vbaccelerator.com/codelib/gfx/imgproc2.htm

kedaman
Oct 12th, 2000, 08:07 AM
well that would make a complicated algoritm, and it would slow down the performance too with adding it into an RGB array. Goto
http://www.wotsit.org/
and see if they have that format documented :)

enoelis
Oct 12th, 2000, 08:20 AM
that's ok, I see the algohitm and is so complicated, in this case I found the API createDIBitmap, to make a DIB with an array of colors in 1, 4 , 8, 16 , 24 or 32 bits, it's great!, if anyone need this function I recommend, using it with stretchDIbits. thanks for your help. if anybody need code, tell me.
thanks