Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Image in ReportListener

Status
Not open for further replies.

newtofoxpro

Programmer
Sep 16, 2007
301
IN
I am using ReportListener class for watermark. Working fine if Image exist in HDD.
What I am trying If image include in EXE. watermark does not print.
Code:
loBmp = CREATEOBJECT("GpBitmap")
loBmp.CreateFromFile(This.watermarkimage)]

Is it possible to call image/jpg/png from exe ?
 
You could store the bitmap file in a binary field in a free table in your exe and then write it out at run time to the same folder as your exe is in...

Is that what you are asking?

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.
 
Thanks.

Code:
if ApplicationUnRegistered
   watermarkimage="30DaysTrial.png"
else
   watermarkimage="YourCompanyLogo.png"
endif

User should not modify content of watermarkimage and make it readonly attribute.
Please any other way ?

Thank you.
 
I think Griff's solution would meet that requirement.

If you are worried that users will somehow figure out where you are storing the watermark and attempt to modify it, then store it in the Temp folder (which is usually full of files with meaningless names) and give it a random name that the user won't recognise - and a different name each time you run the report.

It's true that a really determined (and knowledgeable) user might still be able to hack the file, but you've got to ask yourself what the risk is of that happening and what the cost will be if it does - then balance that against the cost and effort of safeguarding against it.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Thanks.

If user working with unpaid version, Invoice prints with trial.png (Watermark). User can veryfy and satisfy contents of invoice, but he may not give to his buyer.

I like your idea to generate random name files in temp folder. (Thanks)

If listner pick-up file inside from exe, this would be better way. I think so.

Thank you
 
>If listner pick-up file inside from exe, this would be better way. I think so.

Images included in an EXE can appear in image controls on forms and don't need an external image file, even though at design time you set the picture to an image file, that is included in project manager in the others section, included in the exe and doesn't need the image file separate.

In a report olebound/picture control you have that same mechanism, if you stay with control source type "image file name". Seems you're switching to "expression or variable name" and use watermarkimage as controlsource. When you do so the report will evaluate but look for external files of that name, obviously (as you didn't get it to work).

Well, go for image file name and create two report picture control, then control which picture to print via PrintWhen condition.

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top