Page 1 of 1

Adding bitmaps to themed rPreview toolbar

Posted: Mon Nov 06, 2006 3:18 pm
by peterk
Hi Antonio

I am trying to add different bitmaps to the themed rPreview toolbar
These bitmaps are contained in my normal RES file (not in Prev32.dll)
I cant get this to work
eg below even though Bmp_Pdf exists in my resources, it wont display

* Code snippet*
::oImageList:AddMasked( TBitmap():Define( ""BMP_Pdf"",, ::oWnd ), nRGB( 192, 192, 192 ) )

Do image lists require special kinds of bmps?
Would appreciate any assistance

Thanks
Peter

Posted: Mon Nov 06, 2006 5:34 pm
by Silvio
How can you converte the preview in pdf file ?

Posted: Tue Nov 07, 2006 2:15 am
by James Bott
Peter,

Where are you adding that code? If it is inside the rpreview function then you have to switch to your resources to load your bitmap, then switch back (see getResources() and setResources() near the top of the rpreview function in rpreview.prg). I also note that oImageList and oWnd are locals in this routine but you have them as instance vars.

James

Posted: Tue Nov 07, 2006 2:43 am
by reinaldocrespo
Silvio;

Read here:

[/url]
http://fivetechsoft.com/forums/viewtopic.php?t=4757
[url]


It absolutely works great!

Reinaldo.

Posted: Tue Nov 07, 2006 5:07 am
by peterk
1) :: is there because we have converted rPreview to a class

2) The pdf utility we are using is www.utilitywarrior.com product

3) I did try "SET RESOURCES TO" before the
"::oImageList:AddMasked( TBitmap():Define( "BMP_Pdf", , ::oWnd ), nRGB( 255, 255, 255 ) )" line, but this does not work

4) I tried putting the bitmap in prev32.dll (using resource builder) - that also did not work

I am thinking that maybe theming requires a special type of bitmap ?
I have run out of ideas

Thanks
Peter

Posted: Tue Nov 07, 2006 4:16 pm
by Antonio Linares
Peter,

Has the bitmap the same dimensions of the other bitmaps ?

Posted: Tue Nov 07, 2006 4:22 pm
by James Bott
Peter,

>1) :: is there because we have converted rPreview to a class

Then, are you sure this code is getting linked in and used? One way to find out is to put a msgInfo() in it.

>I am thinking that maybe theming requires a special type of bitmap?

Not so, all my apps are themed and all my bitmaps work fine.

James

Posted: Tue Nov 07, 2006 11:18 pm
by Silvio
to converte rpreview to a class is easy... and then ?

Posted: Wed Nov 08, 2006 9:30 am
by peterk
Hi All
I have resolved this. The problem was caused because the no of bitmaps in the imagelist is > than the no of btns, and I was assuming the my new pdf btn corresponded to the correct bmp in the imagelist.

I had to add a call to ::oBar:ChangeBitmap() to set my Pdf btn to the correct bmp. All ok now.

Thanks for the assistance
Peter