Monthly Archives: July 2007

here are 5 new samples derived from the ones that i showed in a previous post.

 

for all the samples that i'll provide the vfpx logo will be drawn in some bigger pictures. to show all the flexibility that gdi+ can offer to us, some effects will be aplied to the logo.

 
 
important
requires vfp9 and gdiplusx to run. 
please make sure that you have the latest version!
http://www.codeplex.com/vfpx/wiki/view.aspx?title=gdiplusx&referringtitle=home

 

sample 5:

aply 100% transparency to the white color, to eliminate the background
draw the logo aplying predefined colormatrix that will the following transformation: convert to greyscale 50%… Continue reading

here's a reportlistener that generates watermark pictures in reports.

very simple to setup, just set some properties, like the logo image, width and height ratio, transparency ratio.

 

do locfile("system.app")

local lolistener as reportlistener
lolistener = createobject("watermarklistener")
lolistener.
listenertype = 1
lolistener.watermarkimage =
addbs(home()) + "graphics\gifs\morphfox.gif"
lolistener.watermarktype = 2
&& 1 = colored ; 2 = greyscale
lolistener.watermarktransparency = 0.25 && 0 = transparent ; 1 = opaque
lolistener.watermarkwidthratio = 0.75 && 0 - 1
lolistener.watermarkheightratio = 0.75 && 0 - 1

* run the report using the new report engine (object-assisted output)
report form… Continue reading

it is known that gdi+ does not bring full support to icon files. so, we can't make some simple conversions to create .ico files directly.

but there are some easy tricks that we can use to do that. the main step is to retrieve a icon handle from our bitmap, the "hicon".

the simplest aproach is to use the olecreatepictureindirect api to obtain a ole picture object reference. next step is to send this object to the savepicture() function to save it to disk.

but the problem of this technique is that the icons are generated at a lousy quality, 4bpp… Continue reading

another common request that i always find on some vfp forums is people wanting to draw some images, usually company logos over some pictures. this is really simple, as i'll show below.

for all the samples that i'll provide the vfpx logo will be drawn in some bigger pictures. to show all the flexibility that gdi+ can offer to us, some effects will be aplied to the logo.

 
 
important
requires vfp9 and gdiplusx to run. 
please make sure that you have the latest version!
http://www.codeplex.com/vfpx/wiki/view.aspx?title=gdiplusx&referringtitle=home

 

sample 1: draw image without transformation

do locfile("system.app")

with _screen.system… Continue reading

based on some great samples that i found on the web, specially those from mike gagnon, i've created my own class to send emails. i chose to use cdosys (microsoft collaboration data objects for windows 2000)because it comes with win2000 / xp / vista and 2003, and it allows to send messages in various ways, specially embedding images that are used in the html content of the message.

mapi was my first choice, but unfortunately it does not allow to embed pictures, only attachments are allowed. ms outlook automation would work too, but i don`t have it too.

 

below is… Continue reading