代码之家  ›  专栏  ›  技术社区  ›  Nor

无法设置imagebutton的大小

  •  0
  • Nor  · 技术社区  · 3 年前

    使用VisualStudio和asp。net(VB.net)我有一个可以显示和显示图像的页面。我没有使用图像对象,而是决定使用IMAGEBUTTON,这样我就可以单击图像并获得它的放大版本。该功能运行正常,但在我的桌面浏览器(Firefox,Edge)上,图像的大小仍然很小。在我的Android手机上,图像显示得很大。图像大小为1024x768。

    只需使用一个图像对象,即可在手机和台式电脑上以适当的大小显示图片。

    我尝试强制宽度为1024,但没有成功。我可以改变高度=768,但图像扭曲、狭窄且高。

    你可以在 http://astro.njstargazer.org/astropix?id=819&URL=http://njstargazer.org/AstroImage/Ngc2359_600s_20220109_1024.jpg

    这是astropix。aspx:

    <%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="AstroPix.aspx.vb" Inherits="ASTRO.AstroPix" %>
    <asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
        
        <div class="auto-style1">
            <p >&nbsp;</p>
            <p ><asp:Label ID="lblheader" runat="server" Text="Label" Font-Size="Large"></asp:Label></p>
            <p ><asp:Button ID="btntoggle" runat="server" ForeColor="Black" Text="Toggle Zoom" Visible="False" /></p>
            <p >&nbsp;</p>
            <p ><asp:ImageButton ID="ImageButton1" runat="server"/></p>
        </div>
    </asp:Content>
    

    我错过了什么?

    谢谢 也没有

    0 回复  |  直到 3 年前