Re: How to detect lack of memory failure

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: George Yachán (2muchspam_at_wherever.com)
Date: 02/21/05


Date: Mon, 21 Feb 2005 13:03:15 -0500

Yes! I think we are on the same page now. I agree with you that I need to
ascertain why the problem is happening. Since I can't be physically present
when the black image occures and since I can't reproduce the problem on my
own Win98 machine my plan is to create a log file on these remote machines
which I will later be able to examine. The most important event to log is
the occurance of this blank image condition and in order to do that, I must
be able to tell when the image control is in this black state. I will try to
use GetDIBits() to test each image for some non-black pixels.

The JPEG images are all good; I supply them along with the app.

Thanks a lot for your help. Your GDI test is pretty cool too.

"Mike D Sutton" <EDais@mvps.org> wrote in message
news:e2yqvvDGFHA.1084@tk2msftngp13.phx.gbl...
>> Thanks for the help. I think I did a poor job of explaining what I want,
>> though. I don't have a problem with changing the image size.
>>
>> My app (running on old, remote Win98 client machines) steps through
>> numerous
>> different jpg files and passes them to the image control for display. The
>> images are of various sizes and color depths. Sometimes when the display
>> is
>> about to be changed, the control resizes its borders correctly for the
>> new
>> image, but it displays nothing but black within those borders.
>>
>> I want my app to be able to 'know' when the correct image is not being
>> displayed. I am looking for some way to use code to examine each image to
>> determine whether it is all black or not. I thought there might be some
>> way
>> to examine the image control's picture property?
>
> You can inspect the image's data using GetDIBits() however I think that's
> probably the wrong way to go about it if I'm
> understanding the question correctly this time. Instead I would attempt
> to ascertain _why_ this is happening, it's not
> something I've experienced before though so I don't know where to suggest
> you start looking. One thing though that may
> be the cause, especially if you're working with JPEG images which come
> from an unreliable source such as the internet,
> you may be dealing with broken images. In this case have a look at my
> SafeLoadImage() function in place of
> LoadPicture()
> You'll find the function linked from this thread, and also a fix for it's
> .GIF support near the bottom (of course if you
> don't care about GIF support then the original works as-is):
> http://groups.google.co.uk/groups?th=bf6eed1f95e0b921
> Hope this helps,
>
> Mike
>
>
> - Microsoft Visual Basic MVP -
> E-Mail: EDais@mvps.org
> WWW: http://EDais.mvps.org/
>
>



Relevant Pages

  • Re: display array in a frame wnd
    ... you have to create an app that is suitable for displaying an image. ... There would never be a need to create a frame window; it is not at all clear why such code ... I have to display results. ... Why is this not in an OnPaint handler? ...
    (microsoft.public.vc.mfc)
  • Re: visualizing image
    ... It sounds to me like you don't want a Web Service. ... "/images/image.jpg" and display it according to the HTML layout ... processes the image, or calls on another app to process the image, sets the ... >>>The generated image is a char*. ...
    (microsoft.public.dotnet.framework.aspnet.webservices)
  • Re: visualizing image
    ... It sounds to me like you don't want a Web Service. ... "/images/image.jpg" and display it according to the HTML layout ... processes the image, or calls on another app to process the image, sets the ... >>>The generated image is a char*. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: [not so] Sad Tale of Greed and Aspiration.
    ... Then I found that the MM app I was using didn't know wince 6.0. ... I received a note with a URL which provided access to the manual and the executables for the PNA version he is testing. ... It picked up the GPS immediately and displayed the sat count lat/lon/elevation when that display was selected. ... I like the idea of sound coding the touch menu - nifty touch! ...
    (rec.aviation.soaring)
  • Re: scrolled list of images?
    ... region with n number of 320x240 JPEG images, one on top of each other, ... to avoid memory gains. ... What you want to do is create 1 display image, use $image->clear, ... What you want is to paginate the thumbnails, so you only create say 10 ...
    (comp.lang.perl.tk)