.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Kaviya Balasubramanian
Imran Ghani
Post New Web Links

How to move image within picturebox ?

Posted By:      Posted Date: October 25, 2010    Points: 0   Category :Windows Application
 

Hi

i have a problem with moving image within pictureBox, to do this, i handled these 2 events of my pictureBox as follow :

private void picTargetImage_MouseDown(object sender, MouseEventArgs e)
{
      if (e.Button == MouseButtons.Left)
      {
        
        this.startPoint = new Point(this.picTargetImage.Location.X-e.X,this.picTargetImage.Location.Y-e.Y);

      }
}

private void picTargetImage_MouseMove_1(object sender, MouseEventArgs e)
{
       if (e.Button == System.Windows.Forms.MouseButtons.Left)
      {
        Point loc = new Point(e.X - startPoint.X, e.Y - startPoint.Y);  
        startPoint.Offset(loc.X, loc.Y);
        picTargetImage.Location = startPoint;
	  }
}

this code does not works correctly. can anybody help me to workaround this problem ?

thanks in advance


http://www.codeproject.com/KB/codegen/DatabaseHelper.aspx


View Complete Post


More Related Resource Links

How to delete an image file assigned to a PictureBox xontrol ?

  
In a Windows form application, some image files are assigned to PictureBox controls. I am trying to delete those image files. The first approach [1] with "Image.FromFile" gives an error message of "Another process is using this image file", although "Image.Dispose()" is executed. The second approach [2] using "Image.FromStream" results (X) images for PictureBoxes and Buttons, if "fs.Close()" is inclided. Without "fs.Close()", it gives the same error message of "Another process is using...". How can I display images properly and delete those images files ? Thanks [1] pictureBoxSelected.Image = Image.FromFile(@actualImage); . . . pictureBoxSelected.Image.Dispose(); pictureBoxSelected.Image = Image.FromFile(@tempImage);                                                if (System.IO.File.Exists(actualImage) == true) {     System.IO.File.Delete(actualImage); } [2] FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read); pictureBox.Image = System.Drawing.Image.FromStream(fs); fs.Close();

Image in picturebox control

  

Hi,

When loading a jpg image in picturebox control with SizeMode=PictureBoxSizeMode.Zoom will loose its clarity, picturebox size is lower than image

 

Thanks


Vineeth

how can I draw an image to a picturebox using VB2005?

  

trying to draw an image to rthe picturebox not from a file, but from a bitmap in memory.

also scroll the image across the picturebox . I have an idea of using the PictureBox_Paint().

how to use DrawImage(image, 0,0,picturebox.width,picturebox.height) with these arguments.

please help thanks. 


how can I draw an image to a picturebox using VB2005?

  

trying to draw an image to rthe picturebox not from a file, but from a bitmap in memory.

also scroll the image across the picturebox . I have an idea of using the PictureBox_Paint().

how to use DrawImage(image, 0,0,picturebox.width,picturebox.height) with these arguments.

please help thanks. 


Move image table to another filegroup

  
I have a table, with an image typed column, spends very large disk space in the PRIMARY filegroup. I want to move it to a new filegroup in another disk drive. I executed the following SQL to move its clustered index: CREATE UNIQUE CLUSTERED INDEX [PK_ids_static_images] ON [dbo].[ids_static_images] ([image_id]) WITH FILLFACTOR = 90 ,DROP_EXISTING ON [Image] This statement executed successfully. But by checking the SpaceUsed FILEPROPERTY, I found the primary data file space still not reclaimed. Anyone please tell me how to move it properly. Thanks.

How to let a PictureBox move around with the arrow keys in C#?

  
Hello developers.

I'll make it very short.
I have a pictureBox0 and I want to let it move around with the arrow keys.
I tried, I failed, I tried again, and I failed again.
After that I tried again, ... and I failed again.
How? What's the most simple solution to this?

Thanks a lot!
Ruud

Built-in Functions - Text and Image Functions in SQL Server

  
Text and image functions operate on TEXT, NTEXT and IMAGE data types. These data types are deprecated with SQL Server 2005 and should be replaced by VARCHAR(MAX), NVARCHAR(MAX) and VARBINARY(MAX) when possible. Alternatively you can also consider storing large string values using XML data type. Text and image functions are nondeterministic.

Future versions of SQL Server will not support TEXT, NTEXT and IMAGE data types. Columns with TEXT / NTEXT data type do not support commonly used string functions such as LEN, LEFT, RIGHT, etc. Furthermore, due to the large size of TEXT data you''re likely to see performance issues if you store such data in the database. However, at times you can''t help but use the TEXT / NTEXT / IMAGE data types (for example when supporting 3rd party databases when you cannot change the schema) - this is when text and image functions come in handy.

