Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Detecting pixel in JPG
Message
De
09/09/2005 15:18:03
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Photos et traitement d'images
Divers
Thread ID:
01048135
Message ID:
01048263
Vues:
17
>Here is it (still waiting for the meeting to start...):
>
>
>Lparameters tcFullPath as String
>
>If not File( tcFullPath )
>	RETURN
>EndIf
>
>* Get the "GDI+ Image class" from UT Downloads!
>* Thanks to Alexander Golovlev for it!
>
>#INCLUDE gpImage.h
>#DEFINE BLACK 0
>
>Copy File ( tcFullPath ) to before.jpg
>
>If PemStatus( _Screen, "imgBefore",5 )
>Else
>	_screen.AddObject("imgBefore","Image")
>EndIf
>_screen.imgBefore.Visible= .t.
>_screen.imgBefore.Picture = "before.jpg"
>
>
>Local gdi as gpInit of gpImage.prg, img as gpImage of gpImage.prg
>
>gdi = NewObject("gpInit",  "gpImage.prg")
>img = NewObject("gpImage", "gpImage.prg")
>
>img.Load("before.jpg")
>
>? img.ImageFormat, img.PixelFormat
>? img.ImageWidth, img.ImageHeight
>? img.HorizontalResolution, img.VerticalResolution
>
>* Creates a black border
>For i = 0 to img.ImageWidth-1
>	img.SetPixel(i, 0, BLACK)
>	img.SetPixel(i, img.ImageHeight-1, BLACK)
>Next
>
>For i = 0 to img.ImageHeight-1
>	img.SetPixel(0, i, BLACK)
>	img.SetPixel(img.ImageWidth-1, i, BLACK)
>Next
>
>img.SaveAsJpeg("after.jpg")
>
>If PemStatus( _Screen, "imgAfter",5 )
>Else
>	_screen.AddObject("imgAfter","Image")
>EndIf
>_screen.imgAfter.left = 200
>_screen.imgAfter.Visible= .t.
>_screen.imgAfter.Picture = "After.jpg"
>
>Return
>
>
>You can use the _FCC classes to do the same. I just started using Alexander's class a few years ago and reclled I have samples more handy.

This works.

Thanks
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform