next week I will do a photo shooting in our school. The camera is sending the pictures to a PTP Drive and normaly directly to a "Hotfolder" for my printer. Because of "selecting best pictures" I created a little prg witch is in the middle of this process. It scans the PTP-Folder for new images and it works as a picture viewer. Once you decided for a pic - it will be copied to the "Hotfolder" for the printer. Other pics you can mark as "ignore" ans so on...
It's all based on Forms and OCX elements... At some other thread I found an easy way to add my overlay to the pircture preview ... (L_SetFormTransparency) Because the image comes "raw" from the camera - the printer will add a frame arround... To have a better look - I added the fram to my preview as an overlay...Works great.
BUT ... now... I guess everybody knows my problem: How to handle the portrait format from the camera. (Which is the landscape 90° rotatet) Is there an easy way to turn the picture (preferred loaded with LoadPicture).... or is there another way to do something like this. I show the picture in the image ocx. I have no problem to change size from W/H to H/W by a mouse click....
But what is the easies way to get the picture rotated 90° and use it in my image OCX?
to use an external tool is the worst case. I used such tools in the past, to convert animated GIFs an so on... but this is not what I want here. I already use AISExif for the Orientation. I too have cxXImage - the library is great and makes it possible to handle 100MP files - change it and lable them... but it's slow. Here I have 24MP files... and look for a smart way to rotate them - and still use them as a picture....
Yes, option 1 is the way. But it's just the rotation. If can trigger the function because I have the information about the orientation... And - yes - it's just for viewing - I do not touch the original file.
At this time I load the picture with LoadPicture("") ... and later I use the PictureObject to set the PictureValue of an OCX. The perfect solution would be a function - which will just produce a new PictureObject ;-)))
My solution now is - using csXImage from ChestySoft. It's doing a great job with very very large pictures ... but it's very slow - even with smaller pictures. And for this job - it seems a little bit oversized ;-)))
By the way: Since some releases of GFA - I get an OLE Error, when I start the code again - after using the CreateObject function.
Yes. I tried this first - but I have no idea how I can use this heavy DLL in my case ... For me it looks like - it's to much ported for a pictures viewer/manipulator.... I have not enoutgh expirience with DCs ...
Look with "cxS":
Set IB = CreateObject("csXImage.ImageBox") IB.LoadFromFile "myfile.jpg" IB.Rotate(270) someocx.Picture = IB.Picture
Thats all ... ;-)
So, with "freeImage.dll" I could not even load a picture because I did not find out how to create a object for it - without using a window or form - or whatever....
Hi Ademeo, My advice is that you should use the GetBitmapBits () function to directly process the image data. I will try to lay a small example code before tonight. I would do this quietly by looking at "back to the future 2" after eating. See you soon !
Nicolas Rey (Sorry for my poor english i speak french in fact)
Bravo, vraiment ! Je n'avais jamais réussi à utiliser cette satanée fonction GetDIBits(), merci pour le partage ! J'utilisais la bonne vieille GetBitmapBits() avec le problème d'avoir à convertir en RGBA derrière, une nouvelle ère s'ouvre devant moi . J'ai testé ca marche nickel.
Je pense que c'est très exactement ce dont avait besoint sir Ademeo !
Good Job !!! Well done, really! I had never been able to use that damn GetDIBits () function, thanks for sharing! I was using the good old GetBitmapBits () with the problem of having to convert to RGBA behind, a new era opens before me . I tested it works nickel. I think that is exactly what Sir Ademeo needed!