Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Code Samples & Tips > Additional Libraries
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Additional Libraries Users contributed libraries.
This sub-forum is only available to licensed users.

ImageLibEx library

Reply
 
LinkBack Thread Tools Display Modes
  #131 (permalink)  
Old 11-24-2009, 01:21 PM
derez's Avatar
Basic4ppc Expert
 
Join Date: May 2007
Posts: 918
Awards Showcase
Beta Tester Competition Winner 
Total Awards: 2
Default

Thanks for the explanation.
In short - Somewhere something goes wrong...
__________________
David Erez
Ramat Hasharon, Israel
Reply With Quote
  #132 (permalink)  
Old 11-24-2009, 01:33 PM
derez's Avatar
Basic4ppc Expert
 
Join Date: May 2007
Posts: 918
Awards Showcase
Beta Tester Competition Winner 
Total Awards: 2
Default

I suspect that this is not the case.

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.

I was using previously this line:
Code:
form7.DrawImage(maps.Item(5),left,top, lmore ,tmore)
and never had such error.

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

Last edited by derez : 11-24-2009 at 01:37 PM.
Reply With Quote
  #133 (permalink)  
Old 11-24-2009, 02:52 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Quote:
Originally Posted by derez View Post
so the problem is not in the compiler only.
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.
Reply With Quote
  #134 (permalink)  
Old 11-24-2009, 04:03 PM
derez's Avatar
Basic4ppc Expert
 
Join Date: May 2007
Posts: 918
Awards Showcase
Beta Tester Competition Winner 
Total Awards: 2
Default

OK. Why there is no compiler problem in the test program I attached before (extest) ?
It is using the same code:
Code:
drawer.DrawImage(maps.Item(5),mapsrc.Value,mapdst.Value,False)
__________________
David Erez
Ramat Hasharon, Israel
Reply With Quote
  #135 (permalink)  
Old 11-24-2009, 04:25 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Quote:
Originally Posted by derez View Post
OK. Why there is no compiler problem in the test program I attached before
Because in that case the ImageLib contained bitmap references which are what DrawImage expects.
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Reply With Quote
  #136 (permalink)  
Old 01-21-2010, 11:04 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

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.
Reply With Quote
  #137 (permalink)  
Old 01-21-2010, 12:57 PM
derez's Avatar
Basic4ppc Expert
 
Join Date: May 2007
Posts: 918
Awards Showcase
Beta Tester Competition Winner 
Total Awards: 2
Default

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

Last edited by derez : 01-21-2010 at 01:01 PM.
Reply With Quote
  #138 (permalink)  
Old 01-21-2010, 01:48 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Try
Code:
    Form1.Show
icn.New2
icn.Value = icn.GetIcon0(AppPath & 
"\startup2.exe",True)
form1.Text = icn.ValueIsNull
image1.Image = icn.ToBitmap
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Reply With Quote
  #139 (permalink)  
Old 01-21-2010, 01:55 PM
derez's Avatar
Basic4ppc Expert
 
Join Date: May 2007
Posts: 918
Awards Showcase
Beta Tester Competition Winner 
Total Awards: 2
Default

Thank you, it works.
__________________
David Erez
Ramat Hasharon, Israel
Reply With Quote
  #140 (permalink)  
Old 02-05-2010, 09:07 AM
derez's Avatar
Basic4ppc Expert
 
Join Date: May 2007
Posts: 918
Awards Showcase
Beta Tester Competition Winner 
Total Awards: 2
Default CoreDll ?

Hi Agraham,

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

Last edited by derez : 02-05-2010 at 09:13 AM.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Door library (Beta) - Special library Erel Official Updates 60 01-13-2011 12:23 PM
Merging Outlook library and Phone library Erel Official Updates 11 09-15-2010 10:22 AM
PhoneticAlgorithms Library (ex-StringComparison Library) moster67 Additional Libraries 10 11-11-2008 08:46 PM
ImageLibEx? agraham Basic4ppc Wishlist 2 11-05-2007 02:15 PM
ImageLibeX Error XerVision Questions (Windows Mobile) 8 08-27-2007 07:14 PM


All times are GMT. The time now is 02:17 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0