Old 12th November 2010, 17:24   #1
zivha
Junior Member
 
Join Date: Aug 2010
Posts: 44
ebanner - weird problem on some machines

Hello,

I am struggling to figure out what is wrong with a simple piece of code. The code seems to run on most machines and different OS. On one machine it does not.

I am using modern UI2 using custom dialog boxes. I need to display a logo on the right top corner of the dialog, the logo can change dynamically so I am creating it with ebanner.

Here is the relevant snippet of code creating the dialog and placing the logo

nsDialogs::Create 1018
Pop $Dialog

${NSD_CreateBitmap} -120 9u 120 80 ""
Pop $R0
ebanner::show /NOUNLOAD /HWND=$R0 /HALIGN=MIDDLE /VALIGN=MIDDLE "$TMP\logo.png"

nsDialogs::Show

I have two machines, both run Windows 7 64 bit, one one machine this code displays an empty dialog with the logo on the right top corner. On the other machine it displays an empty dialog, the logo is just not displayed.

Any ideas??? struggling to figure out what is wrong with this piece of code...

Thanks!
zivha is offline   Reply With Quote
Old 13th November 2010, 14:26   #2
zivha
Junior Member
 
Join Date: Aug 2010
Posts: 44
Ok - after more digging and searching I found the following. eBanner uses IImgCtx COM interface to decode the PNG file. The machine on which ebanner fails also has IE9 beta installed, it seems that IE9 made some changes to this interface...

now to figure out how to get around it, wish there was a plugin that included a decoder.
zivha is offline   Reply With Quote
Old 13th November 2010, 16:53   #3
Wizou
Senior Member
 
Join Date: Aug 2007
Location: Paris, France
Posts: 304
The problem has been signaled to Microsoft : https://connect.microsoft.com/IE/fee...lling-ie9-beta

It is not sure they will fix the problem.
Wizou is offline   Reply With Quote
Old 13th November 2010, 17:16   #4
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
Thanks, zivha, I could reproduce this problem after installing IE9.
I found one link with the same situation
http://social.msdn.microsoft.com/For...0-f7b8c9a715ec
Probably this guy sent request to connect.microsoft.com as well but I could not find this.
In Codeproject IImg_Ctx comments (end of http://www.codeproject.com/KB/graphi...txDecoder.aspx page, latest comment) you can find the same link as Wizou just published, but for me this link is unavailable. Fortunatelly comment includes reply from MS: "Apparently IE9 beta brings this component down, so all coders out there forget this stuff as soon as you can. And sorry for those who already used it in their projects, you're in big trouble. Remember, microsoft will always outplay you! And yes, this is officially confirmed by microsoft, look here: They are "surprised that it does not crash", very funny guys indeed."
May be it's to to use GDI+ ?...
After some googling: Oups, GDI+ may not work even on Vista...
If situation will be confirmed, the only 'all Win versions compatible' way I see is to use OleLoadPicture with 24-bit BMP or JPEG for 'dynamic' images. 7z compression is very good, so file size is not a problem.
Takhir is offline   Reply With Quote
Old 13th November 2010, 21:17   #5
Wizou
Senior Member
 
Join Date: Aug 2007
Location: Paris, France
Posts: 304
To view the URL, you need to register on connect.microsoft.com and demand access to product "IE".
It's free, quick and immediate.
Wizou is offline   Reply With Quote
Old 14th November 2010, 07:34   #6
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
Wizou - thanks!
zivha - "(or maybe never really did)" - we had not any problems with this plug-in before IE9. BTW if you don't need 24-bit color, you can use AnimGif with static gif, if my memory doesn't fail me it supports transparency.
Takhir is offline   Reply With Quote
Old 14th November 2010, 16:05   #7
Wizou
Senior Member
 
Join Date: Aug 2007
Location: Paris, France
Posts: 304
(GIFs are 8-bit and transparency is only on/off, no blending)
Wizou is offline   Reply With Quote
Old 14th November 2010, 00:53   #8
zivha
Junior Member
 
Join Date: Aug 2010
Posts: 44
Yeah guys, thanks for all the feedback.

So I guess this means ebanner plugin should be deprecated and removed? it seems to no longer (or maybe never really did) work well anymore as it uses this interface.

As for another solution, I would appreciate any help or ideas you have, how can one go about putting a PNG on a dialog if transparency support is important? I want the PNG backgroudn to match the dialog background and using transparency seems like the right way to go. Embedding a decoder would be big and troublesome. What is one to do?
zivha is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump