Results 1 to 6 of 6

Thread: write memory video in visual basic onto a HDC

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2000
    Location
    Córdoba, Argentina
    Posts
    3

    Unhappy

    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
    Enoelis

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    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
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  3. #3

    Thread Starter
    New Member
    Join Date
    Oct 2000
    Location
    Córdoba, Argentina
    Posts
    3
    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.

    Enoelis

  4. #4
    Fanatic Member
    Join Date
    Feb 2000
    Location
    The Netherlands
    Posts
    715
    To draw very fast on a picture box:http://www.vbaccelerator.com/codelib/gfx/imgproc2.htm
    Oetje
    [email protected]
    93606776
    Visual Basic 6, Windows 2000

    Never pet a burning dog

  5. #5
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    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
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  6. #6

    Thread Starter
    New Member
    Join Date
    Oct 2000
    Location
    Córdoba, Argentina
    Posts
    3

    Talking one fast solution

    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
    Enoelis

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width