Quantcast
Channel: NAV Three Tier — mibuso.com
Viewing all articles
Browse latest Browse all 10032

DotNet Interop - Platform Bug?

$
0
0
I have a very simple piece of DotNet. I am trying to create a rectangle to show on a report. The code works the first two times it is run and then fails with the message

A call to System.Drawing.Graphics.FillRectangle failed with this message: Parameter is not valid.

Variables
Name	DataType	Subtype	Length
LocalImage	DotNet	System.Drawing.Image.'System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'	
LocalImageFormat	DotNet	System.Drawing.Imaging.ImageFormat.'System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'	
Bitmap	DotNet	System.Drawing.Bitmap.'System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'	
Graphics	DotNet	System.Drawing.Graphics.'System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'	
Brushes	DotNet	System.Drawing.Brushes.'System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'	
InStr	InStream		

GlobalTempPicture happens to be a temporary item record (table 27) but could be a TempBLOB


Code
GlobalTempPicture.DELETEALL;

Bitmap := Bitmap.Bitmap(300,50);
LocalImage := Bitmap;
Graphics := Graphics.FromImage(LocalImage);

//This line fails - I don;'t know why
Graphics.FillRectangle(Brushes.Green,0,0,300,50);


GlobalTempPicture.Picture.CREATEINSTREAM(InStr);
LocalImage.Save(InStr,LocalImageFormat.Jpeg);
GlobalTempPicture.INSERT;

it makes no difference if I clear all the variables. I can't see that I am doing anything wrong - is this a bug?

If anyone would like the object then please let me know.

thanks in advance!

James

Viewing all articles
Browse latest Browse all 10032

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>