Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Maximum Width And Height of panel

Maximum Width And Height of panel

Scheduled Pinned Locked Moved C#
questionhelp
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    VCsamir
    wrote on last edited by
    #1

    hi friends, i am using a panel of which i want to increase the size to maximum of may be 20,000 X 20,000 how can i achieve this on runtime? It gives me error like System.ComponentModel.Win32Exception: The operation completed successfully at System.Windows.Forms.DibGraphicsBufferManager.CreateCompatibleDIB(IntPtr hdc, IntPtr hpal, Int32 ulWidth, Int32 ulHeight, IntPtr& ppvBits) at System.Windows.Forms.DibGraphicsBufferManager.CreateBuffer(IntPtr src, Int32 offsetX, Int32 offsetY, Int32 width, Int32 height) etc.. actually i am working on zooming of image.. i am calculating the zoom percent and just increasing the width and height of panel and redrawing the image on it.. this works fine ..but when my panel size is set to above 12,000 X 8000 the system gives the above error.. thanks in advance Samir

    D T 2 Replies Last reply
    0
    • V VCsamir

      hi friends, i am using a panel of which i want to increase the size to maximum of may be 20,000 X 20,000 how can i achieve this on runtime? It gives me error like System.ComponentModel.Win32Exception: The operation completed successfully at System.Windows.Forms.DibGraphicsBufferManager.CreateCompatibleDIB(IntPtr hdc, IntPtr hpal, Int32 ulWidth, Int32 ulHeight, IntPtr& ppvBits) at System.Windows.Forms.DibGraphicsBufferManager.CreateBuffer(IntPtr src, Int32 offsetX, Int32 offsetY, Int32 width, Int32 height) etc.. actually i am working on zooming of image.. i am calculating the zoom percent and just increasing the width and height of panel and redrawing the image on it.. this works fine ..but when my panel size is set to above 12,000 X 8000 the system gives the above error.. thanks in advance Samir

      D Offline
      D Offline
      DaveyM69
      wrote on last edited by
      #2

      I just experimented subclassing Panel and it worked OK for me.

      public class MyPanel : Panel
      {
      public static readonly Size DefaultMaxSize = new Size(20000, 20000);
      protected override Size DefaultMaximumSize
      {
      get { return DefaultMaxSize; }
      }
      }

      MyPanel myPanel = new MyPanel();
      myPanel.Size = myPanel.Size = MyPanel.DefaultMaxSize;
      Console.WriteLine(myPanel.Size);

      Dave

      If this helped, please vote & accept answer!

      Binging is like googling, it just feels dirtier. (Pete O'Hanlon)
      BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)

      1 Reply Last reply
      0
      • V VCsamir

        hi friends, i am using a panel of which i want to increase the size to maximum of may be 20,000 X 20,000 how can i achieve this on runtime? It gives me error like System.ComponentModel.Win32Exception: The operation completed successfully at System.Windows.Forms.DibGraphicsBufferManager.CreateCompatibleDIB(IntPtr hdc, IntPtr hpal, Int32 ulWidth, Int32 ulHeight, IntPtr& ppvBits) at System.Windows.Forms.DibGraphicsBufferManager.CreateBuffer(IntPtr src, Int32 offsetX, Int32 offsetY, Int32 width, Int32 height) etc.. actually i am working on zooming of image.. i am calculating the zoom percent and just increasing the width and height of panel and redrawing the image on it.. this works fine ..but when my panel size is set to above 12,000 X 8000 the system gives the above error.. thanks in advance Samir

        T Offline
        T Offline
        Tsuda Kageyu
        wrote on last edited by
        #3

        Try to disable double buffering, if you enable it. It seems that Control class (and its subclasses) tries to create a bitmap as a back buffer of same size as the control.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups