EmEditor (text editor) Forum Index
   Questions and Answers about Plug-ins
     Cannot understand how EP_GET_MASK works
Register To Post

Threaded | Oldest First Previous Topic | Next Topic | Bottom
Poster Thread
Flint
Posted on: 1/10/2010 2:25 pm
Home away from home
Joined: 10/9/2006
From: Moscow
Posts: 156
Re: Cannot understand how EP_GET_MASK works
I see, I'll keep that in mind.

But even if the problem is in adjusting color palette, why simple repositioning of the transparent color fixes the problem completely? I don't change the color itself, I don't change colors of other pixels, I just move one color in the index table, and that's all.

PS: Since I found how to eliminate the problem on the plugin's side, it no longer bothers me as itself, but I'm concerned about possible bug in EmEditor which caused such strange behaviour.
Yutaka
Posted on: 1/7/2010 9:17 am
Webmaster
Joined: 9/28/2006
From: Redmond
Posts: 2401
Re: Cannot understand how EP_GET_MASK works
I think the issue is the color palette with 256-color mode. Even if your plug-in bitmap looks fine by itself, it becomes ugly with other plug-ins because the color palette must be adjusted with other bitmaps. For this reason, I would recommend you not adding 256-color bitmaps. Just use true-color bitmaps and 16-color bitmaps, and omit 256-color bitmaps. In most of my standard plug-ins, I don't supply 256-color bitmaps any more for this reason. Most PCs now display true color, and 256-color mode is becoming obsolete. The 256-color mode feature might be taken out in the future.


----------------
Yutaka Emura
Developer of EmEditor
http://www.emeditor.com/

Flint
Posted on: 1/7/2010 12:45 am
Home away from home
Joined: 10/9/2006
From: Moscow
Posts: 156
Cannot understand how EP_GET_MASK works
In developing a plugin I met a problem with the toolbar icon. I followed the instructions in the help file and for 256-color icons I decided to make RGB(1, 1, 1) a transparent color. So, I designed an icon with 4 pixels in corners with this color (to make it look a bit rounded), and in the code I wrote:
case EP_GET_MASK:
	if  ((wParam & BITMAP_COLOR_MASK) == BITMAP_24BIT_COLOR)
		lResult = CLR_NONE;
	else if ((wParam & BITMAP_COLOR_MASK) == BITMAP_256_COLOR)
		lResult = RGB(1, 1, 1);
	break;

However, when I try the plugin in 256-color mode, its toolbar icon becomes garbled. Here is the screenshot of how the icon looks as itself and when shown by EmEditor:



EE 9.07; OS Vista Business SP2 x32 working in true-color mode.


<EDITED>
I performed some more experiments and found the following:
1. If I return CLR_NONE instead of RGB(...), the color with index 0 from the image's index table is used for transparency.
2. The problem seems to lie in fact that my transparent color has index 0. When I move it further in the index table, the problem seems to be gone.

The questions are: what are the "official" recommendations on creating transparent images, and why is all this not described in the help?
Threaded | Oldest First Previous Topic | Next Topic | Top


Register To Post
 
English čeština Deutsch español français italiano 日本語 한국어 Русский 简体中文 繁體中文