Highlighted
Absent Member.
Absent Member.
1131 views

Undefined Class

Jump to solution

PROBLEM : System.Drawing.Image is not recognised ------------------------------------------------

I want to read the contents of a jpg file and  

*>1 - Create a thumbnail from a photo (quality 100 % , 320, 320) *>2 -   resize the photo to a maximum size (quality 100, 1680, 1050) *>3 -   Get exif info as one string

*> One of the MAIN problems i encounter is that all references to  :

type System.Drawing.Image is not recognised by the compiler as a valid class or method  ?????????????

(the method : System.Drawing.Image.Fromfile(filename string) looks usefull here )

When i open  Namespaces in the property tab of the project, System.Drawing is not present.

I am using Visual Cobol 2.2. , Visual Studio 2012 , .framework 4.5 and the program is defined as : managed console application.

The program reads an input text-file containing the full path and file name of one foto ( one per line).

REMARK: I can not use windows forms , because the program contains embedded SQL instructions that render errors in de forms-designer (problem is accepted my microfocus as defect, status medium, defect number 2686287)

------------------------------------------------------------------------------------------ Another try : ------------------------------------------------------------------------------------------

I am using Visual Cobol 2.2. , Visual Studio 2012 , .Netframework 4.5 and the program is defined as : managed console application.

01 inp-filename pic x(100). 01 input-document-data type System.Byte[].

*> Input-file name contains full pathname and file of a jpg-file *> input-document-data contains the complete contents (array) *> of the specified foto after the next instructions are executed :

 move 'C:\fotos\flower.jpg' to inp-filename  invoke type System.IO.File::ReadAllBytes(inp-filename) RETURNING input-document-data

but the same problem : the method : System.Drawing.Image...... is not recognized if i want to use System.Drawing.Image.Fromstream method

When i open  Namespaces in the property tab of the project, System.Drawing is not present.

-----------------------------------------------------------------------------------------------

 

 

Tags (3)
0 Likes
1 Solution

Accepted Solutions
Highlighted
Micro Focus Expert
Micro Focus Expert

Do you have a Reference to the System.Drawing assembly?  You will need to right-click on the References tab in the VS project, then select Add Reference/framework, find System.Drawing and ensure that it is ticked.

View solution in original post

0 Likes
2 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

Do you have a Reference to the System.Drawing assembly?  You will need to right-click on the References tab in the VS project, then select Add Reference/framework, find System.Drawing and ensure that it is ticked.

View solution in original post

0 Likes
Highlighted
Absent Member.
Absent Member.

Hello Robert,

Thank you for your quick and to the point response.

Jan Vink

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.