News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

BitBlt

Started by ragdog, January 05, 2013, 12:07:27 AM

Previous topic - Next topic

ragdog

Hi All

I have a question to a imagelist can i use this format for a Imagelist ?



I use in my new toy Bitblt for draw images now must i add 3 images to the resource
but i have see i can add a one image (imagelist) in the resource and use ImageList_LoadImage

Can i use this in this format and have any an example?

Greets,

dedndave

you can use any order or organization that suits you
it makes it simple if the images are the same size, but they don't have to be   :biggrin:

http://masm32.com/board/index.php?topic=932.msg9410#msg9410

Tedd

The images are arranged horizontally, so if you want to add multiple at once then make yours horizontal too (not vertical.)
If you add them one at a time then obviously it doesn't matter.

(Dave is using a bitmap and bitblt-ing directly, not an ImageList, in which case all organisation is up to you, including sizing large enough to add more images.)
Potato2

dedndave

i used a vertical arrangement on that minesweeper thing
just because windows minesweeper did - and i wanted to try it that way
i had otherwise always arranged them horizontally

actually, there is a certain amount of logic behind that
when arranged vertically, the bytes for any given sub-image are in the same area of memory
when arranged horizontally, they are interlaced with bytes of the other sub-images
that probably makes little difference in 32-bit flat model, but interesting to note

as far as the code goes, it seems to make little difference

Tedd

I agree - bitmaps are stored by scanline, so it makes sense to arrange multiple images vertically; however, the ImageList_ functions require them to be arranged horizontally ::)
Potato2

ragdog

Thank you both

@Dave yes exactly this is it :t

I use in my project many buttons a 3 different images and all buttons have a other image
and i use many many bmp files in my resource.  ::)

I have think with a imagelist is it better to use aka my first post

now must i only include 5 bmp files in my resource  :biggrin:

Ok i look in your source and try it and i hope this is easy  8)

dedndave

oh - gotcha, Tedd
i haven't used that function - seems like unnecessary overhead to seperate the images
i think it uses less memory if you keep it as one image, and index into it to get the sub-image

dedndave

here is a very simple example using BitBlt

i don't use the image list function
i don't double-buffer
that makes it very easy to understand   :P

now, if you want to set the individual images into a static control,
then the image list function may be a good alternative,
as you need individual bitmap handles for each sub-image

i would probably create my own compatible bitmaps and blit them in there   :biggrin:

ragdog

Yes nice this is it dank Dave :t :t

Bitblt was the question to split the bitmap from a imagelist picture  ::)

dedndave

it's pretty easy stuff   :t

dedndave

i made a mistake, though - lol

when i made the bitmap strip, i put the blue image at the top and the red image at the bottom
when i wrote the code, i thought i had them the other way around

so - my red and blue images are swapped   :P

i guess you wanted them in "3,2,1" order, so we are good   :lol:

ragdog

This is simply to change it my question was only how it work it :biggrin:
and this have you shown me :eusa_dance:

Works perfect


  .if ([edi].CtlID==1001)
      .if ([edi].itemState & ODS_SELECTED)
          mov ebx,1*SIZE_Y
        .else
               mov ebx,0*SIZE_Y
      .endif
   .endif
   invoke   SelectObject,hMemDC,hBmp
   invoke  BitBlt,[edi].hdc,0,0,[edi].rcItem.right,[edi].rcItem.bottom,hMemDC,0,ebx,SRCCOPY


Have i any problems about it i tll you ;-)

hfheatherfox07

Quote from: dedndave on January 05, 2013, 04:30:46 AM
here is a very simple example using BitBlt

i don't use the image list function
i don't double-buffer
that makes it very easy to understand   :P

now, if you want to set the individual images into a static control,
then the image list function may be a good alternative,
as you need individual bitmap handles for each sub-image

i would probably create my own compatible bitmaps and blit them in there   :biggrin:


I love that example !
I had an idea , using invoke sleep , and delete object I thought I can animate the squares moving across the screen ( any direction)
Any idea why that failed?
All I did was add those things to your code
Your code and your skills will be assimilated. Your programming language is irrelevant.
We are the ASM Borg and you will become part of us. Compile and be assembled.

hfheatherfox07

never mind ....
I need to sketch mask http://www.masmforum.com/board/index.php?topic=18800.0

I want to use that to animate the position off each image like it is walking
Your code and your skills will be assimilated. Your programming language is irrelevant.
We are the ASM Borg and you will become part of us. Compile and be assembled.