ImageLibEx library

agraham

Expert
Licensed User
Longtime User
I mean if you load the image, then see it is the wrong one and try to load another image into the imagebox form the app direrctory.
I don't see a problem doing that either. I think you need to post a zip of your app directory with libraries, code and images and a step by step description of how to demonstrate the problem.
 

Softselect

Member
Licensed User
Here it is
1. open form designer
2. click on image
3. click image button select image Softsect
4. view image in designer dont close form1
5. click image button again and select image softselect new logo
and then the error comes up (see Error screen shot)
could it have something to do with my path its quite long
d:\alldata\basic4ppc\softselect code\bitmap test\
Thanks again
You are a star
 

wolfgang

Member
Licensed User
Longtime User
Hi,
no problem with V6.5 and XP Home SP3. Maybe rename your file to softselect_new_logo.bmp
 

Softselect

Member
Licensed User
I tried that, no luck
I have XP Prof SP3 and V6.5
the funny thing is if i delete the image from the app dir and load the same file from a different directory it works fine
Strange things happening, maybe its got something to do with the heat in South Africa 33c here today
Thanks Friedrich
 

agraham

Expert
Licensed User
Longtime User
No, I can't get it to go wrong. I've even replicated your paths on my D: drive. Interestingly in the background of the error screen shot it looks like the correct image actually is loaded. Is it possible that the image file is open in another app like an image editor? Also if you reboot and try again does the error persist?
 

derez

Expert
Licensed User
Longtime User
1.2 loading problem ?

andrew
I have a strange problem which I can't solve. I loaded the 1.2 version and stored it in the library directory (with the cs and help)
If I start a new program and use it - everything works fine.
If I add the dll to my existing GPS program - I can't get the RotateHQ and RotateFast, as if I use the previous version.
Is there interference with the other libraries ?
see attached list
 

Attachments

  • dlls.JPG
    15.5 KB · Views: 10
Last edited:

derez

Expert
Licensed User
Longtime User
In the directory of the program I had the previous version dll.
Loading the library from another source (the basic library directory) didn't copy the new version, and the program used the old, which does not have these two functions.

I think that it should have copied the selected library even if a library with the same name exist, but that is not the problem of this specific library.
Thanks.
 

agraham

Expert
Licensed User
Longtime User
Version 1.3 now posted with a single new method in BitmapEx - AlphaBlend. This allows a specified portion of a source bitmap to be blended with a destination bitmap using a specified transparency value. Optionally a colour in the source bitmap may be specified as transparent and hence not blended with the destination. This needs .NET 2.0 but will work on both device and desktop.

Note that this does not cope with images such as PNGs and GIFs that have individual alpha values for each pixel. I had initially hoped to do this but it would only have been available on WM5.0 and later on the device. Implementing this would have required native calls to the Windows GDI on the device as the Compact Framework does not support this. In the end the grief involved in getting it working properly, mapping it sensibly into ImageLibEx for access from Basic4ppc and implementing a desktop compatible version was just too much effort to be regarded as fun :sign0137: so I rolled my own implementation with direct bitmap pixel manipulation . The upside is that this works identically on device and desktop and doesn't require WM5.0 or later and so runs on any device that can run .NET 2.0.
 

klaus

Expert
Licensed User
Longtime User
Hi Andrew,
I have a strange problem. In my CAD program I am using the ImageLibEx library and get the error below when I compile for the device, compiling for the desktop is OK, compiling for the device non optimized is OK.

Then I tried a test program I already had, added the objects I use in the CAD program and get the same error. Then I removed the objects one after the other and get the same error as long as the ImageLibEx is in the Components.
Then I began a new porgram in a new folder, just a Form with nothing in it. Added the ImageLibEx libraries and get the same error. Tried with older versions of the librariers, still the same.
Then I tested the Weather program that also uses the ImageLibEx library. When I compile this program for the device it's OK !?
Then I removed and added the libraries in the IDE, still OK.
Then I began a new program in the same folder, just one Form and nothing in, added the ImageLibEx libraries in the Components, and nothing else, when compiling for the device I get the error.
It seems that the problem is with the cs file because renaming it in the B4PPC libraries folder, the compilation is OK.
I attached the whole Weather folder and images of the error message and the content of the B4PPC Libraries folder.

The example code in the ImageLibEx1.3 gives the same error.

I am somewhat confused with this behaviour and don't understand what I am missing.

Best regards and thank you in advance for your help.
 

Attachments

  • Error.jpg
    18.4 KB · Views: 10

agraham

Expert
Licensed User
Longtime User
I am afraid you haven't read the first post properly
This has been needed for source merging since version 1.1, I am surprised you haven't come across it before
 

agraham

Expert
Licensed User
Longtime User
Is there another keyword that forces Basic4ppc to reference the .NET assembly, because in the Weather program SIP is never used ?
No but "SIP(False)" as the first statement in App_Start is benign and causes no problems, it just forces the optimising compiler to include a reference to the Microsoft.WindowsCE.Forms assembly.
 

agraham

Expert
Licensed User
Longtime User
what I don't understand is that it works with the Weather program even though there is no SIP elsewhere in this program.
Sorry, I didn't understand what you meant, I thought that for some reason you didn't want to use a SIP statement - I didn't realise that you meant that Weather compiled OK without. The answer is I don't know.
 

agraham

Expert
Licensed User
Longtime User
It should have been obvious :sign0161: It's having the HardwareDesktop library in the project that forces it because of the entry in LibrariesExceptions.txt. The next release of Basic4ppc will include ImageLibEx in this file to force the reference when that is used.

B4X:
'1 - Namespace changes
'2 - Device additional references
'3 - Desktop additional references
1:dzHWdesktop.dll:dzHWdesktop->dzHW
2[B][COLOR="red"]:HardwareDesktop.dll:Microsoft.WindowsCE.Forms.dll[/COLOR][/B]
2:ControlsExDeviceDummy.dll:Microsoft.WindowsCE.Forms.dll
 

klaus

Expert
Licensed User
Longtime User
Hi Andrew,

I have a question about the NormalFont Object in the ImageLibEx library.
I use a DrawerEx Object to draw strings with a NormalFont object attached to this drawer.
Each time I change the Font.Size I must redefine the Font to the drawer with Drawer.Font=Font1.Value.
I would have expected that once a font is attached to a drawer it remains to it even when changing the font parameter.
Attached a small test code.

Thank you in advance and Best regards.
 

Attachments

  • FontTest.sbp
    983 bytes · Views: 19
Cookies are required to use this site. You must accept them to continue using the site. Learn more…