dzImage Library

linum

Active Member
Licensed User
Hello. I'm having a real hard time combining two images into one. Here's a very basic example of what I'm trying to do by using:

B4X:
CombineImagesVertical(Image1, Image2)


There is no example that illustrates how to use this option.

Can somebody please take a look at my example and tell me what I'm doing wrong?


Thank you...
 
Last edited:

corwin42

Expert
Licensed User
Longtime User
I just played around with it a little bit.

CombineImagesVertical(Image1, Image2) RETURNS an image so you have to write:

B4X:
Im2.Image = Im2.CombineImagesVertical(ImF.Image, ImS.Image)

But this doesn't work too because it combines only two times the second image. I have no idea why. Perhaps a bug in dzImage?

Greetings
Markus
 

klaus

Expert
Licensed User
Longtime User
Hi have also looked at it and found the missing Im2.Image = Img.Comb...
and the same strange behaviour as corwin42.
It's the same strange behaviour with CombineImagesHorizontally.

As a workaround I added 2 standard non visible Image controls.
With these 2 it works. But don't know why.

Attached the modifyed program.

Best regards.
 

corwin42

Expert
Licensed User
Longtime User
I found out that if you have more than one ImageClass object the New1 Method of the second object destroys the first object:

Example:
B4X:
ImF.New1
ImF.ControlCapture("pnlF", 0, 0, pnlF.Width, 511)

ImS.New1
ImS.Image=ImF.FlipHorizontal(ImF.Image)

This gives an error while accessing ImF.Image in ImF.FlipHorizontal(). If you put the ImS.New1 on top of the program there is no error. So I think the New1 Method of ImS makes some changes in global data structures of the class and destroys (parts) of the ImF object.

It seems to be dangerous to have more than one instance of ImageClass in one program. Unfortunately the source is not available so only Dimitris may look into it.

Greetings,
Markus
 

agraham

Expert
Licensed User
Longtime User
It seems to be dangerous to have more than one instance of ImageClass in one program. Unfortunately the source is not available so only Dimitris may look into it.
I've had a look with Reflector and the Bitmap is a static object that is nulled on New1 so as you say only one instance of ImageClass is possible :(. You can probably do most of what you want, but in a different way, with ImageLibEx. If you need something that is missing from it then I can probably add it for you.
 

linum

Active Member
Licensed User
Wow! I wake up and see it's a good morning because my problem has been solved.


Thank you guys...


Agraham: I'm probably going to be using the ImageLibEx to shrink some of my images. It would be nice if you added a combine method to ImageLibEx, just to have a library that does it all under one roof instead of having to use two different image libs in a project.
 
Last edited:

agraham

Expert
Licensed User
Longtime User
It would be nice if you added a combine method to ImageLibEx, just to have a library that does it all under one roof instead of having to use two different image libs in a project.
No need to! You can do it yourself with more control over the relative image placement. See the attachment, this is what dzIMage does to combine images. Also ImageLibEx can be merged but dzIMage can't.
 

Discorez

Member
Licensed User
Longtime User
Hi!
I have a small problem...
Sometimes, on a screenshot the cursor 'busy' is visible (in picture centre). Why so can be?
I use following methods:
ScreenCapture
SaveImageJPEG

Example:
 

Attachments

  • ScreenShot_3.jpg
    ScreenShot_3.jpg
    14.8 KB · Views: 12

Discorez

Member
Licensed User
Longtime User
The problem is not solved...
ImageLibEx - very good library, but the version for device saves only in JPEG, and me is necessary in BMP and GIF (PNG) too.
May be, somebody have sources dzImage Library and can comment code where to show waiting cursor?
 

Discorez

Member
Licensed User
Longtime User
agraham
That is a device, not a library, limitation.
Device limitation? Why? :confused:

klaus
What OS do you have ?
WM 6.5.3

On my htc Touch HD WM6.1 I can save BMP, JPG, GIF, PNG files with the SaveImage function in the ImageLibEx library.
Interesting... In the help it's specified that only JPEG supported on device.
Now, I will create a test project and will try SaveImage function on my device.
 

Discorez

Member
Licensed User
Longtime User
klaus, thanks! It works! :sign0027:
I have made some screenshots and the waiting cursor it is not visible.
 

Saj

Active Member
Licensed User
In an earlier version of this library there was a 'DrawImage(target image, source image,x,y,width,height)' property which allowed an image to be pasted into another image. Has this capability been replaced with something else?
 

Tex8503

Active Member
Licensed User
Longtime User
Where can the latest version of this library be found... ? Doesn't appear to be 6.9 compatible...
 
Top