The saga started when I decided to draw the maps on an image, instead of on the form, so that when rotated it will not have blank areas (by using an image larger then the form.
The difference is using imagelibEX function, so the problem is not in the compiler only. If the compiler adds GetBitmapFromString(something) then it should be added in imagelibEx internal code.
__________________
David Erez
Ramat Hasharon, Israel
I've had a look at a lot of generated ImageList code over the the last 24 hours and I'm afraid it is unless Erel intended ImageList to only work properly with Form.DrawImage, or the intrinsic Image control, which I doubt.
Form.DrawImage is specified to take either a filename or a bitmap as a source image and the compiler ensures this by compiling in GetBitmapFromString for the source bitmap parameter. This is a special case, which is undesirable but I suspect is supported for backwards compatibility from before ImageLib.Bitmap was available.
Both ImageLib.Drawer.DrawImage1 and ImageLibEx.DrawerEx.DrawImage are specified to only accept a bitmap as a source image. For neither of these does the compiler include GetBitmapFromString which is understandable as they would be special cases and the compiler shouldn't make assumptions about external libraries. Instead the compiler sensibly tries to ensure that ImageList only holds bitmap references by compiling in GetBitmapFromString for ImageList.Add and ImageList.Insert. It also compiles in a similar GetBitmapFromResource function when adding the bitmaps specified at design time. To ensure the only references are held it should also do that for a direct assignment to ImageList.Item(x) which it doesn't do. I regard that as a compiler bug.
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Version 2.0 posted with an Icon object that can retrieve the default icon from an exe or dll and transform it into a bitmap if required. There is not much else it can do as the .NET Icon class has restricted functionality in the Compact Framework - and not much more on the desktop!
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Andrew
I am glad for this improvement but cant get it to work, please tell me what i'm doing wrong, trying all possible combinations with the code below:
Code:
Sub App_Start Form1.Show img.New4 ' image1.Image = AppPath & "\startup.ico" icn.New1( AppPath & "\startup.ico") icn.Value = icn.GetIcon0(AppPath & "\startup2.exe",True) img.Value = icn.ToBitmap(icn.Value) form1.Text = icn.ValueIsNull image1.Image = icn.Value End Sub
img is bitmapEX object, icn is icon object, image1 is an image control.
From the marked line alone I get the icon on the image. the form text is false as required but the image is null...
__________________
David Erez
Ramat Hasharon, Israel
I am studying the gradient fill issue, starting from this library.
I tried to compile the exact file using sharpdevelop 2 and succeeded only with the desktop version.
With the Device, it finishes the compilation but when I run the application that use the library it creates the attached error.
I downloaded this coredll.dll and put it everywhere but nothing helps.
In the source it has this line:
[DllImport("coredll.dll", SetLastError = true, EntryPoint = "GradientFill")]
What should I do ?
Edit: Foolish me, it doesn't run on the Desktop but it runs on the device !
Thanks
__________________
David Erez
Ramat Hasharon, Israel