.NET Calls to Image

Using (or providing) Microsoft.NET Classes

.NET Calls to Image

Postby neeraj on Sat May 08, 2010 3:35 am

I am having problems with some .NET code. I am trying to create an imagelist that I want to assign to a DevExpress Ribbon Control.
Code: Select all
 ⎕USING←'System'
 ⎕USING,←⊂'System.Windows.Forms,system.windows.forms.dll'
 ⎕USING,←⊂'System.Drawing,system.drawing.dll'
 ⎕USING,←⊂'System.ComponentModel,system.dll'
 ILIST←⎕NEW ImageList
 IMAGE←⎕NEW Image.FromFile'C:\TEMP\TEXT.BMP'


The last line does not work. I have tried variants of the last line
Code: Select all
 IMAGE←⎕NEW Image.FromFile⊂'C:\TEMP\TEXT.BMP'      ⍝ does not work
 IMAGE←⎕NEW Image.FromFile,⊂'C:\TEMP\TEXT.BMP'     ⍝ does not work


I have also tried to create a string
Code: Select all
 S←⎕NEW String (⊂'C:\TEMP\TEXT.BMP' )
      S
C:\TEMP\TEXT.BMP
I←⎕NEW Image.FromFile S                             ⍝ does not work


What am I doing wrong? Also, is there sample code that shows how to use the ribbon control from DevExpress?
neeraj
 
Posts: 82
Joined: Wed Dec 02, 2009 12:10 am
Location: Ithaca, NY, USA

Re: .NET Calls to Image

Postby Morten|Dyalog on Sat May 08, 2010 8:08 am

Image.FromFile is a method, not a class. So what you need is:

Code: Select all
      IMAGE←Image.FromFile ⊂'C:\TEMP\TEXT.BMP'
      IMAGE
System.Drawing.Bitmap


Since v11.0, you have to enclose single string arguments in order to disambiguate from a single character array argument; we found some methods which took both "overloads".

In APL#, "C:\TEMP\TEXT.BMP" (in double quotes) will be a string (a scalar), and 'C:\TEMP\TEXT.BMP' will continue to be a "character vector". We may introduce the same distinction in Dyalog APL in a future release, it realy helps you work with other languages if you can distinguish between the two.

Regarding DevExpress, I don't have any code but they have given me an evaluation copy in return for my investigating the product and writing up some examples of how to use it with APL. I would be very interested in hearing from you regarding your progress, and happy to help you look at examples which are not working, to see if there is anything Dyalog can do to help.
User avatar
Morten|Dyalog
 
Posts: 453
Joined: Tue Sep 09, 2008 3:52 pm

Re: .NET Calls to Image

Postby neeraj on Sun May 09, 2010 3:31 am

Thanks. Digging deeper I see that Image is an abstract class so cannot be used to create an object.

Morton, I have sent you a workspace with some sample code.

Thanks
Neeraj
neeraj
 
Posts: 82
Joined: Wed Dec 02, 2009 12:10 am
Location: Ithaca, NY, USA

Re: .NET Calls to Image

Postby neeraj on Tue May 11, 2010 4:46 am

Morton:

I have spent a couple of days on the ribbon toolbar and I am stuck. I have not found a way to assign a popup menu to a dropdown button or to assign a SuperTip to a button item. Since the ribbon toolbar is of general public use I am wondering if Dyalog can post some sample code showing how to use the most common features of the DevExpress ribbon toolbar.

Thanks
Neeraj
neeraj
 
Posts: 82
Joined: Wed Dec 02, 2009 12:10 am
Location: Ithaca, NY, USA


Return to Microsoft.NET

Who is online

Users browsing this forum: No registered users and 1 guest