Gallery不出图片是为什么?

import java.lang.reflect.Field;
import java.util.ArrayList;

import android.app.Activity;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.BaseAdapter;
import android.widget.Gallery;
import android.widget.ImageView;

public class TestImageView extends Activity {

private Gallery mGallery;
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    mGallery = (Gallery)findViewById(R.id.gallery);

        try {
            mGallery.setAdapter(new ImageAdapter(this));
        } catch (IllegalArgumentException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    catch(IllegalAccessException e){
        e.printStackTrace();
    }
    mGallery.setOnItemClickListener(new OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView parent, View v, int position,
                long id) {
            // TODO Auto-generated method stub
            TestImageView.this.setTitle(String.valueOf(position));
        }
    });
}
private class ImageAdapter extends BaseAdapter{
    private Context mContext;
    private ArrayList<Integer> imgList = new ArrayList<Integer>();
    private ArrayList<Object> imgSizes = new ArrayList<Object>();

    public ImageAdapter(Context c) throws IllegalAccessException, IllegalArgumentException {
        // TODO Auto-generated constructor stub
        mContext = c;

        //用反射机制来获取资源中的图片ID和尺寸
        Field[] fields = R.drawable.class.getDeclaredFields();
        for(Field field : fields){
            if(!"ic_launcher".equals(field.getName())){
                int index = field.getInt(R.drawable.class);
                //保存图片ID
                imgList.add(index);
                //保存图片大小
                int size[] = new int[2];
                Bitmap bmImg = BitmapFactory.decodeResource(getResources(), index);
                size[0] = bmImg.getWidth();
                size[1] = bmImg.getHeight();
                imgSizes.add(size);
            }
        }
    }

    @Override
    public int getCount() {
        // TODO Auto-generated method stub
        return imgList.size();
    }

    @Override
    public Object getItem(int position) {
        // TODO Auto-generated method stub
        return position;
    }

    @Override
    public long getItemId(int position) {
        // TODO Auto-generated method stub
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        // TODO Auto-generated method stub
        ImageView i = new ImageView(mContext);
        //从imgSize取得图片大小
        int size[] = new int[2];
        size = (int[]) imgSizes.get(position);
        i.setLayoutParams(new Gallery.LayoutParams(size[0], size[1]));
        return i;
    }

}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(R.menu.main, menu);
    return true;
}

}

