Command 25: Select Watermark Image

[Top]  [Chapter]  [Previous]  [Next]

You can use Command(143,..) to load a watermark image into a "slot".

 

Using the Memo.Command 25 it is possible to select during the OnNotify event a watermark of a certain slot.

 

If paramA is 0, the method will return the page number which is about to be painted.

 

If paramA=1, the slot with the number paramB will be selected.

 

Example:

 

Load the watermarks as metafiles using Command(143):

 

      private void button5_Click(object sender, System.EventArgs e)

      {

               // Fill 3 slots and activate the display

               wpdllInt1.Command( 143, 0, @"c:\1.emf");

               wpdllInt1.Command( 143, 1, @"c:\2.emf");

               wpdllInt1.Command( 143, 2, @"c:\5.emf");

               wpdllInt1.ProcessWPA("ShowWatermark", "1");

      }

 

Select the watermark in the OnNotify Event:

 

      private void wpdllInt1_OnNotify(object Sender, int Editor, int MsgID)

      {

               if (MsgID==29)

               {

                     int pagenr =    wpdllInt1.Memo.TextCommand( 25, 0, 0);

                        if ( pagenr==0) // Page 1, select slot 0

                                    wpdllInt1.Memo.TextCommand( 25, 1, 0);

                        else if ( pagenr==4) // Page 5, select slot 2

                                    wpdllInt1.Memo.TextCommand( 25, 1, 2);

                        else  // otherwise select slot 1

                                    wpdllInt1.Memo.TextCommand( 25, 1, 1);

 

               }

      }

 

 


[command_25_select_watermark_im.htm]    Copyright © 2007 by WPCubed GmbH