"EO" <He****@ErnestOstrander.com> wrote in message news:<#e*************@TK2MSFTNGP11.phx.gbl>...
Capturing a screenprint of a browser session is not possible through .net,
however, it may be possible with an activex control. I'd suggest posting in
an activex newsgroup.
True, but actually rethinking my problem/objective out I see a better
approach for myself and will share what I have in hopes that somebody
here could help me and others that may follow.
I'm trying to fax out an image with data on top of that image. I
already have a fax provider that will fax emails with gif and jpg
attachements . And already have a button that will fax a specific
image .. and all that works great.
What I need to be able to do is write text on top of an image and save
that image with the dynamic Text. I think I'm close, but can't seem to
connect the dots. Here's what I have and the error I'm getting:
Credit to anybody who's code I grabbed off this newsgroups.
<%@ import namespace="System" %>
<%@ import namespace="System.Drawing" %>
<%@ import namespace="System.Drawing.Imaging" %>
<%@ import namespace="System.IO" %>
<%@Import Namespace="System.Uri" %>
<%@Import Namespace="System.Net" %>
<script runat="server">
Sub sendFile()
' create New image and bitmap objects. Load the image file and put
into a resized bitmap.
dim g as System.Drawing.Image =
System.Drawing.Image.FromFile(server.mappath(reque st("src")))
'use image as background
Dim img As Bitmap = _
New Bitmap(g.Width, _
g.Height, PixelFormat.Format24bppRgb)
Dim w As Graphics = Graphics.FromImage(img)
w.DrawImageUnscaled(g, 0, 0, g.Width, g.Height)
'write on image
w.TextRenderingHint = Text.TextRenderingHint.AntiAlias
Dim imgFont As Font = New Font("Tahoma", 18, FontStyle.Bold)
Dim imgBrush As SolidBrush = _
New SolidBrush(Color.FromArgb(128, Color.Red))
Dim centerFormat As New StringFormat()
centerFormat.Alignment = StringAlignment.Center
centerFormat.Trimming = StringTrimming.None
Dim buyNow As String = "-hello-"
w.DrawString(buyNow, imgFont, imgBrush, _
New RectangleF(0, 107, w.Width, w.Height - 107),centerFormat)
dim thisFormat=g.rawformat
dim imgOutput as New Bitmap(g)
' Set the contenttype
response.contenttype="image/jpeg"
' send the resized image to the viewer
imgOutput.save(response.outputstream, thisformat) ' output to the user
' tidy up
g.dispose()
imgOutput.dispose()
end sub
</script>
<%
response.clear
call sendFile()
response.end
%>
I call the page via
http://xxx.xxx.xxx?src=yyy.jpg
and the error I get is:
BC30561: 'Text' is ambiguous, imported from the namespaces or types
'System.Drawing, System'.
Source Error:
Line 25: 'write on image
Line 26:
Line 27: w.TextRenderingHint = Text.TextRenderingHint.AntiAlias
Line 28: Dim imgFont As Font = New Font("Tahoma", 18, FontStyle.Bold)
Line 29: Dim imgBrush As SolidBrush = _
Many Thanks for any help or information.