Program for Format Conversion of An Image

  
.NET provides extensive support for image conversion. Any image can be processed from one format to another. Most common formats to which .NET have support for are .BMP, .EMF, .GIF, .ICO, .JPG, .PNG, .TIF and .WMF.

Configuring Profile Image Export in SharePoint 2010

  
It's no secret that I am thrilled with the new social features of SharePoint 2010. I am most excited about the new Profile Picture handling. I strongly believe that the more we can show the faces of our colleagues to one another the more connected we will feel. Clearly Microsoft feels that way as witnessed by the many features that make use of the Profile Image like the Activity Feed and Colleagues list

Built-in Functions - Text and Image Functions

  
Text and image functions operate on TEXT, NTEXT and IMAGE data types. These data types are deprecated with SQL Server 2005 and should be replaced by VARCHAR(MAX), NVARCHAR(MAX) and VARBINARY(MAX) when possible. Alternatively you can also consider storing large string values using XML data type. Text and image functions are nondeterministic.

ASP.Net Upload Image to MS Access Database

  
As you learnt from the previous articles to upload image to the SQL Database in ASP.Net 2.0 and stream that image into the memory to retrieve it from the database and display it on the web page. In this article you will learn how to upload images to the MS Access database in ASP.Net 2.0

First of all create an Access Database and place it in the App_Data folder of ASP.Net web site project. Then create a table "tblImg" with the following fields:

Get pixel format, raw format, property id list and property items image in VB.net - C#.net.

  
n this simple article you will learn that how we can get pixel format, raw format, property id list and property items image in VB and C#.net.

Get Pixel Format:

Image consists of pixels to get the format of the pixel we have a property named pixel format. This property returns an enumeration of pixel format. This enumeration tells the pixel format.

To demonstrate make a window application. Drag one button and a picture box on form.

Now write the following code on Button click event:

slideshow image gallary using jQuery

  

Hi,

i need a gallary like following link.

http://www.leigeber.com/2008/05/ajax-image-gallery-slideshow/

actually,i bound multiple image in a gridview using handler(.ashx).

for example,in one dep_id(1),there are 6 image and i need to slideing one by one.

could some one help me,how i can do like this?

i think is it easy in jquery.

please someone help me.

Thanking you.




datalist image slide show problem

  

hi friends


i am binding  images dynamically(back end)for a datalist .iam applying a slideshow for it .I am getting a problem to apply slideshow for dyanmically binded images.If the define in a div statically it working perfectly

for example pls go through my code below:

<script type="text/javascript">
$(document).ready(function() {
    $('.slideshow').cycle({
        fx: 'scrollLeft' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
    });
});

<div class="slideshow">
        <img src="images/30_dummy.jpg" width="200" height="200" />
        <img src="images/aquarius.gif" width="200" height="200" />
        <img src="images/star.gif" width="200" height="200" />
        
        <img src="images/the-proud-indian-flag-1.jpg" width="200" height="200" />
    </div>


I above code works perfectly and the slide show e

Can't display an image from the database

  

 Hi,

My database has a products table that has images stored in a varbinary(MAX) column.

I'm trying to display product information in a repeater and trying to display the images as well by using a GenericHandler class but I can't get the image to show up in my page.

Here is my Handler.ashx class:

Public Class Handler
    Implements System.Web.IHttpHandler

    Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest

        '== Set up the response settings
        context.Response.ContentType = "image/gif"
        context.Response.Cache.SetCacheability(HttpCacheability.Public)
        context.Response.BufferOutput = False

        Dim id As Integer = -1
        Dim stream As Stream = Nothing
        If Not String.IsNullOrEmpty(context.Request.QueryString("id")) Then
            id = context.Request.QueryString("id")
            stream = GetImage(id)
        End If

        Const buffersize As Integer = 1024 * 16
        Dim buffer(buffersize) As Byte
        'byte[] buffer = new byte[buffersize];
        Dim count As Integer = stream.Read(buffer, 0, buffersize)

        While count > 0
            context.Response.OutputStream.Write(buffer, 0, count)
            count = stream.Read(buffer, 0, buffersize)
        End While

    En

image inside custom server control

  

Hi,

I want to use an image inside a Custom Web server control ! 

Do I need to use Web.resources ? if so , how to do ?


how to make a css style background image be linked to an image in the resource file

  

hey guy, i need help in a very troubling matter. I want to make a textbox with a specific style, within this style a set of images as background parts, how can i attach these images to the custom control as whenever i take the .dll file and add it to the toolbar the images do not appear. So i tried to make them as resource files and their property as embedded in .resx file, so how to make the css style background image url to be linked to any of those image.


thanks in advance


Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend