Results 1 to 2 of 2

Thread: Paint() Question/Problem

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2002
    Posts
    382

    Paint() Question/Problem

    I am having problems keeping images that I draw to a picturebox to stay put.

    It appears that a Forms Paint() method erases a picturebox's contents whenever it fires.

    Now I know that I can overcome this by painting to a buffer then flipping the buffer onto the Picturebox's "Image" property but I don't want to do this for performance reasons.

    Is there a way to have the method that paints a Picturebox fire AFTER the main forms paint event?

  2. #2
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    Re: Paint() Question/Problem

    Originally posted by Hinder
    I am having problems keeping images that I draw to a picturebox to stay put.

    It appears that a Forms Paint() method erases a picturebox's contents whenever it fires.

    Now I know that I can overcome this by painting to a buffer then flipping the buffer onto the Picturebox's "Image" property but I don't want to do this for performance reasons.

    Is there a way to have the method that paints a Picturebox fire AFTER the main forms paint event?
    I dont think you can change order of the events. There are only two ways that I know of: 1- put your image in picturebox.image and it wont disappear in a paint event 2- put your code in the picturebox_paint event


    What is the performance issue you are talking about anyways? I know it's a little painful to get started with .net gdi (and will be painful even after you get started with it )
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width