Home > Net >  The attribute of the FORM passed as a parameter to the DLL
The attribute of the FORM passed as a parameter to the DLL

Time:10-08

I'm doing a drawing with DLL, encounter a problem,
Because it has a function in the DLL such as

Graphics g=Graphics. FromImage (bm);
G.D rawString (" 0 ", enclosing the Font, brush, 30, height - 10);

The enclosing the Font is Form1 class attribute, it is an error condition, how to put it as a parameter to the DLL function,

CodePudding user response:

There are no one support

CodePudding user response:

Form1 f1=new _click ();
Var f=f1. The Font;

CodePudding user response:

This is a scope,

CodePudding user response:

Is not can be used under the static,

CodePudding user response:

The
refer to hand on the keyboard to knock on the second floor is very light response:
Form1 f1=new Form1 ();
Var f=f1. The Font;


If I passed in the type of var, then the variable f to a DLL function, preach not prompt var type

CodePudding user response:

F1. The Font;
Is an object, as a function parameter how to pass

CodePudding user response:

Write your way to Form1 inside can play a role;

Or the Form1 inside the Font properties passed as a parameter to the way you write

CodePudding user response:

DLL the methods defined inside, this refers to the method of object, the object should never name for the Font attributes definition, you can add a Font properties, and in the constructor to initialize the default value,

CodePudding user response:

refer to the eighth floor datafansbj response:
inside the DLL method defined, this refers to the method of object, the object should never name for the Font attributes defined, you can add a Font properties, and in the constructor to initialize the default values,

That this parameter is to write a first what type of variable, then can let it is not an error, if so write Object error,

CodePudding user response:

Is System. Drawing. The Font type,

CodePudding user response:

You again not operation form, you only get a few parameters, the several parameters incoming is, how it will be under the tangle,
  •  Tags:  
  • C#
  • Related