Hi mr. noob,
You might want to put down that custom control for a bit, and familiarize
yourself with your UI. It's a web page. If you're not familair with web
pages and HTML, you're going to have beaucoups trouble. Why? Because a web
page is not a VB6 executable sitting on your machine. It is a TEXT document.
Next time you're using your browser, view the souce code for the page.
First, make sure there are images in it, so you can see this for yourself.
Note that the TEXT document that is the HTML page has no images in it. Of
course, how could it? Its a text document.
So, where do the images come from, and how do they get into the browser, in
the right places in the document? It is via an image tag in the markup.
Example:
<img src="/images/someimage.jpg">
Now, as the browser is displaying an HTML document, where does the image
come from? It is downloaded from the specified URL in the image tag and
rendered in the browser BY the browser.
So, how do you draw in an ASP.Net page? The answer is, you don't. You draw
an image on the server, and stream it to the browser when requested.
How is this done in an ASPX page? Well, you need to create another ASPX page
that serves as the "image." When this page is requested, it draws an image
on the server side, sets the Response.ContentType to "image/jpg" (the
correct MIME type for that image type), and saves the image to the
Response.OutputStream. The browser, which ordinarily derives what type of
file it is receiving from the file extension, will instead read the
ContentType header, and display the binary output as an image.
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.
"Qwert" <no**@nosp.com> wrote in message
news:1b********************@casema.nl...
Heya,
I have a cusom control:
Imports System.ComponentModel
Imports System.Web.UI
<DefaultProperty("Text"), ToolboxData("<{0}:WebCustomControl5
runat=server></{0}:WebCustomControl5>")> Public Class WebCustomControl5
Inherits System.Web.UI.WebControls.WebControl
Dim _text As String
<Bindable(True), Category("Appearance"), DefaultValue("")> Property
[Text]() As String
...
End Property
Protected Overrides Sub Render(ByVal output As
System.Web.UI.HtmlTextWriter)
output.Write([Text])
End Sub
End Class
I want to draw graphics (bmp's) in 'Render'. How is this done? In VB.NET
controls you could do things like:
Protected Overrides Sub OnPaint(ByVal e As
System.Windows.Forms.PaintEventArgs)
With e.Graphics
.DrawImage(...)
End With
End Sub
Any help/links appriciated,
mr noob.