473,473 Members | 2,304 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

asp.net, several dynamic images, gdi+

MMS
I have a ASP.NET page where first displays a single imagem I'll call it
original. Then one clicks on a button and the program calls an .aspx
page that applies several image filters for processing. The processed
image has to be displayed on the 2nd image (on the right).

The thing is that, when I click for the 2nd time the button, the first
image appears with the contents of the 2nd. It suppose that the 1st one
stays as the original.
Below is the code:

Button related to process image, in the page:
ImageButton2.ImageUrl = "ft/thresholdbinarization.aspx"
---------------------------------------------------------------------------------------------------------
Load event in the page:

If Not IsPostBack Then
'cache("ICropped") is the original image. I'm trying to
copy it to another cache
Cache("PIm2") = Cache("ICropped")
ImageButton1.ImageUrl = "showcropim.aspx" <- this
represents the original image
End If
-----------------------------------------------------------------------------------------------------

Load event on thresholdbinarization.aspx

Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Dim m As New MemoryStream()
Dim _b As Bitmap

_b = Cache("PIm2")

'1. pass values to function
ThresholdBinarization(_b, 0)

'Response.ClearContent()

Response.ContentType = "image/bmp"

' I save again the content of the cache("PIm2") because
inside of the ThresholdBinarization function, it saves the procesed
image on cache("PIm2") again

_b = Cache("PIm2")
_b.Save(m, ImageFormat.Bmp)

m.WriteTo(Response.OutputStream)

Response.Flush()
End Sub
-------------------------------------------------------------------------------------------------
On the 2nd time I click on the button I also see that the original
image loads first than the processed.

I'm not sure if my mistake would be fixed trying to work with the
buffers.
Any help will be appreciated,
MMS

Apr 27 '06 #1
0 858

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Orjan | last post by:
Does anybody have a suggestion of a software or component to use if you want to display JPEG or TIFF images in a control within Access? I know that Office can do this but my customer don't want to...
3
by: mraj | last post by:
Hello... I am new to C#. My requirement is that, I will receive over 100s of images from the network to local machine and display these images on an image viewer one by one on mouse scroll. To...
14
by: EdB | last post by:
We are having an odd problem saving images. We capture customer signatures on a Palm Pilot and save them as points on a graph. We are able to reconstruct these points to display the signature,...
3
by: Gil | last post by:
I need to create a web page in which its content should be controlled by some win32 application. this application may add or remove some gif images from the page and it should be smooth as possible...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.