How can I load an icon and convert it into a trasparent bitmap.
I have to use the handle of this bitmap in the Header Control
Posted on 2002-08-26 10:50:43 by greenant
First, two points:

1) trasparent bitmap should have a 'n' in there. Proper spelling halps with the search function here.

2) given the correct spelling, your search would turn up
this result
Posted on 2002-08-26 17:20:52 by Ernie
Proper spelling halps with the search function


Yes, Ernie is right, proper spelling is very hAlpful :grin:
Posted on 2002-08-26 17:33:22 by LuHa
pwned.
Posted on 2002-08-26 18:18:42 by iblis
i REALLY dislike this way... i mean 1000 api calls just to paint a transparent bitmap?
check out this 3 hour project i wrote for this purpose... sorry it's not very well comented
but it's VERY easy to use... you only have to work with the following structure:


;-----------------------PROTOTYPES

_MAKE_REGION PROTO :DWORD, :DWORD
_LOAD_R_BMP PROTO :DWORD, :DWORD, :DWORD, :DWORD, :DWORD, :DWORD
_PAINT_R_BMP PROTO :DWORD, :DWORD, :DWORD, :DWORD
_UNLOAD_R_BMP PROTO :DWORD

;-----------------------STRUCTURE DEFINITION

R_BMP STRUC
BTMPID DD ? ; RESOURCE BITMAP ID
W DD ? ; BITMAP WIDTH
H DD ? ; BITMAP HEIGHT
DEVICE DD ? ; - RESERVED!
REGION DD ? ; - RESERVED!
BITMAP DD ? ; - RESERVED!
RGNPSX DD ? ; - RESERVED!
RGNPSY DD ? ; - RESERVED!
R_BMP ENDS

.DATA

; ----------------DECLARE YOUR PICTURES HERE!
_PIC1 R_BMP <1000,50,50,,,,,>
.
.
.

.CODE

.IF uMSG == WM_CREATE

; ----------------INITIALIZE YOUR PICTURES HERE!
INVOKE _LOAD_R_BMP,ADDR _PIC1, _PIC1.BTMPID, hInstance, hWnd, WIDTH, HEIGHT
.
.
.

.ELSEIF uMSG == WM_PAINT
INVOKE BeginPaint, hWnd,ADDR ps

; ----------------DRAW THEM HERE!
INVOKE _PAINT_R_BMP, ADDR _PIC1, ps.hdc, X, Y
.
.
.
INVOKE EndPaint,HWND,ADDR ps

.ELSEIF uMSG == WM_DESTROY

; ----------------AND FINALLY, DESTROY THEM HERE!
INVOKE _UNLOAD_R_BMP,ADDR _PIC1
.
.
.

now just rip the four routines from the example source i attached and include it
in your project. oh another thing... transparency INSIDE the bitmap *IS* possible
with my routines... AND THE FIRST PIXEL COLOR AT X:0 Y:0 IN THE BITMAP IS
TAKEN AS THE TRANSPARENT COLOR!


sorry, the bitmap_id parameter in the _LOAD_R_BMP proc is nonsense... please
cut it... only thing you have to change in the procedure is:

INVOKE LoadBitmap,INST,.BTMPID

then fix the prototype and that's it...
Posted on 2002-08-26 22:56:33 by mob
May be TransparentBlt func from msimg32.dll will help you.
There are also bunch of useful functions there.
Posted on 2002-08-27 02:58:31 by Four-F
In the attachment is dialog "Choose Process To Attach" from one of my non-complete project.
I used transparent bitmap in header to display direction of sorting.
invoke LoadImage,.., IMAGE_BITMAP,.., LR_LOADMAP3DCOLORS
The color you want to be transparent should be gray (192,192,192).
I used bitmap. To use icon, change IMAGE_BITMAP flag to IMAGE_ICON.
Click ListView's header to see it.

This dialog also has tool tip in the ListView area (only first and last column) and in the header.
Hope this helps.
Posted on 2002-08-27 03:41:21 by Four-F
thanks but now I have problems with a progressbar
Posted on 2002-08-27 14:28:32 by greenant