1个回答

 没有复制图片
 @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        // TODO Auto-generated method stub
        ImageView i = new ImageView(mContext);
        //从imgSize取得图片大小
                i.setImageResource(this.imgList.get(position));  //添加图片,增加这句,需要赋值显示图片
        int size[] = new int[2];
        size = (int[]) imgSizes.get(position);
        i.setLayoutParams(new Gallery.LayoutParams(size[0], size[1]));
        return i;
    }
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
gallery显示不出图片,这是为何?
源代码:rnOncreate里面的:rn[code=Java]Gallery g=(Gallery)findViewById(R.id.myGallery);rn g.setAdapter(new ImageAdapter(this));[/code]rn自定义的ImageAdapter类,派生于BaseAdapterrn[code=Java]public class ImageAdapter extends BaseAdapterrn rn private Context myContext;rn rn private int[] myImage=R.drawable.photo2,R.drawable.photo3,R.drawable.photo6;rn rn public ImageAdapter(Context c)rn rn this.myContext=c;rn rn rn rn public int getCount() return this.myImage.length;rn public Object getItem(int position) return position;rn public long getItemId(int position) return position;rnrn @Overridern public View getView(int position, View convertView, ViewGroup parent) rn rn ImageView i=new ImageView(this.myContext);rn i.setImageResource(this.myImage[position]);rn i.setScaleType(ImageView.ScaleType.FIT_XY);rn i.setLayoutParams(new Gallery.LayoutParams(136, 88));rn rn return i;rn rn [/code] rnrn运行后,图片不显示,问题出在什么地方?谢谢
为什么演示不出图片!
下面的程序为什么演示不出图片!rnrnimport java.awt.*;rnimport java.applet.*;rnimport java.net.*;rnrnpublic class applet_exp1 extends java.applet.Appletrnrn Image img=null;rn rn public void init()rn rn resize(300,300);rnrn img=getImage(getCodeBase(),"1.bmp");rnrn rnrn public void paint(Graphics g)rn rn if(img==null)g.drawString("Load Image File Error!",100,100);rn else g.drawImage(img,200,200,50,50,null);rn rn rn rnrnrnrnrn
为什么显示不出图片?
rnrnrnrnrn rnhere is link1rn rn rnhere is link2rn rn rnhere is link3rn rn rnhere is link4rn rn rnhere is link5rn rn rnrnrnrnrn rnrn这五张图片都是JPEG格式,难道网页不能显示吗?还是我的代码有错?
为什么打印不出图片
我在OnDraw()中显示了一DIB图片,在打印预览中可显示,却打印不出来,望大侠指教
为什么gallery文件夹是空的
为什么gallery文件夹是空的,哪里可以下载里面内容?
广告图片Gallery,及自动轮播图片Gallery
基于ViewPager的用户指引,广告图片Gallery,及自动轮播图片Gallery,使用起来超简单 eg: imageIndicatorView = (ImageIndicatorView) findViewById(R.id.indicate_view); final Integer[] resArray = new Integer[] { R.drawable.ic_launcher, R.drawable.ic_launcher }; imageIndicatorView.setupLayoutByDrawable(resArray); imageIndicatorView.show();
为什么显示不出图片,,D3D
unit Unit1;rnrninterfacernrnusesrn Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,rn Dialogs, Direct3D9, StdCtrls;rnrntypern TVertex = packed recordrn X, Y, Z, RHW: Single;rn Color : D3DCOLOR;rn U, V : Single;rn end;rnrn T2DPanel = array [0..3] of TVertex;rnrn TForm1 = class(TForm)rn procedure FormCreate(Sender: TObject);rn procedure FormPaint(Sender: TObject);rn privatern FD3D : IDirect3D9;rn FDevice : IDirect3DDevice9;rn FD3dpp : D3DPRESENT_PARAMETERS;rn FImageTexture : IDirect3DTexture9;rn ImgWidth : Single;rn ImgHeight : Single;rn function InitD3D():Boolean;rn procedure SetDeviceRenderState();rn procedure SetDeviceSamplerState();rn procedure LoadTexture(sFileName:String);rn procedure Render();rn procedure RenderImage();rn Private declarations rn publicrn Public declarations rn end;rnrnvarrn Form1: TForm1;rnrnimplementationrnrn$R *.dfmrnrnprocedure TForm1.FormCreate(Sender: TObject);rnbeginrn if not InitD3D() then exit;rnend;rnrnfunction TForm1.InitD3D: Boolean;rnbeginrn Result := False;rn FD3D := Direct3DCreate9(D3D_SDK_VERSION);rn if FD3D = nil thenrn Exit;rn FillChar(FD3dpp, sizeof(D3DPRESENT_PARAMETERS), 0);rn FD3dpp.BackBufferWidth := form1.Width;rn FD3dpp.BackBufferHeight := form1.Height;rn FD3dpp.BackBufferFormat := D3DFMT_UNKNOWN;rn FD3dpp.SwapEffect := D3DSWAPEFFECT_DISCARD;rn FD3dpp.Windowed := True;rn if FAILED(FD3D.CreateDevice(D3DADAPTER_DEFAULT,rn D3DDEVTYPE_HAL,rn form1.Handle,rn D3DCREATE_SOFTWARE_VERTEXPROCESSING,rn @FD3Dpp,rn FDevice)) thenrn Exit;rn SetDeviceRenderState();rn LoadTexture('r.bmp');rn Result := True;rnend;rnrnprocedure TForm1.LoadTexture(sFileName:String);rnvarrn Bmp:TBitmap;rnbeginrn Bmp:=TBitmap.Create;rn Bmp.LoadFromFile(sFileName);rn ImgWidth:=Bmp.Width;rn ImgHeight:=Bmp.Height;rn form1.Width := Bmp.Width;rn form1.Height:= Bmp.Height;rn if FAILED(FDevice.CreateTexture( Bmp.Width,rn Bmp.Height,rn 1, 0,rn D3DFMT_A8R8G8B8,rn D3DPOOL_MANAGED,rn FImageTexture,rn nil)) thenrn Raise Exception.Create('创建位图纹理失败!');rnend;rnrnprocedure TForm1.SetDeviceRenderState;rnbeginrn with FDevice dorn beginrn SetRenderState(D3DRS_LIGHTING, 0);rn SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);rn SetRenderState(D3DRS_ALPHABLENDENABLE, 1);rn SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);rn SetRenderState(D3DRS_DESTBLEND,D3DBLEND_INVSRCALPHA);rn SetFVF(D3DFVF_XYZRHW or D3DFVF_DIFFUSE or D3DFVF_TEX1);rn end;rn SetDeviceSamplerState();rnend;rnrnprocedure TForm1.SetDeviceSamplerState;rnbeginrn FDevice.SetSamplerState(0, D3DSAMP_MAGFILTER, D3DTEXF_POINT);rn FDevice.SetSamplerState(0, D3DSAMP_MINFILTER, D3DTEXF_POINT);rnend;rnrnprocedure TForm1.FormPaint(Sender: TObject);rnbeginrn Render();rnend;rnrnprocedure TForm1.Render;rnbeginrn if FDevice = nil thenrn Exit;rn FDevice.Clear(0, nil, D3DCLEAR_TARGET, $FF000000, 1.0, 0);rn if SUCCEEDED(FDevice.BeginScene()) thenrn beginrn RenderImage();rn end;rn FDevice.EndScene();rn FDevice.Present(nil, nil, 0, nil);rnend;rnrnprocedure TForm1.RenderImage;rn function Make2DVertex(const _X, _Y, _U, _V: Single; const col: D3DCOLOR):TVertex;rn beginrn with Result dorn beginrn X := _X;rn Y := _Y;rn Z := 0;rn RHW := 1.0;rn Color := col;rn U := _U;rn V := _V;rn end;rn end;rn function Make2DPanel(const X, Y, AWidth, AHeight: Single; const col: D3DCOLOR):T2DPanel;rn beginrn Result[0] := Make2DVertex(X, Y + AHeight, 0, 1, col);//左下rn Result[1] := Make2DVertex(X, Y, 0, 0, col);//左上rn Result[2] := Make2DVertex(X + AWidth, Y + AHeight, 1, 1, col);//右下rn Result[3] := Make2DVertex(X + AWidth, Y, 1, 0, col);//右上rn end;rnvarrn Vertices: T2DPanel;rnbeginrn if FImageTexture = nil thenrn Exit;rn Vertices := Make2DPanel(0, 0, ImgWidth, ImgHeight , $FFFFFFFF);rn FDevice.SetTexture(0, FImageTexture);rn FDevice.DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2, Vertices, sizeof(TVertex));rnend;rnrnend.
QT为什么显示不出图片?
#include "frametest.h"rnrn#include rn#include rn#include rn#include rn#include rn#include rnrnFrameTest::FrameTest( QWidget* parent, const char* name, WFlags fl )rn : QWidget( parent, name, fl )rnrn if ( !name )rn setName( "FrameTest" );rn resize( 320, 240 ); rn setMinimumSize( QSize( 320, 240 ) );rn setMaximumSize( QSize( 320, 240 ) );rn setSizeIncrement( QSize( 320, 240 ) );rn setBaseSize( QSize( 320, 240 ) );rn setCaption( tr( "FrameTest" ) );rnrn Frame1 = new QFrame( this, "Frame1" );rn Frame1->setGeometry( QRect( 0, 0, 320, 240 ) ); rn Frame1->setMinimumSize( QSize( 320, 240 ) );rn Frame1->setMaximumSize( QSize( 320, 240 ) );rn Frame1->setFrameShape( QFrame::StyledPanel );rn Frame1->setFrameShadow( QFrame::Raised );rn//为Frame设置背景图片rn QPixmap pm("cohan.jpg");rn Frame1->setBackgroundPixmap(pm); rnrnrnrn编译通过,运行时:./frametest -qws 时,界面上没有图片,图片cohan.jpg已经放在同一目录了,怎么回事呢?rn
新手:为什么显示不出图片
<%@ page language="java" contentType="text/html; charset=UTF-8"rn pageEncoding="UTF-8"%>rn<%@ page import="java.util.Date" %>rn<%@ page import="java.text.SimpleDateFormat" %>rnrnrnrn rn 表达式练习rnrnrn<%rn String name = "admin";rn String sex = "man";rn String photo = "C:\\Users\\loveXin\\workspace\\FirstProject\\src\\1.gif";rn%>rn用户名:<%=name %>rn性别:<%=sex %>rn照片:rnrnrnrnrn运行后查看网页源码为:rnrnrnrn rn 表达式练习rnrnrnrn用户名:adminrn性别:manrn照片:rnrn
为什么显示不出图片啊
我在我写的对话框的OnInitDialg()里写的代码,为什么显示不出图片啊。。rn[code=C/C++][/code]rnCDialog::OnInitDialog();rn rn if(!UpdateData(TRUE))rn rn return FALSE;rn rn CString path = "D:\\复件 Code_newBase1114合入1-bak11-17_1_new_12-05\\res\\bitmap.bmp";rn path = "C:\\zszb2.bmp";rn/* HBITMAP hbitmap = (HBITMAP)LoadImage(AfxGetInstanceHandle(), path, IMAGE_BITMAP, 1024, 768, LR_CREATEDIBSECTION|LR_LOADFROMFILE);rn CPaintDC dc(this);rn if (hbitmap == NULL)rn rn return FALSE;rn rn CBitmap bitmap;rn bitmap.Attach(hbitmap);rn BITMAP bmp;rn bitmap.GetBitmap(&bmp);rnrn CDC cdc;rn cdc.CreateCompatibleDC(pDC);rn cdc.SelectObject(&bitmap);rn pDC->BitBlt(0,0,bmp.bmWidth, bmp.bmHeight, &cdc, 0,0, SRCCOPY);*/rnrn CDC *pDC = GetDC();rn CDC memdc;rn CRect rect(0,0,250,120);rn memdc.CreateCompatibleDC(pDC);rn HBITMAP hBitmap = (HBITMAP)::LoadImage(AfxGetInstanceHandle(), path, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE|LR_CREATEDIBSECTION|LR_DEFAULTSIZE);rnrn// CBitmap bitmap;rn// bitmap.Attach(hBitmap);rn// BITMAP bmp;rn// bitmap.GetBitmap(&bmp);rnrnrn if (hBitmap)rn rn memdc.SelectObject(&hBitmap);rn pDC->BitBlt(0,90,250,250,&memdc,0,0,SRCCOPY);rn rnrn DeleteObject(hBitmap);
wince 为什么加载不出图片
LRESULT DoCreateMain(HWND hWnd, UINT wMsg, WPARAM wParam,LPARAM lParam)rnrn HDC hdc; rn HDC hdcMem; rn HBITMAP hbmp; //一张位图的句柄 rn BITMAP bmp; rn RECT rect;rn GetClientRect (hWnd, &rect);rnrn //hbmp = (HBITMAP)SHLoadDIBitmap(NULL,_T("1.bmp"), IMAGE_BITMAP,0,0,LR_DEFAULTCOLOR);rn hbmp = (HBITMAP)SHLoadDIBitmap(_T("D:\\mydir\\1.bmp"));rn hdcMem = CreateCompatibleDC(hdc);rn rn SelectObject(hdcMem, hbmp); rn GetObject(hbmp,sizeof(BITMAP), &bmp);rn BitBlt(hdc,rect.left,rect.top,bmp.bmWidth,bmp.bmHeight,hdcMem,0, 0,SRCCOPY); //显示位图 rn //SelectObject(hdcMem,hOldsel);rn DeleteDC(hdcMem); rn DeleteObject(hbmp); rnreturn 0;rn rn请问为什么窗口显示不出图片(BMP格式)
但是显示不出图片?为什么?
下面是我写的SHOWIMG。ASP文件:rnrn<%rn dim rsrn dim sqlrn set rs=server.createobject("adodb.recordset")rn sql="select * from images where gh='"&request("gh")&"'"rn rs.open sql,conn,1,1rn if not (rs.eof and rs.bof) thenrn%>rn rn rn " >rn rnrn<%rn else rn response.redirect "images/noimg.bmp"rn end ifrn rs.closern conn.closern%>rn在LIST。ASP中列出所有记录的代码如下:rn rn rn <%rn if mmm<>0 then rn for ii=1 to mmm*40rn if rs.eof then exit forrn rs.movenextrn nextrn end ifrn do while not rs.eofrn%>rnrn " height=73 border=1 width="67"> rn rn rn rn rn 馱瘍ㄩ<%=rs("gh")%>rn rn rn 俷靡ㄩ<%=rs("realname")%>rn rn rn 窒藷ㄩ<%=rs("sign")%>rn rn rn >載砆牉訧蹋rn rn rn rn <%rn rn i=i+1 rnif i mod 4 = 0 thenrnresponse.write " "rnend ifrnrs.MoveNextrnif i=40 then exit dornlooprn rnrn%>rnrn rn rn 但是显示不出图片?为什么?rn
更改Gallery中的图片及增加Gallery的Item
我照着ApiDemo的例子生成了一个Gallery,现在我想更改Gallery中的某一项Item的图片,请教下,应该怎么更改呢..??rnrn还有,生成一个Gallery后,如何删除里面的Item或者添加Item呢..??rnrnrn谢谢...
为什么我的Gallery文件夹中是空的?
为什么我的Gallery文件夹中是空的?rn问题补充:我的是Vista系统。我的工具->下面没有这个选项.再说我即使不注册任何控件,系统中也应该有很多控件吧,office我有安装. rn但在VC中project->add to project->components and controls打开的Gallery文件夹中是个空文件夹,什么也没有!
Gallery图片滑动
Gallery组件主要用于横向显示图像列表,不过按常规做法。工程源代码,解压导入即可学习,有注释。
gallery 循环现实图片。
public class Gallery_Activity extends Activity rn /** Called when the activity is first created. */rn private Gallery gallery;rn private ImageView imageView;rn private int images[]=R.drawable.r1,R.drawable.r2,R.drawable.r3,R.drawable.r4,R.drawable.r5;rn @Overridern public void onCreate(Bundle savedInstanceState) rn super.onCreate(savedInstanceState);rn setContentView(R.layout.main);rn gallery=(Gallery) findViewById(R.id.gallery1);rn imageView=(ImageView) findViewById(R.id.imageView1);rn gallery.setSpacing(100);rn gallery.setSelection(1);rn MyGallery_Adpter myGallery_Adpter=new MyGallery_Adpter(this, images);rn gallery.setAdapter(myGallery_Adpter);rn gallery.setOnItemSelectedListener(new OnItemSelectedListener() rnrn public void onItemSelected(AdapterView arg0, View arg1,rn int arg2, long arg3) rn imageView.setImageResource(images[arg2%images.length]);rn rnrn public void onNothingSelected(AdapterView arg0) rn // TODO Auto-generated method stubrn rn );rn rnrnrnpublic class MyGallery_Adpter extends BaseAdapter rn private Context context;rn private int image[];rn private ImageView imageView;rn public MyGallery_Adpter(Context context,int image[]) rn this.context=context;rn this.image=image;rn rn rn public int getCount() rn // TODO Auto-generated method stubrn return image.length;rn rnrn public Object getItem(int arg0) rn // TODO Auto-generated method stubrn return image[arg0];rn rnrn public long getItemId(int position) rn // TODO Auto-generated method stubrn return position;rn rnrn public View getView(int position, View convertView, ViewGroup parent) rn // TODO Auto-generated method stubrn imageView=new ImageView(context);rn imageView.setImageResource(image[position%image.length]);rn imageView.setPadding(2, 2, 2, 2);rn imageView.setLayoutParams(new Gallery.LayoutParams(200, 200));rn return imageView;rn rnrn怎么不能达到效果,该怎么写呢,求大神指导
Gallery循环删除图片
1.gallery循环 2.java反射机制获取图片 3.可以从gallery中删除图片 初学必看。。
Gallery浏览图片
Gallery是图片浏览组件,主要实现横向显示图片列表,实现图片浏览。其中使用Adapter继承BaseAdapter
gallery 浏览图片
    总叙:gallery严格意义地讲也是listView的一种,通过adapter加载数据成为了一种通用的方法。   例子:为实现图片浏览的效果,类似于qq空间里面查看他人图片。达到如下图所示效果: &amp;lt;!--StartFragment --&amp;gt;   &amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt; &amp;lt;LinearLay...
ImageSwitcher和Gallery浏览图片
Gallery能够水平显示其内容,一般用来浏览图片,被选中的选项位于中间,并且可以相应事件显示信息。下面结合ImageSwitcher组件来实现一个通过缩略图来浏览图片的程序。
gallery简单实现 图片调整
package e gallery; import android app Activity; import android os Bundle; import android view LayoutInflater; import android view View; import android view ViewGroup; import android view ViewGroup MarginLayoutParams; import android widget AdapterView; import android widget AdapterView OnItemSelectedListener; import android widget BaseAdapter; import android widget Gallery; import android widget ImageView; import e gallery R; public class MainActivity extends Activity implements OnItemSelectedListener { Gallery gallery; ImageView main imageView; ImageView picture imageView; Gesture+ gesture; int[] ids1 { R drawable b R drawable c R drawable d R drawable f R drawable g }; @Override protected void onCreate Bundle savedInstanceState { super onCreate savedInstanceState ; setContentView R layout main ; main imageView ImageView findViewById R id main imageView ; gallery Gallery findViewById R id gallery ; gallery setOnItemSelectedListener this ; 怎么设置从中间开始 gallery setAdapter new MyAdapter ; } class MyAdapter extends BaseAdapter{ @Override public int getCount { return Integer MAX VALUE; } @Override public Object getItem int position { return null; } @Override public long getItemId int position { return 0; } @Override public View getView int position View convertView ViewGroup parent { LayoutInflater layoutInflater LayoutInflater from MainActivity this ; convertView layoutInflater inflate R layout picture null ; picture imageView ImageView convertView findViewById R id picture imageView ; picture imageView setImageResource ids1[position % 5] ; return convertView; } } @Override public void onItemSelected AdapterView&lt; &gt; parent View view int position long id { main imageView setImageResource ids1[position % 5] ; } @Override public void onNothingSelected AdapterView&lt; &gt; parent { } }">package e gallery; import android app Activity; import android os Bundle; import android view LayoutInflater; import android view View; import android view ViewGroup; import android view ViewGroup MarginLayoutParams; import android widget AdapterView; import android widget AdapterView OnItemSelecte [更多]
Gallery实现横向滑动图片
Gallery可以横向显示一组图片,并且可以横向滑动。下面展示如何使用Gallery去显示图片。 其用法用ListView几乎一致。 大致为: 1.在布局文件中加入Gallery控件 activity_main.xml <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:
双图片、gallery
gallery图片滑动,实现双滑动。如有需要直接改可以用
jquery 3d图片 gallery
jquery 3d图片gallery
Gallery 旋转图片
首先声明,源代码转载自国外Neil Davies,使用Apache2.0开源协议,请使用源代码的人自觉遵守协议内容。 本文为Kearnel原创,转载请注明出处。 使用过Android自带的gallery组件的人都知道,gallery实现的效果就是拖动浏览一组图片,相比iphone里也是用于拖动浏览图片的coverflow,显然逊色不少。实际上,可以通过扩展gallery,通过...
Gallery滑动图片
android 原声实现,滑动图片效果不错。以点图控制Gallery滑动图片
gallery实现图片的展示
主要通过gallery实现侧滑,并且能够使在左右两边显示部分的图片
gallery 图片自动滑动
可以实现gallery浏览图片,手指滑动可以浏览,并且增加了字典里滑动图片方便大家浏览,图片还有文字说明,下面图片滚动标志。
gallery 选中图片放大缩小
NULL 博文链接:https://flyingsir-zw.iteye.com/blog/1456518
Gallery图片墙
gallery图片墙,倒影效果,还有toast点击效果,非常漂亮
Gallery异步加载当前页图片
Gallery异步加载当前页图片,记住Gallery滑动的时候不会去下载全部的图片,只有停留在当前页的图片才会下载加载,这样大大的节约了用户流量
adRotator 显示不出图片不知道为什么
Advertisment.xmlrnrnrn rn Image/Autumn Leaves.jpgrn aaaaaaaarn aaaaaaaaarn bbbbbbbbrn 80rn rn rn Image/Creek.jpgrn aaaaaaaarn aaaaaaaaarn bbbbbbbbrn 80rn rn rn rnrnrnrnrnrnDefault.aspxrnrn rn rnrn也尝试过:rnDefault.aspxrnrn DataFile="~/Advertisment.xml">rnrn都不行???
图片url没错 为什么浏览器图片显示不出?
[img=https://img-bbs.csdn.net/upload/201402/25/1393309793_27494.jpg][/img]rn[img=https://img-bbs.csdn.net/upload/201402/25/1393309815_387382.jpg][/img]rn[img=https://img-bbs.csdn.net/upload/201402/25/1393309826_389396.jpg][/img]rnrn图片url没有问题不然另外两个不会显示出来rn最左边的始终显示不出 是什么问题???
为什么这个页面中显示不出图片
我用dreamweaver做的一个页面,在设计状态下能正常显示插入的图片,可是到ie中预览,却发现根本没显示出图片。我检查了html语言,发现他和其他页面一样都采用相对路径,可是其他页面没有这个问题。请问是怎么回事?是不是dreamweaver中哪个设置有问题。
Win32 为什么我显示不出图片???
[code=C/C++]rn// 全局变量rnHDC g_hDc;rnHBITMAP g_hBitmap;rnHDC g_hPointDc;rnHBITMAP g_hPoint;rnrn// 消息处理rnLRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)rnrn int wmId, wmEvent;rn PAINTSTRUCT ps;rn HDC hdc;rnrn switch (message)rn rn case WM_CREATE:rn rn HDC dc = GetDC(hWnd);rn g_hDc = CreateCompatibleDC(NULL);rn g_hPointDc = CreateCompatibleDC(NULL);rn g_hBitmap = CreateCompatibleBitmap(dc, 800, 600);rn ReleaseDC(NULL, dc);rnrn g_hPoint = (HBITMAP)::LoadImage(NULL, "point.jpg",IMAGE_BITMAP, 313, 400, LR_LOADFROMFILE );rnrn SelectObject(g_hDc, g_hBitmap);rn SelectObject(g_hPointDc, g_hPoint);rn SetTimer(hWnd, 1, 10, NULL);rnrn break;rn rnrn case WM_TIMER:rn rn HDC hdc = GetDC(hWnd);rn SelectObject(g_hPointDc, g_hPoint);rn ::BitBlt(g_hDc, 0, 0, 24, 24, g_hPointDc, 0, 0, SRCCOPY);rnrn BitBlt(hdc, 0, 0, 800, 600, g_hDc, 0, 0, SRCCOPY);rn ReleaseDC(NULL, hdc);rn rn default:rn return DefWindowProc(hWnd, message, wParam, lParam);rn rn return 0;rnrn[/code]rnrn为什么显示不出 point.jpg 这张图片,只有一片黑色???
为什么这段代码读不出图片?
import javax.microedition.midlet.*;rnimport javax.microedition.lcdui.*;rnrnpublic class ImageEx extends MIDlet implements CommandListenerrn private Command cmdExit;rn private ImageCanvas canvas;rn public ImageEx()rn cmdExit=new Command("Exit",Command.SCREEN,2);rn canvas=new ImageCanvas();rn rn public void startApp() rn canvas.addCommand(cmdExit);rn canvas.setCommandListener(this);rn Display.getDisplay(this).setCurrent(canvas);rn rn rn public void pauseApp() rn rn rn public void destroyApp(boolean unconditional) rn rn rn public void commandAction(Command c,Displayable d)rn if(c==cmdExit)rn notifyDestroyed();rn rn rnrnclass ImageCanvas extends Canvasrn public void paint(Graphics g)rn int width=getWidth();rn int height=getHeight();rn rn g.setColor(0);rn g.fillRect(0,0,width,height);rn rn tryrn Image image=Image.createImage("/java.png");rn g.drawImage(image,0,0,g.TOP|g.LEFT);rn rn catch(Exception e)rn System.out.println(e.getMessage());rn rn rnrn运行后屏幕是黑色的,图片没有显示出来
php+mysql显示不出图片,这是为什么
--- index.phprnrnrnrnrn rn rn rn rn rn rnrnrnrnrnrnrn rnrn rn rnrn rnrnrnrnrnrnrn rnrnrn--- image.phprnrnrn--- upload.phprn ";rn echo " ";rn echo "";rn echo "" . $info . "……";rn echo "";rnrn?>rnrnrn就是不显示图片,求大神指导rnrnrnrn
jsp页面为什么显示不出中文名称的图片?
如题
这样为什么取不出数据库里的图片
[code=C#]rn string pictureaddress; //图片路径rn OpenFileDialog opendialog = new OpenFileDialog(); //打开文件对话框rn opendialog.Filter = "JpegAndGif|*.jpg;*.Gif;*.png"; //筛选格式rn opendialog.RestoreDirectory = true;rn opendialog.FilterIndex = 1;rn if (opendialog.ShowDialog() == DialogResult.OK)rn rn pictureaddress = opendialog.FileName; //取到图片地址rn pictureBox1.Image = Image.FromFile(pictureaddress, false);rnrn rnrn[/code]rn然后存入数据库rn rn [code=C#]rn string st = "insert into xixi(Image) values ('pictureaddress')"; //存入数据库rn DB.ExecSql(st,pictureaddress);rnrn 其中db类是下面这样rn rn public class DB //连接数据库的db类rn rn public static SqlConnection Getconn()rn rn SqlConnection con = new SqlConnection("server=.;database=test;uid=sa;pwd=123");rn return con;rn rnrn public static void ExecSql(string strsql, string image)rn rn FileStream fs = File.OpenRead(image);rn byte[] imageb = new byte[fs.Length];rn fs.Read(imageb, 0, imageb.Length);rn fs.Close();rn SqlConnection con = Getconn();rn SqlCommand cmd = new SqlCommand(strsql, con);rn cmd.Parameters.Add("@Image", SqlDbType.Image);rn cmd.Parameters["@Image"].Value = imageb;rn con.Open();rn cmd.ExecuteNonQuery();rn con.Close();rn rn rn [/code]rnrn再从数据库里面取出来rn[code=C#] rn string st = "select Image from test;rn DataTable dt = DB.Select(st);rn Byte[] imgbt = (Byte[])dt.Rows[0]["Image"]; //转为字符流rn if(imgbt.Length != 0) rn rn MemoryStream imgms = new MemoryStream(imgbt,true); rn imgms.Write(imgbt, 0, imgbt.Length); rn pictureBox1.Image = new Bitmap(imgms); //显示参数无效 rn imgms.Close();rn [/code]rn去不出来图片。。。老是说 参数无效rn
为什么以下程序显示不出其中的图片?
图片bug1.gif和java文件在同一个文件夹内,但却显示不出图片,WHY?。。。。rnimport java.awt.*;rnimport java.awt.event.*;rnimport javax.swing.*;rnrnpublic class ShowIcon extends JFramernrn private JLabel label;rn private Icon icon=new ImageIcon("bug1.gif");rn rn public ShowIcon()rn rn super("Why I can't see the icon!");rn Container c=getContentPane();rn c.setLayout(new FlowLayout());rn label=new JLabel();rn c.add(label);rn label.setIcon(icon);rn setSize(320,100);rn show();rn rn rn rn public static void main(String args[])rn rn ShowIcon app=new ShowIcon();rn app.addWindowListener(rn new WindowAdapter()rn public void windowClosing(WindowEvent e)rn rn System.exit(0);rn rn rn rn );rn rn
相关热词 c# 标准差 计算 c#siki第五季 c#入门推荐书 c# 解码海康数据流 c# xml的遍历循环 c# 取 查看源码没有的 c#解决高并发 委托 c#日期转化为字符串 c# 显示问号 c# 字典对象池