游戏登录总显示“Errorweex loading 不显示bitmap”,换个网就可以,这是怎么回事?

(window.slotbydup=window.slotbydup || []).push({
id: '2491531',
container: s,
size: '150,90',
display: 'inlay-fix'
Error loading operating system如何解决?
重装系统时,我划分了区盘,但没有成功,后来就退出了,后来就出现了Error loading operating system,现在键盘不能输入字母,无法操作!该怎么办呢?
Error loading operating system
是电脑找不到启动盘(由BOSS中设置的FIRST BOOT指定),或找到的启动盘无法完成启动的意思.
你分区失败,但同时失去了硬盘上的系统,用WINXP安装光盘或可启动的U盘,软盘引导启动应该可以了.
总之小毛病!不必担心!
这个情况跟我之前的本本一样,还会发出嘟嘟声,我的就是检测不了硬盘,也有可能是线松了,如果是笔记本的话,建议送回保修,因为笔记本跟台式的不一样,因为大多数笔记本都...
是不是你的主板不支持大容量的硬盘啊。根据你的提示,应该是找不到系统了。
从网上查查你的主板支持多大的盘。
我很无语 怎么都乱回答啊根据我处理这个问题的经验 :1.硬盘有坏区2.电脑可能中病毒了3.内存的问题4.下载文件受损这是那个对话框的英文翻译运行一个用Nulls...
根??愕拿枋觯?驳?p?牡?茁史浅5拇蟆?
可到?腦醫院看看有?]有辦法解?Q。
error loading operating system 是提示你载入系统是出错,也就是说你的硬盘在引导的时候就出问题了。你可能需要重建引导分区才行这个操作...
答: 21岁 性功能突然减退。 以前做爱 最多坚持一个半小时 有过手淫史 现在基本上一进去没1分钟就射了 什么情况
答: 比如常见的网吧电脑用的就是无盘网络技术。
优点:资源共享,节省资金。
缺点:访问速度慢,容易中毒!
答: 怎么解决?
B.20世纪上半叶,人类经历了两次世界大战,大量的青壮年人口死于战争;而20世纪下半叶,世界基本处于和平发展时期。
“癌症的发病率”我认为这句话指的是:癌症患者占总人数口的比例。
而B选项说是死亡人数多,即总体人数下降了,但“癌症的发病率”是根据总体人总来衡量的,所以B项不能削弱上述论证
铝属于两性金属,遇到酸性或碱性都会产生不同程度的腐蚀,尤其是铝合金铸件的孔隙较多,成分中还含有硅和几种重金属,其防腐蚀性能比其他铝合金更差,没有进行防护处理的铝铸件只要遇到稍带碱性或稍带酸性的水,甚至淋雨、水气、露水等就会受到腐蚀,产生白锈。
解决的办法。
铝铸件完成铸造后,在机械加工前,先要进行表面预处理,如预先对铸件进行喷砂,涂上一道底漆(如锌铬黄底漆),在此基础上再进行机械加工,以避免铸铝件在没有保护的情况下放久了被腐蚀。
如何洗衣服?也许有人会说,衣服谁不会洗啊?放到水里,加点洗衣粉洗就成了呗。是啊,说是这样说,可是洗衣服还有不少学问呢。我就说说我的“洗衣经”吧。
说起洗衣服,想想真有不少要说的呢。
首先要分开洗。内衣外衣、深色浅色要分开。个人和个人的衣物也尽量分开洗涤,这样可以防止不同人体间细菌和病菌的相互交叉感染,尤其是宿舍或者朋友的衣服尽量不要放置在一起洗。即使是自己的衣服,内衣和外衣也要分开洗。因为外衣接触外界的污染和尘土较多,而内衣将直接接触皮肤,为避免外界尘螨等对皮肤的不良入侵,内外分开洗涤是有科学道理的。不同颜色的衣物要分开洗涤,可将颜色相近的一同洗涤,浅色的一起洗涤,容易掉色的单独洗涤,避免衣物因脱色而损坏。另外,袜子和其他衣物不要一起洗涤。
其次,使用洗衣粉宜提浸泡一会。洗衣粉功效的发挥不同于肥皂,只有衣物适时浸泡才能发挥最大的洗涤效果。浸泡时间也不宜太长,一般20分钟左右。时间太长,洗涤效果也不好,而且衣物易褶皱。有人洗衣服时把洗衣粉直接撒在衣物上便开始搓揉洗涤,那样不能发挥最好的洗涤效果,对洗衣粉是一种浪费,当然,免浸泡洗衣粉出外。另外,冬季一般宜使用温水浸泡衣物。水温过低,不能有效发挥洗衣粉的洗涤效果,水温太高,会破坏洗衣粉中的活性成分,也不利于洗涤。
再次,衣物及时更换,及时洗涤。衣服要及时更换,相信道理大家应该都很清楚。可是,衣物换下后应该及时清洗,有人却做的不好。好多家庭喜欢将换的衣服积攒起来,每周洗一次,这样很不科学,容易使衣物上积聚的细菌大量繁殖,容易诱发皮疹或皮肤瘙痒症状。为了个人和家人的身体健康,还是勤快一点,把及时换下的衣物及时洗涤,这样,其实也费不了多少时间,也不至于最后要花费半天甚至更长 的时间专门来洗涤大量的衣物要节约的多。另外衣服穿的太久就比较脏,要花很大的力气洗涤才能洗干净,也容易将衣物搓揉变形,而影响美观和穿着效果。
洗衣服是个简单的小家务,也是生活中不可缺少的一件事,学问却很多,也许您的“洗衣心得”比这还要科学,还要多样,欢迎您 的指正~~
关于三国武将的排名在玩家中颇有争论,其实真正熟读三国的人应该知道关于三国武将的排名早有定论,头十位依次为:
头吕(吕布)二赵(赵云)三典韦,四关(关羽)五许(许楮)六张飞,七马(马超)八颜(颜良)九文丑,老将黄忠排末位。
关于这个排名大家最具疑问的恐怕是关羽了,这里我给大家细细道来。赵云就不用多说了,魏军中七进七出不说武功,体力也是超强了。而枪法有六和之说,赵云占了个气,也就是枪法的鼻祖了,其武学造诣可见一斑。至于典韦,单凭他和许楮两人就能战住吕布,武功应该比三英中的关羽要强吧。
其实单论武功除吕布外大家都差不多。论战功关羽斩颜良是因为颜良抢军马已经得手正在后撤,并不想与人交手,没想到赤兔马快,被从后背赶上斩之;文丑就更冤了,他是受了委托来招降关羽的,并没想着交手,结果话没说完关羽的刀就到了。只是由于过去封建统治者的需要后来将关羽神话化了,就连日本人也很崇拜他,只不过在日本的关公形象是扎着日式头巾的。
张飞、许楮、马超的排名比较有意思,按理说他们斗得势均力敌都没分出上下,而古人的解释是按照他们谁先脱的衣服谁就厉害!有点搞笑呦。十名以后的排名笔者忘记了,好象第11个是张辽。最后需要说明的是我们现在通常看到的《三国演义》已是多次修改过的版本,笔者看过一套更早的版本,有些细节不太一样。
考虑是由于天气比较干燥和身体上火导致的,建议不要吃香辣和煎炸的食物,多喝水,多吃点水果,不能吃牛肉和海鱼。可以服用(穿心莲片,维生素b2和b6)。也可以服用一些中药,如清热解毒的。
确实没有偿还能力的,应当与贷款机构进行协商,宽展还款期间或者分期归还; 如果贷款机构起诉到法院胜诉之后,在履行期未履行法院判决,会申请法院强制执行; 法院在受理强制执行时,会依法查询贷款人名下的房产、车辆、证券和存款;贷款人名下没有可供执行的财产而又拒绝履行法院的生效判决,则有逾期还款等负面信息记录在个人的信用报告中并被限制高消费及出入境,甚至有可能会被司法拘留。
第一步:教育引导
不同年龄阶段的孩子“吮指癖”的原因不尽相同,但于力认为,如果没有什么异常的症状,应该以教育引导为首要方式,并注意经常帮孩子洗手,以防细菌入侵引起胃肠道感染。
第二步:转移注意力
比起严厉指责、打骂,转移注意力是一种明智的做法。比如,多让孩子进行动手游戏,让他双手都不得闲,或者用其他的玩具吸引他,还可以多带孩子出去游玩,让他在五彩缤纷的世界里获得知识,增长见识,逐渐忘记原来的坏习惯。对于小婴儿,还可以做个小布手套,或者用纱布缠住手指,直接防止他吃手。但是,不主张给孩子手指上“涂味”,比如黄连水、辣椒水等,以免影响孩子的胃口,黄连有清热解毒的功效,吃多了还可导致腹泻、呕吐。
合肥政务区网络广告推广网络推广哪家公司比较好 一套能在互联网上跑业务的系统,被网络营销专家赞为目前最 有效的网络推广方式!
1、搜索引擎营销:分两种SEO和PPC,即搜索引擎优化,是通过对网站结构、高质量的网站主题内容、丰富而有价值的相关性外部链接进行优化而使网站为用户及搜索引擎更加友好,以获得在搜索引擎上的优势排名为网站引入流量。
良工拥有十多位资深制冷维修工程师,十二年生产与制造经验,技术力量雄厚,配有先进的测试仪器,建有系列低温测试设备,备有充足的零部件,包括大量品牌的压缩机,冷凝器,蒸发器,水泵,膨胀阀等备品库,能为客户提供迅捷,优质的工业冷水机及模温机维修和保养。
楼主,龙德教育就挺好的,你可以去试试,我们家孩子一直在龙德教育补习的,我觉得还不错。
成人可以学爵士舞。不过对柔软度的拒绝比较大。  不论跳什么舞,如果要跳得美,身体的柔软度必须要好,否则无法充分发挥出理应的线条美感,爵士舞也不值得注意。在展开暖身的弯曲动作必须注意,不适合在身体肌肉未几乎和暖前用弹振形式来做弯曲,否则更容易弄巧反拙,骨折肌肉。用静态方式弯曲较安全,不过也较必须耐性。柔软度的锻炼动作之幅度更不该超过疼痛的地步,肌肉有向上的感觉即可,动作(角度)保持的时间可由10馀秒至30-40秒平均,时间愈长对肌肉及关节附近的联结的组织之负荷也愈高。
用360安全卫士清除一下就行了,很简单的!
简单一点,到msconfig的启动后,把ctfmon留下,其它都勾掉试试看
解决方法:
控制面板-系统-“高级”选项卡-右下方的“错误报告”-选择“禁
用错误报告”,最好勾选“但在发生严重错误时通知我”-确定
用360安全卫士v4.0查杀
启动之后----全面诊断--常规--清除恶评及插件
高级--启动项管理--ctfmon之外禁用--查杀木马
--最后高级修复IE--清理完必之后重启。
重启之后症状一样就进安全模式重复以上操作!
360安全卫士 V4.0 贺岁预览版
你的赛门铁克软件出问题了,Rtvscan.exe 需要运行时间,建议重装赛门铁克软件。
你重新下载个客户端 用那个 Launcher.exe 进行自动更新 更新时关掉所有无关的程序 如果不行 就进这里下载 补丁
error是什么意思 : 错误
GM,拜托你们能回答的有创意些吗?每次不是叫我们什么重新安装就是小退下试试,就你们这样真的好无聊的。
是用的免费黄钻代码吧
其实保存一下到歌曲或服务器就可以了。
不明白可以问我
Closed关闭的意思
晚点再尝试的意思
大概晚点再上就好了吧
只需要把“声音播放”里的首选设备改过即可。
正在加载...
Copyright &
Corporation, All Rights Reserved
确定举报此问题
举报原因(必选):
广告或垃圾信息
激进时政或意识形态话题
不雅词句或人身攻击
侵犯他人隐私
其它违法和不良信息
报告,这不是个问题
报告原因(必选):
这不是个问题
这个问题分类似乎错了
这个不是我熟悉的地区
相关问答:123456789101112131415从中,我们学习了Android-Universal-Image-Loader(以下简称UIL)中四个DisplayImage重载方法的使用,如果你还没有学习,最好先返回去看看,不然可能不理解这篇文章。在这篇文章中我们将主要探讨Android-Universal-Image-Loader的主要流程和这些流程相关的类的分析。
我们先了解一下UIL加载图片的流程(可以通过查看ImageLoader.displayImage(&)方法分析得出),如下图
从上图中,我们可以看出,UIL加载图片的一般流程是先判断内存中是否有对应的Bitmap,再判断磁盘(disk)中是否有,如果没有就从网络中加载。最后根据原先在UIL中的配置判断是否需要缓存Bitmap到内存或磁盘中。Bitmap加载完后,就对它进行解析,然后显示到特定的ImageView中。
有了对UIL对图片加载和处理流程的初步认识之后,我们就可以着手分析它的源代码了。先从ImageLoader.displayImage(...)入手,毕竟一切都因它而始。
public void displayImage(String uri, ImageAware imageAware, DisplayImageOptions options,
ImageLoadingListener listener, ImageLoadingProgressListener progressListener) {
//检查UIL的配置是否被初始化
checkConfiguration();
if (imageAware == null) {
throw new IllegalArgumentException(ERROR_WRONG_ARGUMENTS);
if (listener == null) {
listener = emptyL
if (options == null) {
options = configuration.defaultDisplayImageO
if (TextUtils.isEmpty(uri)) {
engine.cancelDisplayTaskFor(imageAware);
listener.onLoadingStarted(uri, imageAware.getWrappedView());
if (options.shouldShowImageForEmptyUri()) {
imageAware.setImageDrawable(options.getImageForEmptyUri(configuration.resources));
imageAware.setImageDrawable(null);
listener.onLoadingComplete(uri, imageAware.getWrappedView(), null);
//计算Bitmap的大小,以便后面解析图片时用
ImageSize targetSize = ImageSizeUtils.defineTargetSizeForView(imageAware, configuration.getMaxImageSize());
String memoryCacheKey = MemoryCacheUtils.generateKey(uri, targetSize);
engine.prepareDisplayTaskFor(imageAware, memoryCacheKey);
listener.onLoadingStarted(uri, imageAware.getWrappedView());
//Bitmap是否缓存在内存?
Bitmap bmp = configuration.memoryCache.get(memoryCacheKey);
if (bmp != null && !bmp.isRecycled()) {
L.d(LOG_LOAD_IMAGE_FROM_MEMORY_CACHE, memoryCacheKey);
if (options.shouldPostProcess()) {
ImageLoadingInfo imageLoadingInfo = new ImageLoadingInfo(uri, imageAware, targetSize, memoryCacheKey,
options, listener, progressListener, engine.getLockForUri(uri));
//处理并显示图片
ProcessAndDisplayImageTask displayTask = new ProcessAndDisplayImageTask(engine, bmp, imageLoadingInfo,
defineHandler(options));
if (options.isSyncLoading()) {
displayTask.run();
engine.submit(displayTask);
//显示图片
options.getDisplayer().display(bmp, imageAware, LoadedFrom.MEMORY_CACHE);
listener.onLoadingComplete(uri, imageAware.getWrappedView(), bmp);
if (options.shouldShowImageOnLoading()) {
imageAware.setImageDrawable(options.getImageOnLoading(configuration.resources));
} else if (options.isResetViewBeforeLoading()) {
imageAware.setImageDrawable(null);
ImageLoadingInfo imageLoadingInfo = new ImageLoadingInfo(uri, imageAware, targetSize, memoryCacheKey,
options, listener, progressListener, engine.getLockForUri(uri));
//启动一个线程,加载并显示图片
LoadAndDisplayImageTask displayTask = new LoadAndDisplayImageTask(engine, imageLoadingInfo,
defineHandler(options));
if (options.isSyncLoading()) {
displayTask.run();
engine.submit(displayTask);
代码有点多,但是有很多代码是进行异常判断处理和函数的回调,为了先把握整体的流程,我们先放弃细节方面的追踪。基本上重要的处理流程我都有用注释标出。不过,从这段代码中我们也可以看出这段代码的结构非常清晰。对图片的整个的加载流程都有对应的监听接口(ImageLoadingListener.onLoadingStarted,ImageLoadingListener.onLoadingComplete,ImageLoadingListener这个类就是用来监听图片的加载过程的),也就是说整个的图片加载过程程序员都可以进行相应的处理。我们先关注一下图片从无到有的加载过程,毕竟这部分是大家最为关心的。看到第63行中的LoadAndDisplayImageTask,跟进LoadAndDisplayImageTask.run()方法中。在这个run()方法中,除了 bmp = tryLoadBitmap();这一句是对图片进行加载,其他的函数都是对Bitmap进行处理或者显示。我们继续进入看看。
1 private Bitmap tryLoadBitmap() throws TaskCancelledException {
Bitmap bitmap = null;
//尝试从磁盘缓存中读取Bitmap
File imageFile = configuration.diskCache.get(uri);
if (imageFile != null && imageFile.exists()) {
L.d(LOG_LOAD_IMAGE_FROM_DISK_CACHE, memoryCacheKey);
loadedFrom = LoadedFrom.DISC_CACHE;
checkTaskNotActual();
bitmap = decodeImage(Scheme.FILE.wrap(imageFile.getAbsolutePath()));
//没有缓存在磁盘,从网络中下载图片
if (bitmap == null || bitmap.getWidth() &= 0 || bitmap.getHeight() &= 0) {
L.d(LOG_LOAD_IMAGE_FROM_NETWORK, memoryCacheKey);
loadedFrom = LoadedFrom.NETWORK;
String imageUriForDecoding =
if (options.isCacheOnDisk() && tryCacheImageOnDisk()) {
imageFile = configuration.diskCache.get(uri);
if (imageFile != null) {
imageUriForDecoding = Scheme.FILE.wrap(imageFile.getAbsolutePath());
checkTaskNotActual();
bitmap = decodeImage(imageUriForDecoding);
if (bitmap == null || bitmap.getWidth() &= 0 || bitmap.getHeight() &= 0) {
fireFailEvent(FailType.DECODING_ERROR, null);
} catch (IllegalStateException e) {
fireFailEvent(FailType.NETWORK_DENIED, null);
} catch (TaskCancelledException e) {
} catch (IOException e) {
fireFailEvent(FailType.IO_ERROR, e);
} catch (OutOfMemoryError e) {
fireFailEvent(FailType.OUT_OF_MEMORY, e);
} catch (Throwable e) {
fireFailEvent(FailType.UNKNOWN, e);
从3~12行是尝试从磁盘缓存中加载Bitmap。第19行判断磁盘中是否有缓存,就开始进行网络下载(tryCacheImageOnDisk())。在tryCacheImageOnDisk()函数中有个tryCacheImageOnDisk()的 loaded = downloadImage()这行进行图片下载。
private boolean downloadImage() throws IOException {
InputStream is = getDownloader().getStream(uri, options.getExtraForDownloader());
return configuration.diskCache.save(uri, is, this);
这个函数做的事情很简单,就是获取一个实现Image Downloader的downloader(当然这里,作者根据网络情况将downloader分为慢速(slowNetworkDownloader)、正常速度(downloader)、网络拒绝(networkDeniedDownloader)情况下的download,在这里我们不展开,你只要知道他们是imageDownloader接口的实现者就行,后面的文章会探讨这个问题),然后利用Disk Cache将Bitmap写入磁盘缓存中。返回到之前我们进入downloadImage()函数中的tryLoadBitmap(),在将图片缓存到磁盘中。是否缓存到磁盘跟配置有关)后,紧接着调用 bitmap = decodeImage(Scheme.FILE.wrap(imageFile.getAbsolutePath()));解析图片。进入decodeImage()函数中,我们发现UIL调用Image Decoder进行图片的解析。
private Bitmap decodeImage(String imageUri) throws IOException {
ViewScaleType viewScaleType = imageAware.getScaleType();
ImageDecodingInfo decodingInfo = new ImageDecodingInfo(memoryCacheKey, imageUri, uri, targetSize, viewScaleType,
getDownloader(), options);
return decoder.decode(decodingInfo);
decode()函数最终是调用BaseImageDecoder.decode()方法进行解析的,这个利用之前获得的inputStream,直接从它身上读取数据,然后进行解析,并对整个下载任务的网络接口进行重置。
1 public Bitmap decode(ImageDecodingInfo decodingInfo) throws IOException {
Bitmap decodedB
ImageFileInfo imageI
InputStream imageStream = getImageStream(decodingInfo);
imageInfo = defineImageSizeAndRotation(imageStream, decodingInfo);
imageStream = resetStream(imageStream, decodingInfo);
Options decodingOptions = prepareDecodingOptions(imageInfo.imageSize, decodingInfo);
decodedBitmap = BitmapFactory.decodeStream(imageStream, null, decodingOptions);
} finally {
IoUtils.closeSilently(imageStream);
if (decodedBitmap == null) {
L.e(ERROR_CANT_DECODE_IMAGE, decodingInfo.getImageKey());
decodedBitmap = considerExactScaleAndOrientatiton(decodedBitmap, decodingInfo, imageInfo.exif.rotation,
imageInfo.exif.flipHorizontal);
return decodedB
接下来,有了解析好的Bitmap对象后,剩下的就是在Image View对象中显示它了。我们回到文章一开始介绍到的ImageLoader.displayImage(...)函数中(相关的代码在文章的开头处可以看到)。
为了方便,我还是将ImageLoader.displayImage(...)中涉及的代码贴在下面。
DisplayBitmapTask displayBitmapTask = new DisplayBitmapTask(bmp, imageLoadingInfo, engine, loadedFrom);
runTask(displayBitmapTask, syncLoading, handler, engine);
我们进去DisplayBitmapTask.run()函数中看看。除去前面几行的ImageLoadingListener.ImageLoadingListener()代码,相关代码其实就一行&displayer.display(bitmap, imageAware, loadedFrom),它其实就是调用BitmapDisplayer这个对象将Bitmap对象显示到ImageView上。根据实现BitmapDisplayer接口的不同对象,还有SimpleBitmapDisplayer、FadeInBitmapDisplayer、RoundedBitmapDisplayer、RoundedVignetteBitmapDisplayer这5种对象。
最后,让我们用任务流图概况以上的处理流程中对应接口。
在接下去的文章中,我们会介绍UIL中的包设计、缓冲、下载、多任务机制。
阅读(...) 评论()8-bit&bitmap&loading&完全看不懂的位图加载
完全看不懂的位图加载,我看了很多天,就还是不太懂,还有一个重大的问题就是什么同样的程序vc6和vs2008都可以编译通过,然后运行的时候vc6的程序正常,vs2008的程序内存错误啊???抓狂啊!!!
我还要多看几遍?
// DEMO7_10.CPP 8-bit bitmap loading demo
// INCLUDES ///////////////////////////////////////////////
#define WIN32_LEAN_AND_MEAN& // just say no to
#define INITGUID
#pragma comment(lib,"ddraw.lib")
//#pragma comment(lib,"LIBCD")
&windows.h&&&
// include important windows stuff
#include &windowsx.h&
#include &mmsystem.h&
//#include &iostream.h& // include
important C/C++ stuff
#include &conio.h&
#include &stdlib.h&
#include &malloc.h&
#include &memory.h&
#include &string.h&
#include &stdarg.h&
#include &stdio.h&
#include &math.h&
#include &io.h&
#include &fcntl.h&
#include &ddraw.h& // include
directdraw
// DEFINES ////////////////////////////////////////////////
// defines for windows
#define WINDOW_CLASS_NAME "WINCLASS1"
// default screen size
SCREEN_WIDTH&&&
640& // size of screen
#define SCREEN_HEIGHT&& 480
SCREEN_BPP&&&&&
8&&& // bits per
BITMAP_ID&&&&&&&&&&&
0x4D42 // universal id for a bitmap
#define MAX_COLORS_PALETTE&&
//////////////////////////////////////////////////////
// basic unsigned types
typedef unsigned short USHORT;
typedef unsigned short WORD;
typedef unsigned char& UCHAR;
typedef unsigned char& BYTE;
// container structure for bitmaps .BMP file
typedef struct BITMAP_FILE_TAG
BITMAPFILEHEADER& // this
contains the bitmapfile header
BITMAPINFOHEADER& // this is all
the info including the palette
PALETTEENTRY&&&&
palette[256];&&&&&
// we will store the palette here
UCHAR&&&&&&&&&&&
*&&&&&&&&&&
// this is a pointer to the data
} BITMAP_FILE, *BITMAP_FILE_PTR;
// PROTOTYPES&
//////////////////////////////////////////////
int Flip_Bitmap(UCHAR *image, int bytes_per_line, int
int Load_Bitmap_File(BITMAP_FILE_PTR bitmap, char
*filename);
int Unload_Bitmap_File(BITMAP_FILE_PTR bitmap);
int DDraw_Fill_Surface(LPDIRECTDRAWSURFACE7 lpdds,int
// MACROS /////////////////////////////////////////////////
// tests if a key is up or down
#define KEYDOWN(vk_code) ((GetAsyncKeyState(vk_code)
& 0x8000) ? 1 : 0)
#define KEYUP(vk_code)&&
((GetAsyncKeyState(vk_code) & 0x8000) ? 0 : 1)
// initializes a direct draw struct
#define DDRAW_INIT_STRUCT(ddstruct) {
memset(&ddstruct,0,sizeof(ddstruct));
ddstruct.dwSize=sizeof(ddstruct); }
// GLOBALS ////////////////////////////////////////////////
main_window_handle = NULL; // globally track main window
window_closed&&&&&
= 0;&&& //
tracks if window is closed
hinstance_app&&&&&
= NULL; // globally track hinstance
// directdraw stuff
LPDIRECTDRAW7&&&&&&&&
lpdd&&&&&&&&
= NULL;&& // dd object
LPDIRECTDRAWSURFACE7& lpddsprimary =
NULL;&& // dd primary
LPDIRECTDRAWSURFACE7&
lpddsback&&& =
NULL;&& // dd back surface
LPDIRECTDRAWPALETTE&&
lpddpal&&&&&
= NULL;&& // a pointer to the
created dd palette
LPDIRECTDRAWCLIPPER&&
lpddclipper& =
NULL;&& // dd clipper
PALETTEENTRY&&&&&&&&&
palette[256];&&&&&&&&&
// color palette
PALETTEENTRY&&&&&&&&&
save_palette[256];&&&&
// used to save palettes
DDSURFACEDESC2&&&&&&&
&&&&&&&&&&&&&&&&&
// a direct draw surface description struct
DDBLTFX&&&&&&&&&&&&&&
&&&&&&&&&&&&&&
// used to fill
DDSCAPS2&&&&&&&&&&&&&
&&&&&&&&&&&&&&
// a direct draw surface capabilities struct
HRESULT&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&
// result back from dd calls
DWORD&&&&&&&&&&&&&&&&
start_clock_count = 0; // used for timing
BITMAP_FILE&&&&&&&&&&
&&&&&&&&&&&&&&&
// holds the bitmap
buffer[80];&&&&&&&&&&&&&&&&&&&&&&&&&&&&
// general printing buffer
// FUNCTIONS
////////////////////////////////////////////////
int Load_Bitmap_File(BITMAP_FILE_PTR bitmap, char
*filename)
// this function opens a bitmap file and loads the data into
int file_handle,& // the file handle
// looping index
UCHAR&& *temp_buffer = NULL;
// used to convert 24 bit images to 16 bit
file_&&&&&&&&&
// the file data information
// open the file if it exists
if ((file_handle =
OpenFile(filename,&file_data,OF_READ))==-1)
&& return(0);
// now load the bitmap file header
_lread(file_handle,
&bitmap-&bitmapfileheader,sizeof(BITMAPFILEHEADER));
// test if this is a bitmap file
(bitmap-&bitmapfileheader.bfType!=BITMAP_ID)
&& // close the file
&& _lclose(file_handle);
&& // return error
&& return(0);
&& } // end if
// now we know this is a bitmap, so read in all the sections
// first the bitmap infoheader
// now load the bitmap file header
_lread(file_handle,
&bitmap-&bitmapinfoheader,sizeof(BITMAPINFOHEADER));
// now load the color palette if there is one
if (bitmap-&bitmapinfoheader.biBitCount == 8)
&& _lread(file_handle,
&bitmap-&palette,MAX_COLORS_PALETTE*sizeof(PALETTEENTRY));
&& // now set all the flags in
the palette correctly and fix the reversed
&& // BGR RGBQUAD data
&& for (index=0; index
& MAX_COLORS_PALETTE; index++)
// reverse the red and green fields
temp_color&&&&&&&&&&&&&&&
= bitmap-&palette[index].peR
bitmap-&palette[index].peRed& =
bitmap-&palette[index].peB
bitmap-&palette[index].peBlue = temp_
// always set the flags word to this
bitmap-&palette[index].peFlags =
PC_NOCOLLAPSE;
} // end for index
&&& } // end
// finally the image data itself
_lseek(file_handle,-(int)(bitmap-&bitmapinfoheader.biSizeImage),SEEK_END);
// now read in the image, if the image is 8 or 16 bit then
simply read it
// but if its 24 bit then read it into a temporary area and then
// it to a 16 bit image
if (bitmap-&bitmapinfoheader.biBitCount==8 ||
bitmap-&bitmapinfoheader.biBitCount==16 ||
bitmap-&bitmapinfoheader.biBitCount==24)
&& // delete the last image if
there was one
(bitmap-&buffer)
free(bitmap-&buffer);
&& // allocate the memory for
(!(bitmap-&buffer = (UCHAR
*)malloc(bitmap-&bitmapinfoheader.biSizeImage)))
// close the file
_lclose(file_handle);
// return error
return(0);
} // end if
&& // now read it in
_lread(file_handle,bitmap-&buffer,bitmap-&bitmapinfoheader.biSizeImage);
&& } // end if
&& // serious problem
&& return(0);
&& } // end else
// write the file info out
printf("\nfilename:%s \nsize=%d \nwidth=%d \nheight=%d
\nbitsperpixel=%d \ncolors=%d \nimpcolors=%d",
bitmap-&bitmapinfoheader.biSizeImage,
bitmap-&bitmapinfoheader.biWidth,
bitmap-&bitmapinfoheader.biHeight,
&&bitmap-&bitmapinfoheader.biBitCount,
bitmap-&bitmapinfoheader.biClrUsed,
bitmap-&bitmapinfoheader.biClrImportant);
// close the file
_lclose(file_handle);
// flip the bitmap
Flip_Bitmap(bitmap-&buffer,
&&&&&&&&&&&
bitmap-&bitmapinfoheader.biWidth*(bitmap-&bitmapinfoheader.biBitCount/8),
&&&&&&&&&&&
bitmap-&bitmapinfoheader.biHeight);
// return success
return(1);
} // end Load_Bitmap_File
///////////////////////////////////////////////////////////
int Unload_Bitmap_File(BITMAP_FILE_PTR bitmap)
// this function releases all memory associated with "bitmap"
if (bitmap-&buffer)
&& // release memory
free(bitmap-&buffer);
&& // reset pointer
&& bitmap-&buffer
&& } // end if
// return success
return(1);
} // end Unload_Bitmap_File
///////////////////////////////////////////////////////////
int Flip_Bitmap(UCHAR *image, int bytes_per_line, int
// this function is used to flip bottom-up .BMP images
UCHAR * // used to perform the image processing
// looping index
// allocate the temporary buffer
if (!(buffer = (UCHAR *)malloc(bytes_per_line*height)))
&& return(0);
// copy image to work area
memcpy(buffer,image,bytes_per_line*height);
// flip vertically
for (index=0; index & index++)
memcpy(&image[((height-1) -
index)*bytes_per_line],
&&&&&&&&&&
&buffer[index*bytes_per_line], bytes_per_line);
// release the memory
free(buffer);
// return success
return(1);
} // end Flip_Bitmap
///////////////////////////////////////////////////////////////
int DDraw_Fill_Surface(LPDIRECTDRAWSURFACE7 lpdds,int
DDBLTFX // this contains the DDBLTFX structure
// clear out the structure and set the size field
DDRAW_INIT_STRUCT(ddbltfx);
// set the dwfillcolor field to the desired color
ddbltfx.dwFillColor =
// ready to blt to surface
lpdds-&Blt(NULL,&&&&&&
// ptr to dest rectangle
&&&&&&&&&&
NULL,&&&&&&
// ptr to source surface,
NA&&&&&&&&&&&
&&&&&&&&&&
NULL,&&&&&&
// ptr to source rectangle, NA
&&&&&&&&&&
DDBLT_COLORFILL | DDBLT_WAIT,&&
// fill and
wait&&&&&&&&&&&&&&&&&&
&&&&&&&&&&
&ddbltfx);& // ptr to DDBLTFX
// return success
return(1);
} // end DDraw_Fill_Surface
///////////////////////////////////////////////////////////////
LRESULT CALLBACK WindowProc(HWND hwnd,
&&&&&&&&&&&&&&&&&&&&&&&&&&&
WPARAM wparam,
&&&&&&&&&&&&&&&&&&&&&&&&&&&
LPARAM lparam)
// this is the main message handler of the system
PAINTSTRUCT&&&&//
used in WM_PAINT
HDC&&&&&//
handle to a device context
buffer[80];&&&&&&&
// used to print strings
// what is the message
switch(msg)
&case WM_CREATE:
&&// do initialization stuff
// return success
&&return(0);
&case WM_PAINT:
&&// simply validate the
hdc = BeginPaint(hwnd,&ps);&
// end painting
EndPaint(hwnd,&ps);
// return success
&&return(0);
&case WM_DESTROY:
&&// kill the application,
this sends a WM_QUIT message
&&PostQuitMessage(0);
// return success
&&return(0);
&&& } // end
// process any messages that we didn't take care of
return (DefWindowProc(hwnd, msg, wparam, lparam));
} // end WinProc
///////////////////////////////////////////////////////////
int Game_Main(void *parms = NULL, int num_parms = 0)
// this is the main loop of the game, do all your processing
// make sure this isn't executed again
if (window_closed)
&& return(0);
// for now test if user is hitting ESC and send WM_CLOSE
if (KEYDOWN(VK_ESCAPE))
PostMessage(main_window_handle,WM_CLOSE,0,0);
&& window_closed = 1;
&& } // end if
// copy the bitmap image to the primary buffer line by
// note this is a good candidate operation to make into a function
// lock the primary surface
lpddsprimary-&Lock(NULL,&ddsd,
DDLOCK_SURFACEMEMORYPTR | DDLOCK_WAIT,NULL);
// get video pointer to primary surfce
UCHAR *primary_buffer = (UCHAR
*)ddsd.lpS&&&&&&
// test if memory is linear
if (ddsd.lPitch == SCREEN_WIDTH)
&& // copy memory from double
buffer to primary buffer
&& memcpy((void *)primary_buffer,
(void *)bitmap.buffer, SCREEN_WIDTH*SCREEN_HEIGHT);
&& } // end if
&& { // non-linear
&& // make copy of source and
destination addresses
&& UCHAR *dest_ptr =
*src_ptr& = bitmap.
&& // memory is non-linear,
copy line by line
&& for (int y=0; y
& SCREEN_HEIGHT; y++)
// copy line
memcpy((void *)dest_ptr, (void *)src_ptr, SCREEN_WIDTH);
// advance pointers to next line
dest_ptr+=ddsd.lP
src_ptr +=SCREEN_WIDTH;
} // end for
&& } // end else
// now unlock the primary surface
if (FAILED(lpddsprimary-&Unlock(NULL)))
&& return(0);
// do nothing -- look at pretty picture
// return success or failure or your own return code here
return(1);
} // end Game_Main
////////////////////////////////////////////////////////////
int Game_Init(void *parms = NULL, int num_parms = 0)
// this is called once after the initial window is created
// before the main event loop is entered, do all your
initialization
// create IDirectDraw interface 7.0 object and test for
if (FAILED(DirectDrawCreateEx(NULL, (void **)&lpdd,
IID_IDirectDraw7, NULL)))
&& return(0);
// set cooperation to full screen
(FAILED(lpdd-&SetCooperativeLevel(main_window_handle,
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
DDSCL_FULLSCREEN | DDSCL_ALLOWMODEX |
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
DDSCL_EXCLUSIVE | DDSCL_ALLOWREBOOT)))
&& return(0);
// set display mode to 640x480x8
if (FAILED(lpdd-&SetDisplayMode(SCREEN_WIDTH,
SCREEN_HEIGHT, SCREEN_BPP,0,0)))
&& return(0);
// clear ddsd and set size
DDRAW_INIT_STRUCT(ddsd);
// enable valid fields
ddsd.dwFlags = DDSD_CAPS;
// request primary surface
ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
// create the primary surface
(FAILED(lpdd-&CreateSurface(&ddsd,
&lpddsprimary, NULL)))
&& return(0);
// build up the palette data array
for (int color=1; color & 255; color++)
&&& // fill with
random RGB values
palette[color].peRed&& =
rand()%256;
palette[color].peGreen = rand()%256;
palette[color].peBlue& = rand()%256;
&&& // set
flags field to PC_NOCOLLAPSE
palette[color].peFlags = PC_NOCOLLAPSE;
&&& } // end for
// now fill in entry 0 and 255 with black and white
palette[0].peRed&&&&
palette[0].peGreen&& = 0;
palette[0].peBlue&&&
palette[0].peFlags&& =
PC_NOCOLLAPSE;
palette[255].peRed&& =
palette[255].peGreen = 255;
palette[255].peBlue& = 255;
palette[255].peFlags = PC_NOCOLLAPSE;
// create the palette object
if (FAILED(lpdd-&CreatePalette(DDPCAPS_8BIT |
DDPCAPS_ALLOW256 |
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
DDPCAPS_INITIALIZE,
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
palette,&lpddpal, NULL)))
return(0);
// finally attach the palette to the primary surface
if (FAILED(lpddsprimary-&SetPalette(lpddpal)))
&& return(0);
// load the 8-bit image
(!Load_Bitmap_File(&bitmap,"E:\\vs2008_projects\\Projects\\7.10\\bitmap8.bmp"))
&& return(0);
// load it's palette into directdraw
(FAILED(lpddpal-&SetEntries(0,0,MAX_COLORS_PALETTE,bitmap.palette)))
&& return(0);
// clean the surface
DDraw_Fill_Surface(lpddsprimary,0);
// return success or failure or your own return code here
return(1);
} // end Game_Init
/////////////////////////////////////////////////////////////
int Game_Shutdown(void *parms = NULL, int num_parms = 0)
// this is called after the game is exited and the main event
// loop while is exited, do all you cleanup and shutdown here
// first the palette
if (lpddpal)
lpddpal-&Release();
&& lpddpal = NULL;
&& } // end if
// now the primary surface
if (lpddsprimary)
lpddsprimary-&Release();
&& lpddsprimary = NULL;
&& } // end if
// now blow away the IDirectDraw4 interface
lpdd-&Release();
&& lpdd = NULL;
&& } // end if
// unload the bitmap file, we no longer need it
Unload_Bitmap_File(&bitmap);
// return success or failure or your own return code here
return(1);
} // end Game_Shutdown
// WINMAIN ////////////////////////////////////////////////
int WINAPI WinMain(&HINSTANCE hinstance,
&&&&&HINSTANCE
hprevinstance,
&&&&&LPSTR
lpcmdline,
WNDCLASSEX // this will hold the class we create
& // generic window handle
&& // generic message
HDC&&&&&&&
// graphics device context
// first fill in the window class stucture
winclass.cbSize&&&&&&&&
= sizeof(WNDCLASSEX);
winclass.style&&&=
CS_DBLCLKS | CS_OWNDC |
&&&&&&&&&&&&&&&&&&&&&&&&&
CS_HREDRAW | CS_VREDRAW;
winclass.lpfnWndProc&= WindowP
winclass.cbClsExtra&&= 0;
winclass.cbWndExtra&&= 0;
winclass.hInstance&&=
winclass.hIcon&&&=
LoadIcon(NULL, IDI_APPLICATION);
winclass.hCursor&&=
LoadCursor(NULL, IDC_ARROW);
winclass.hbrBackground&=
(HBRUSH)GetStockObject(BLACK_BRUSH);
winclass.lpszMenuName&= NULL;
winclass.lpszClassName&= WINDOW_CLASS_NAME;
winclass.hIconSm&&&&&&&
= LoadIcon(NULL, IDI_APPLICATION);
// save hinstance in global
hinstance_app =
// register the window class
if (!RegisterClassEx(&winclass))
&return(0);
// create the window
if (!(hwnd =
CreateWindowEx(NULL,&&&&&&&&&&&&&&&&&
// extended style
&&&&&&&&&&&&&&&&&&&&&&&&&&&
WINDOW_CLASS_NAME,&&&&
"DirectDraw 8-Bit Bitmap Loading", // title
WS_POPUP | WS_VISIBLE,
0,0,&& // initial x,y
SCREEN_WIDTH,SCREEN_HEIGHT,& // initial width,
NULL,&& // handle to parent
NULL,&& // handle to menu
hinstance,// instance of this application
NULL)))&// extra creation parms
return(0);
// save main window handle
main_window_handle =
// initialize game here
Game_Init();
// enter main event loop
while(TRUE)
&&& // test if
there is a message in queue, if so get it
(PeekMessage(&msg,NULL,0,0,PM_REMOVE))
&&& // test if
this is a quit
if (msg.message == WM_QUIT)
&&&&&&&&&&
&&& // translate
any accelerator keys
TranslateMessage(&msg);
&&& // send
the message to the window proc
DispatchMessage(&msg);
&&& } // end
// main game processing goes here
Game_Main();
&} // end while
// closedown game here
Game_Shutdown();
// return to Windows like this
return(msg.wParam);
} // end WinMain
///////////////////////////////////////////////////////////
已投稿到:
以上网友发言只代表其个人观点,不代表新浪网的观点或立场。}

我要回帖

更多关于 vue页面切换loading 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信