Jump to content
Developer Wiki and Function Reference Links ×

Changing a Layer Color after a Print Call


PeterT

Recommended Posts

Hi,

I am writing a script that will print something in black, but its layer color is grey.

In my script, I change the layer's Fill Fore color to from grey to black (0,0,17), do a call to the print command, then change the layer's Fill Fore color back to grey (187,187,187).

In the execution, the change is made to black, and it prints, but after it prints it does not change back to grey.

I have tried adding RedrawAlls, and then I put a SysBeep in after the DoMenuTextByName to make sure something would work after it, and it sounds the alert, but does not change the layer color.

What am I missing?

code:

 PROCEDURE PrintPresent;

VAR

currentlayer: HANDLE;

currentname: STRING;

BEGIN

IF GetLayerByName('ARCH STAMP (1/1)')<> NIL

THEN BEGIN

currentlayer:=ActLayer;

currentname:=GetLName(currentlayer);

Layer('BASE PLAN');

LFillFore(0,0,17);

RedrawAll;

DOMENUTEXTBYNAME('Print', 0);

LFillFore(187,187,187);

RedrawAll;

Sysbeep;

Layer(currentname);

END;

END;

RUN(PrintPresent);
[/code]

Link to comment

Peter

I'm no RGB wiz. Are you looking for the grey in the color palette that's 4 down and 2 over? That's 187,187,187 in 8 bit color but it's 59797,59797,59797 in 16. I think you might be setting back to a different black. I'm fairly sure we're talking 16 bit with VW 11 in OSX.

Alternatively, you might be able to use Push/PopAttrs, but I'm not sure if it wil capture/reset layer fill.

Charles

Link to comment

I don't know the color picker, but if you want light gray try:

LFillFore(59797,59797,59797);

Function Reference:"RGB values are in the range of 0~65535". White is 65535,65535,65535.

You're not adding enough color to see anything but black with 3 digit numbers. You need much higher numbers.

Check out the "Digital Color Meter" in utilities folder, set it to "RGB as Actual Value - 16 bit" and run that around the color palette.

Or write a simple script using ColorIndexToRGB and Message(r,g,b) to get the correct values.

I tested both LFillFore and LFillBack and they both worked in a simple script with just these calls and redrawall. On this machine 255,0,0 is black.So is 187,187,187.

Also,you might want to ensure that your document preferences are set correctly to show these changes. On my machine "Use Layer Colors" is checked, and "Black and White Only" is unchecked.

HTH

Charles

[ 08-25-2005, 06:00 PM: Message edited by: ccroft ]

Link to comment

I am just using the RGB values given using the color picker on any square in the color palette.

I have tested it further and it doesn't seem to matter what color you try to change the layer fill to, it always changes to black.

I tried to make it red by making the layer active and using LFillFore(255,0,0) and that changed it to black (0,0,0).

I then tried using SetFillFore(layerhandle,255,0,0) using a handle to the layer, and that also changed the color to (0,0,0)

In VectorScript, is black your only choice for Fill Fore color?

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...