Results 1 to 5 of 5

Thread: How to save canvas as jpeg image file?

  1. #1
    Join Date
    Jun 2011
    Posts
    61

    How to save canvas as jpeg image file?

    Well as the title of this particular thread is saying what I wanted to ask over here in this particular thread. I am looking to save the canvas as jpeg image file. I have used to below mentioned piece of code and it resulted into error message.
    Code:
    dim p as picture
    dim g as Graphics
    Dim f as FolderItem
    Dim intWidth, intHeight As Integer
    
    ' Create a new picture of the same dimensions.
    intWidth = Canvas.Width
    intHeight = Canvas.Height
    p = newpicture(intWidth,intHeight,32)
    
    ' Use .drawinto to get the window to draw itself onto your picture.
    Canvas.DrawInto p.Graphics,0,0
    what modification should I do so that I can fix the issue. Any help on this particular matter would be highly appreciated. Thanks a lot in advance.

  2. #2
    Join Date
    Nov 2008
    Posts
    1,185

    Re: How to save canvas as jpeg image file?

    After looking at the code which you have mentioned over here f is seems to be nil. In this particular situation you need to have the folderitem to save the image file. You can get same by using the GetFolderItem or you might need to notify the user by using GetSaveFolderItem. So I think you should try with the either of the things and I am hoping that it will be useful to get the requirement of yours.

  3. #3
    Join Date
    Nov 2008
    Posts
    1,221

    Re: How to save canvas as jpeg image file?

    I am not sure but there could be an issue with the control level. It seems to be working fine with the entire window. Hence I am suggesting two different things which you should try that is either you should use the second picture object or you should simply use the entire window. After doing the same you have to copy the entire canvas area on the picture which you are supposed to save. Also you should make a paint code in this particular method and you have to call either with the canvas or picture graphics.

  4. #4
    Join Date
    Nov 2008
    Posts
    1,022

    Re: How to save canvas as jpeg image file?

    Well in this particular situation you have to put the following code into the canvas paint event.
    Code:
    PrayingToPaint(g)
    After using the above mentioned code you will be able to save the picture of yours.

  5. #5
    Join Date
    Jun 2011
    Posts
    61

    Re: How to save canvas as jpeg image file?

    well thanks a lot for the prompt replies of yours. I have gone through the information which you have mentioned over here and I have figure out that the second option is seems to be far better to implement. I have to make paint code where I supposed to call the paint on the canvas or the picture graphic. Now I am not having any issue to save the canvas into the jpeg image. I wanted to appreciate your efforts which you have put into get the requirement of mine.

Similar Threads

  1. How to save JPEG file with Date Stamp
    By FLU|TER in forum Windows Software
    Replies: 3
    Last Post: 17-02-2012, 01:20 PM
  2. How to save .jpeg file as .jpg in Google Chrome?
    By AshritaS in forum Technology & Internet
    Replies: 5
    Last Post: 24-05-2011, 10:09 PM
  3. How to add image inside the canvas using SilverLight
    By Hunter-Man in forum Windows Software
    Replies: 3
    Last Post: 17-04-2011, 06:51 PM
  4. How to convert jpeg image to png
    By Ryan21 in forum Windows Software
    Replies: 4
    Last Post: 25-03-2010, 04:00 AM
  5. Change a jpeg image into mpeg
    By superdave1984 in forum Windows Software
    Replies: 3
    Last Post: 11-08-2009, 09:49 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,989,551.52614 seconds with 17 queries