|
Post by ademeo on Dec 9, 2020 20:42:49 GMT 1
Hello,
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?
Thank you!
|
|
webu
Full Member
 
Posts: 102
|
Post by webu on Dec 9, 2020 22:25:49 GMT 1
Just load, rotate and save the picture with "IrfanView" by commandline.
|
|
|
Post by ademeo on Dec 9, 2020 23:03:09 GMT 1
Hi JM,
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....
|
|
|
Post by ademeo on Dec 10, 2020 8:29:41 GMT 1
It's just the rotation what I need. My prg knows the orientation already and knows - if it needs to rotate... Just the rotation... ;-)
|
|
|
Post by ademeo on Dec 10, 2020 17:47:19 GMT 1
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.
OLE-ERROR 496 CoInitialize was not called
Thank you so much!
|
|
|
Post by ademeo on Dec 10, 2020 18:27:37 GMT 1
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....
|
|
|
Post by scalion on Dec 15, 2020 18:07:56 GMT 1
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 !
|
|
|
Post by scalion on Dec 15, 2020 21:06:59 GMT 1
 Well, that's work fine in my side. Take a look to this example code (with cute picture bonus) :
Now about EXIF, i have written a gfabasic 16 bits (ouch) program to retrieve information (that's a long time...). I search....
|
|
|
Post by scalion on Dec 21, 2020 10:58:32 GMT 1
[FR]
Good Job !!! 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 !
[US]
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!
|
|