Problem in Images display on dialog.
-
Hi, In my application I am having dialog .I am receiving images from mobile and I am displaying Images on dialog. I have added vertical scroll bar to dialog.I am creating 8 static controls programatically on dialog and I am using these 8 static controls for Image display. At a time I am displaying 8 Images on Dialog.I am using Scroll bar to display all Images. I have written following code in my "displayImage" function.for every scroll I am calling this function.
for(int i = 0; i < 8; i++)
{
//To get 4 Images for each row
if((i != 0)&&(i%4 == 0))
{
x1 = 1;
x2 = 250;
y1 = y1+355;
y2 = y2+355;
}//Static control creation for Image myStatic\[i\] = new CStatic(); myStatic\[i\]->Create(\_T(""),WS\_CHILD|WS\_VISIBLE|SS\_BITMAP,
CRect(x1,y1,x2,y2),this);
image.Load(Image);
HBITMAP hbmp = image.Detach();
if(hbmp == NULL)
{
Error = GetLastError();
}
if(hbmp != NULL)
myStatic[i]->SetBitmap(hbmp);
}First 8 Images are displaying Properly.After that If I scroll Scroll Bar dialog is showing first 8 Images first and It is displaying second 8 images.If I scroll third time it is showing first 16 images after that it is showing third 8 images and so on.Can anyone help me.
-
Hi, In my application I am having dialog .I am receiving images from mobile and I am displaying Images on dialog. I have added vertical scroll bar to dialog.I am creating 8 static controls programatically on dialog and I am using these 8 static controls for Image display. At a time I am displaying 8 Images on Dialog.I am using Scroll bar to display all Images. I have written following code in my "displayImage" function.for every scroll I am calling this function.
for(int i = 0; i < 8; i++)
{
//To get 4 Images for each row
if((i != 0)&&(i%4 == 0))
{
x1 = 1;
x2 = 250;
y1 = y1+355;
y2 = y2+355;
}//Static control creation for Image myStatic\[i\] = new CStatic(); myStatic\[i\]->Create(\_T(""),WS\_CHILD|WS\_VISIBLE|SS\_BITMAP,
CRect(x1,y1,x2,y2),this);
image.Load(Image);
HBITMAP hbmp = image.Detach();
if(hbmp == NULL)
{
Error = GetLastError();
}
if(hbmp != NULL)
myStatic[i]->SetBitmap(hbmp);
}First 8 Images are displaying Properly.After that If I scroll Scroll Bar dialog is showing first 8 Images first and It is displaying second 8 images.If I scroll third time it is showing first 16 images after that it is showing third 8 images and so on.Can anyone help me.
Probably your data structure is not getting cleared and still holds the images that you displayed earlier. Debug to check
You need to google first, if you have "It's urgent please" mentioned in your question. ;-)_AnShUmAn_
-
Probably your data structure is not getting cleared and still holds the images that you displayed earlier. Debug to check
You need to google first, if you have "It's urgent please" mentioned in your question. ;-)_AnShUmAn_
I am facing this issue since few days. I tried so many options but no use 1)I deleted myStatic[i] variables after using static controls. If I do that dialog is not showing any Images.here myStatic is local variable. 2) I declared member variables m_myStatic[8].No use.
-
I am facing this issue since few days. I tried so many options but no use 1)I deleted myStatic[i] variables after using static controls. If I do that dialog is not showing any Images.here myStatic is local variable. 2) I declared member variables m_myStatic[8].No use.
Of course you delete the static control variables. But where and how do you store the images that later on get displayed in these static controls. My previous question was whether you clear the data from the structure and not the static controls themselves.
You need to google first, if you have "It's urgent please" mentioned in your question. ;-)_AnShUmAn_
-
Of course you delete the static control variables. But where and how do you store the images that later on get displayed in these static controls. My previous question was whether you clear the data from the structure and not the static controls themselves.
You need to google first, if you have "It's urgent please" mentioned in your question. ;-)_AnShUmAn_