Como pasar este codigo a VFP

105 views
Skip to first unread message

ZeRoberto

unread,
Aug 18, 2016, 12:17:00 PM8/18/16
to publicesvfoxpro
Quiero pasar este codigo a VFP, pero me doy cuenta que el gdiplus no tiene la opcion LevelsParams, me refiero al gdiplus que biene con el SYSTEM.APP

VOID Example_LevelsSetParameters(HDC hdc)
{
   Graphics graphics(hdc);
   Image myImage(L"Photograph.jpg");

   REAL srcWidth = (REAL)myImage.GetWidth();
   REAL srcHeight = (REAL)myImage.GetHeight();
   RectF srcRect(0.0f, 0.0f, srcWidth, srcHeight);
   Matrix myMatrix(1.0f, 0.0f, 0.0f, 1.0f, 450.0f, 20.0f);

   LevelsParams myLevelsParams;
   
   myLevelsParams.highlight = 100; // no change
   myLevelsParams.midtone = 0;     // no change
   myLevelsParams.shadow = 20;     // Darken the dark areas.
  
   Levels myLevels;
   myLevels.SetParameters(&myLevelsParams);

   // Draw the image with no change.
   graphics.DrawImage(&myImage, 20.0, 20.0, srcWidth, srcHeight);

   // Draw the adjusted image.
   graphics.DrawImage(&myImage, &srcRect, &myMatrix, &myLevels, NULL, UnitPixel);

Alguna idea?

Carlos Miguel FARIAS

unread,
Aug 18, 2016, 1:33:04 PM8/18/16
to Grupo Fox
Más allá de convertirlo a Fox o no, el tema va a ser acceder a las librerías y clases mencionadas en el código. Se mencionan tipos (Graphics, Image, HDC) que no veo que se estén definiendo allí, y si son propias, deberías ver como se incorporan o acceden desde VFP para crear las instancias de objetos correspondientes.
Saludos: Miguel, La Pampa (RA)
Larga Vida y Prosperidad
Que la Fuerza los acompañe, quien no presta una idea? 

ZeRoberto

unread,
Aug 19, 2016, 3:49:18 PM8/19/16
to publicesvfoxpro
Carlos para eso hay una clase llamada GdiPlusX pero creo que el problema es que no tiene la rutina LevelsParams
Reply all
Reply to author
Forward
0 new messages