Yo Can you, please, help me on doing a progressbar wich is a bitmap. well, when extracting a file, i want to make the bitmap of width : size of extracted file/size of file * maxwidth can you help me ZeuX
Posted on 2001-04-12 04:40:00 by ZeuX
What kind of bitmap? A plain color rectangle? An image that should stretch or be clipped? Thomas This message was edited by Thomas, on 4/12/2001 5:31:42 AM
Posted on 2001-04-12 05:30:00 by Thomas
Of course, it's a photo bitmap not kind of bitmap i create using fonctions made to:) yo so, it's just a image, which i would like to put as a progress bar :-) yep tx
Posted on 2001-04-12 11:46:00 by ZeuX
First create an ownerdrawn static control to draw the progress bar in, and just load the full bitmap into a DC, then in the drawing procedure, use StretchBlt if you want the bitmap to stretch (0.. maxwidth), or just BitBlt a part of the bitmap on the control if you want to draw the bitmap clipped. calculate the size with:

mov eax, size_of_extracted_file
mov ecx, size_of_file
cdq
div ecx
mov ecx, maxwidth
mul ecx
; eax now = size of extracted file/size of file * maxwidth
Then draw the bitmap:

;(with eax from previous piece of code)
;for stretched bitmap:
invoke StretchBlt, hDCcontrol, 0, 0, eax, heightofbitmap,\
        hDCsourceimage, 0, 0, width_source, height_source,\
        SRCCOPY
;for clipped bitmap:
invoke BitBlt, hDCcontrol, 0, 0, eax, heightofbitmap,\
        hDCsourceimage, 0, 0, SRCCOPY

Hope this helps Thomas
Posted on 2001-04-12 11:55:00 by Thomas