Print Page | Close Window

Alphachannel-Bitmaps in Shortcutbar

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Shortcut Bar
Forum Description: Topics Related to Codejock Shortcut Bar
URL: http://forum.codejock.com/forum_posts.asp?TID=9498
Printed Date: 21 November 2024 at 9:02am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Alphachannel-Bitmaps in Shortcutbar
Posted By: RJungmann
Subject: Alphachannel-Bitmaps in Shortcutbar
Date Posted: 05 February 2008 at 9:58am
Hi,
 
I use a shortcutbar inside of a dockinpanel (version 11.2.1).
The bitmaps of the shortcutbar are 32Bit-BMP-Files with alphachannel and they are displayed correct. But if I start the program on a terminal server or by remote desktop connection they are not shown.
 
PNG-files are never shown. Using 24Bit-BMP-Files without alphachannel and defining the maskcolor for the transparent color works fine (remote, too), but it would be better for me, if I could use alphachannel-bitmaps so I don't have to change all of the bitmaps.
 
 
Regards,
 
Rene 



Replies:
Posted By: Oleg
Date Posted: 05 February 2008 at 1:20pm
Hi,
Attach some sample that has problem.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: RJungmann
Date Posted: 06 February 2008 at 7:41am
Hi,
 
we use DataFlex. It works different than vb.net for example. But I think, you will understand this example.
 
 
External_Function LoadImage "LoadImageA" User32.dll ;
   Integer hInst String sImage Integer iType Integer cx Integer cy Integer iFlags Returns Handle
 
move (LoadImage (GetModuleHandle (0), "SC_NVKUND.BMP", IMAGE_BITMAP,0, 0, 0)) to hBitmap
        
send ComAddBitmap of hoImageManager hBitmap C_BITMAP_SC_NVKUND xtpImageNormal true
        
 
 


Posted By: Oleg
Date Posted: 06 February 2008 at 9:24am
Hi,
 
LoadImage can fail. Use Icons.LoadBitmap or Icons.LoadBitmapFromResource method to load alpha bitmap instead of
LoadImage.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: RJungmann
Date Posted: 06 February 2008 at 10:03am
Ok, I tried it with LoadBitmap, but the bitmap isn't loaded.
 
send ComLoadBitmap of hoImageManager "h:\xap7\bitmaps\SC_NVKUNDV.BMP" C_BITMAP_SC_NVOBJEKT XTPImageNormal
 
hoImageManager is a child-object from the shortcutbar from class cCJImageManagerIcons.
 
Because I haven't  a resource, I can't trie LoadBitmapFromResource.
 
Very interesting is, that LoadImage/AddBitmap works fine, until I start the program from another computer by remote desktop. That's, what confuse me.


Posted By: Oleg
Date Posted: 07 February 2008 at 1:08am
Your code "LoadImage (GetModuleHandle (0), "SC_NVKUND.BMP", IMAGE_BITMAP,0, 0, 0)) to hBitmap" seems load image from resource - not from file.
 
another option is add ImageManager object from CommandBars package, add images in designtime and assign them to ShortcutBar:
.Icons = ImageManager.Icons


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net