From b74ad435e50578929fc71f657eb798c6f60e781b Mon Sep 17 00:00:00 2001 From: baldurk Date: Thu, 26 May 2016 23:58:58 +0200 Subject: [PATCH] Add a 1:1 (zoom 100%) button. Refs #272 --- docs/imgs/Screenshots/ZoomControls.png | Bin 1502 -> 1909 bytes docs/window/texture_viewer.rst | 2 +- renderdocui/Windows/TextureViewer.Designer.cs | 51 +++++++++++------- renderdocui/Windows/TextureViewer.cs | 6 +++ renderdocui/Windows/TextureViewer.resx | 17 +++++- 5 files changed, 55 insertions(+), 21 deletions(-) diff --git a/docs/imgs/Screenshots/ZoomControls.png b/docs/imgs/Screenshots/ZoomControls.png index 80c1b759fd045a854a1da70ad0077bd4023060c3..74ab0eae945dbee923f901f5f9c7d50fcc6d4a33 100644 GIT binary patch delta 1879 zcmY+Fdpy(oAIC=)CL^~Zxzyw+gq0pYxz2>SY%X&zD`}-9XTvPpmm}95cMG{p@f%GF zLyFk>=~u|F9OhEXwPGd~H4EX)Ie+}l`Q!8XJRYCNAiX8$mSkzlNlW&M78&b2{gc3cqEi6TC+ZS0?)=Z;pd06}Tql}d4=3uK zFf}v%*EKlR69n2l>xy*nC7oL=<@xydtEGK?-&KXSqWn~;lwB|Fq+P8>Kdpa%ALo#h z*%=wwZWW}mvR5!|U*>+qaXD;dwnp*=#4p^4yZ8Q$t#jh)kroK;t8aVHhYJg)`WsO| z>ete!GRkU@w#H{6ELt0Tc(kmrv2;{jZB|J~v>m?|;&8sgzT8mIm9T8gC(VtQJpsY# z2xSK@u$*AU2Q9vSmpW-`w#$9xQT{1)UFneCfVbdsXz+pIT^yaIqFz1J-e4$$Xt*Fli_8mg57C?S1T!M3Xbwlq) z%oHv31?VU9|L;s%-J`j>N9$;rL3k0QBp-&{oHxu#hO)LsUImgjX7A_^^-dq2P0C-H zfIOIG4lST=iez_35N#MWL8GwXnP{x7L>WYmN5&7_@9~vV3W+6U3Ak7dEOhCX77oq7nH$4t1t|*Fb|*dV$;WDF=u{azol4ZisgSQB z$W7L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l8)Hk@_ug~v1NQ+jf4#IOy`MDK^EOImf|Mf!|2Uml-ng>yn!IqB4Vz3s(+7%w|7HUWo};Wn$Kc-Bqz9X24r-|F!1hnT z_Rm7tGILNvZ3nBXtJ(LjIr$-8-k<7^kGq=^M`%lpJ67e2R@M!dfAD=-fAwG~XRX8b z&qCNTb5KKV2P-Qp?B9Aez~FI(eBb_ZtuOT@8@xppAcwCPqe~v7@c-EZoblf|2 z=5A}(eLw9I!Nj?i+l}5^p1_aoSRVYki1H@j#Cd@fFE(SkMaQ7_0l^}-+pQ5x^hgdM z7Hta|E{wS~0rqmuzU}!(Z3lC6b6fbg!}dvoCjNxc6Qd(zf>S^lYPRPQPKuUam+)UM^Y})4`1z{Md&4?46YKo zzfv#rPamuOQ|uHX5iE1mzE|{bW@d){Ths6u*5m~q^J;Bv$mwu6hs03XGEM43b*&5r z&yi(_x0Dd?hm3q0K8prA2DMK@Dz7PR}cRB$5UQ! zh5jyb#^3-19fR5@q4rO4OedR=*lZWuXZvRcYN+jCVq${*`%5BRM~_Subzxy++Asa8 zk>{TlOMyWW-{7S&gTdqKj8xzX`MfbtQ}mgubh@2@NAE?QVx*x$96 zH;mEWMadu%ptqxfjzR4MP)dQ-5j;~ZVJD+e3w3fv`kLJR`D+MjsO=z`OltkhBsBQi za9PdGLy*rucDDIeqw_{3?GnCNTW!zb)<}!YPg|KDj zpoZEGMn^~4zZcm6gU7X^|NXMw_e#Hcr{r2ufALobXiE*`+jqWTZ*Wgx=k5ako1C={ zItI1RCQaBfb5KKV2O}dR?BDZjfWdQ=Rp=PhKASXQ%gjLywH-tv5!*l8KPzF&%s~yc z9fZSS_K*LcU}nMKUy~OOL+!Ik6aJTFb5KLm2Ll5G>>pUkZK!=V8GsrN{{-!pm;VP+ X6HK#%@0b`b00000NkvXXu0mjf66MQU diff --git a/docs/window/texture_viewer.rst b/docs/window/texture_viewer.rst index 52c6f38be..46cf65500 100644 --- a/docs/window/texture_viewer.rst +++ b/docs/window/texture_viewer.rst @@ -248,7 +248,7 @@ Zoom Controls | |ZoomControls| -The zoom controls are fairly self explanatory - a pre-existing zoom value can be chosen from the drop down or a custom value (clamped to the minimum and maximum zoom) can be entered as a percentage. +The zoom controls are fairly self explanatory - a pre-existing zoom value can be chosen from the drop down or a custom value (clamped to the minimum and maximum zoom) can be entered as a percentage. Click the ``1:1`` button to zoom to the exact size. To automatically fit the texture to the space available in the window, regardless of its dimensions, you can click the |fit_window| Fit button. diff --git a/renderdocui/Windows/TextureViewer.Designer.cs b/renderdocui/Windows/TextureViewer.Designer.cs index f555a8eda..95efcc584 100644 --- a/renderdocui/Windows/TextureViewer.Designer.cs +++ b/renderdocui/Windows/TextureViewer.Designer.cs @@ -121,6 +121,7 @@ this.actionsStrip = new System.Windows.Forms.ToolStrip(); this.saveTex = new System.Windows.Forms.ToolStripButton(); this.texListShow = new System.Windows.Forms.ToolStripButton(); + this.viewTexBuffer = new System.Windows.Forms.ToolStripButton(); this.texlistContainer = new System.Windows.Forms.TableLayoutPanel(); this.textureList = new renderdocui.Controls.TextureListBox(); this.texturefilter = new System.Windows.Forms.ComboBox(); @@ -147,7 +148,7 @@ this.pixelContextMenu = new System.Windows.Forms.ContextMenuStrip(this.components); this.highlightedPixelHistoryToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.highlightedPixelDebugToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.viewTexBuffer = new System.Windows.Forms.ToolStripButton(); + this.zoomExactSize = new System.Windows.Forms.ToolStripButton(); subSep = new System.Windows.Forms.ToolStripSeparator(); toolStripLabel2 = new System.Windows.Forms.ToolStripLabel(); toolStripLabel3 = new System.Windows.Forms.ToolStripLabel(); @@ -473,13 +474,14 @@ this.zoomStrip.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden; this.zoomStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.toolStripLabel4, + this.zoomExactSize, this.fitToWindow, this.zoomOption, this.flip_y}); this.zoomStrip.Location = new System.Drawing.Point(0, 50); this.zoomStrip.Margin = new System.Windows.Forms.Padding(0, 0, 12, 0); this.zoomStrip.Name = "zoomStrip"; - this.zoomStrip.Size = new System.Drawing.Size(227, 25); + this.zoomStrip.Size = new System.Drawing.Size(285, 25); this.zoomStrip.TabIndex = 2; // // toolStripLabel4 @@ -536,7 +538,7 @@ this.overlayStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.toolStripLabel5, this.overlay}); - this.overlayStrip.Location = new System.Drawing.Point(239, 50); + this.overlayStrip.Location = new System.Drawing.Point(297, 50); this.overlayStrip.Margin = new System.Windows.Forms.Padding(0, 0, 12, 0); this.overlayStrip.Name = "overlayStrip"; this.overlayStrip.Size = new System.Drawing.Size(171, 25); @@ -631,7 +633,7 @@ this.autoFit, this.reset01, this.visualiseRange}); - this.rangeStrip.Location = new System.Drawing.Point(422, 50); + this.rangeStrip.Location = new System.Drawing.Point(480, 50); this.rangeStrip.Margin = new System.Windows.Forms.Padding(0, 0, 12, 0); this.rangeStrip.Name = "rangeStrip"; this.rangeStrip.Size = new System.Drawing.Size(337, 25); @@ -640,7 +642,7 @@ // rangeBlack // this.rangeBlack.Name = "rangeBlack"; - this.rangeBlack.Size = new System.Drawing.Size(50, 25); + this.rangeBlack.Size = new System.Drawing.Size(100, 25); this.rangeBlack.Text = "0.0"; this.rangeBlack.Leave += new System.EventHandler(this.rangePoint_Leave); this.rangeBlack.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.rangePoint_KeyPress); @@ -649,7 +651,7 @@ // rangeWhite // this.rangeWhite.Name = "rangeWhite"; - this.rangeWhite.Size = new System.Drawing.Size(50, 25); + this.rangeWhite.Size = new System.Drawing.Size(100, 25); this.rangeWhite.Text = "1.0"; this.rangeWhite.Leave += new System.EventHandler(this.rangePoint_Leave); this.rangeWhite.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.rangePoint_KeyPress); @@ -982,7 +984,7 @@ this.actionsStrip.Location = new System.Drawing.Point(0, 25); this.actionsStrip.Margin = new System.Windows.Forms.Padding(0, 0, 12, 0); this.actionsStrip.Name = "actionsStrip"; - this.actionsStrip.Size = new System.Drawing.Size(122, 25); + this.actionsStrip.Size = new System.Drawing.Size(114, 25); this.actionsStrip.TabIndex = 8; this.actionsStrip.Text = "toolStrip1"; // @@ -1006,6 +1008,16 @@ this.texListShow.Text = "Open Texture List"; this.texListShow.Click += new System.EventHandler(this.texListShow_Click); // + // viewTexBuffer + // + this.viewTexBuffer.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.viewTexBuffer.Image = global::renderdocui.Properties.Resources.page_white_code; + this.viewTexBuffer.ImageTransparentColor = System.Drawing.Color.Magenta; + this.viewTexBuffer.Name = "viewTexBuffer"; + this.viewTexBuffer.Size = new System.Drawing.Size(23, 22); + this.viewTexBuffer.Text = "Open Texture as Buffer"; + this.viewTexBuffer.Click += new System.EventHandler(this.viewTexBuffer_Click); + // // texlistContainer // this.texlistContainer.ColumnCount = 2; @@ -1246,27 +1258,27 @@ this.closeTabsToRight.Text = "Close tabs to right"; this.closeTabsToRight.Click += new System.EventHandler(this.closeTabsToRight_Click); // - // texPanel + // roPanel // this.roPanel.AutoScroll = true; this.roPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.roPanel.Location = new System.Drawing.Point(461, 373); this.roPanel.Margin = new System.Windows.Forms.Padding(0); this.roPanel.MinimumSize = new System.Drawing.Size(2, 60); - this.roPanel.Name = "texPanel"; + this.roPanel.Name = "roPanel"; this.roPanel.Padding = new System.Windows.Forms.Padding(3); this.roPanel.Size = new System.Drawing.Size(200, 60); this.roPanel.TabIndex = 3; this.roPanel.MouseClick += new System.Windows.Forms.MouseEventHandler(this.thumbsLayout_MouseClick); // - // rtPanel + // rwPanel // this.rwPanel.AutoScroll = true; this.rwPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.rwPanel.Location = new System.Drawing.Point(242, 373); this.rwPanel.Margin = new System.Windows.Forms.Padding(0); this.rwPanel.MinimumSize = new System.Drawing.Size(2, 60); - this.rwPanel.Name = "rtPanel"; + this.rwPanel.Name = "rwPanel"; this.rwPanel.Size = new System.Drawing.Size(200, 60); this.rwPanel.TabIndex = 2; this.rwPanel.MouseClick += new System.Windows.Forms.MouseEventHandler(this.thumbsLayout_MouseClick); @@ -1306,15 +1318,15 @@ this.highlightedPixelDebugToolStripMenuItem.Text = "Highlighted Pixel &Debug"; this.highlightedPixelDebugToolStripMenuItem.Click += new System.EventHandler(this.debugPixel_Click); // - // viewTexBuffer + // zoomExactSize // - this.viewTexBuffer.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.viewTexBuffer.Image = global::renderdocui.Properties.Resources.page_white_code; - this.viewTexBuffer.ImageTransparentColor = System.Drawing.Color.Magenta; - this.viewTexBuffer.Name = "viewTexBuffer"; - this.viewTexBuffer.Size = new System.Drawing.Size(23, 22); - this.viewTexBuffer.Text = "Open Texture as Buffer"; - this.viewTexBuffer.Click += new System.EventHandler(this.viewTexBuffer_Click); + this.zoomExactSize.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; + this.zoomExactSize.Image = ((System.Drawing.Image)(resources.GetObject("zoomExactSize.Image"))); + this.zoomExactSize.ImageTransparentColor = System.Drawing.Color.Magenta; + this.zoomExactSize.Name = "zoomExactSize"; + this.zoomExactSize.Size = new System.Drawing.Size(27, 22); + this.zoomExactSize.Text = "1:1"; + this.zoomExactSize.Click += new System.EventHandler(this.zoomExactSize_Click); // // TextureViewer // @@ -1477,6 +1489,7 @@ private System.Windows.Forms.ToolStripMenuItem highlightedPixelHistoryToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem highlightedPixelDebugToolStripMenuItem; private System.Windows.Forms.ToolStripButton viewTexBuffer; + private System.Windows.Forms.ToolStripButton zoomExactSize; } } \ No newline at end of file diff --git a/renderdocui/Windows/TextureViewer.cs b/renderdocui/Windows/TextureViewer.cs index 0a69b9be6..62507d7cc 100644 --- a/renderdocui/Windows/TextureViewer.cs +++ b/renderdocui/Windows/TextureViewer.cs @@ -2883,6 +2883,12 @@ namespace renderdocui.Windows UI_UpdateFittedScale(); } + private void zoomExactSize_Click(object sender, EventArgs e) + { + fitToWindow.Checked = false; + UI_SetScale(1.0f); + } + private void backcolorPick_Click(object sender, EventArgs e) { var result = colorDialog.ShowDialog(); diff --git a/renderdocui/Windows/TextureViewer.resx b/renderdocui/Windows/TextureViewer.resx index 6faa94cfd..966036d7f 100644 --- a/renderdocui/Windows/TextureViewer.resx +++ b/renderdocui/Windows/TextureViewer.resx @@ -147,6 +147,22 @@ 751, 17 + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG + YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9 + 0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw + bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc + VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9 + c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32 + Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo + mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+ + kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D + TgDQASA1MVpwzwAAAABJRU5ErkJggg== + + 852, 17 @@ -159,7 +175,6 @@ 638, 17 - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8