LoadImage Failure
-
Hi I have a bitmap file of a red bullet Originally I tried to display it using RichEdit Ole Interface I copied the code modified it somewhat from the "Q220844: HOWTO: Insert a Bitmap Into RTF Document Using RichEdit Control" I was able to display it however it didn't fit quite right So I decided to go with a native Win32 and display on Static control adjacent to the rich edit Thing is where the OleCreateFromFile worked the LoadImage API fails GetLastError return a zero as well using File Explorer I can see the red bullet Thnaks
-
Hi I have a bitmap file of a red bullet Originally I tried to display it using RichEdit Ole Interface I copied the code modified it somewhat from the "Q220844: HOWTO: Insert a Bitmap Into RTF Document Using RichEdit Control" I was able to display it however it didn't fit quite right So I decided to go with a native Win32 and display on Static control adjacent to the rich edit Thing is where the OleCreateFromFile worked the LoadImage API fails GetLastError return a zero as well using File Explorer I can see the red bullet Thnaks
You aren't trying to load a jpg, gif or png are you .. loadimage does not support those it is strictly BMP and PCX. If you need those just use IPic and for that all you need is #include
In vino veritas
-
Hi I have a bitmap file of a red bullet Originally I tried to display it using RichEdit Ole Interface I copied the code modified it somewhat from the "Q220844: HOWTO: Insert a Bitmap Into RTF Document Using RichEdit Control" I was able to display it however it didn't fit quite right So I decided to go with a native Win32 and display on Static control adjacent to the rich edit Thing is where the OleCreateFromFile worked the LoadImage API fails GetLastError return a zero as well using File Explorer I can see the red bullet Thnaks
-
You aren't trying to load a jpg, gif or png are you .. loadimage does not support those it is strictly BMP and PCX. If you need those just use IPic and for that all you need is #include
In vino veritas
Are you referring to OLeLoadPicturefile BTW As I mentioned to Richard when I used the code example in the following article
Quote:
Q220844: HOWTO: Insert a Bitmap Into RTF Document Using RichEdit Control"
Even though I had a 1 in the first param of the SetSel the Red bullet didn't align itself right next the left border of the dialog box In file explorer the image looked fine. Opening up the image in Paintbrush I see a white rectangular border around the red bullet maybe that was part of the problem I loaded the image by doing a google search is if this is the problem is there a way from get this image (I am trying to get something like the visual studio Breakpoint) Thanks
-
Are you referring to OLeLoadPicturefile BTW As I mentioned to Richard when I used the code example in the following article
Quote:
Q220844: HOWTO: Insert a Bitmap Into RTF Document Using RichEdit Control"
Even though I had a 1 in the first param of the SetSel the Red bullet didn't align itself right next the left border of the dialog box In file explorer the image looked fine. Opening up the image in Paintbrush I see a white rectangular border around the red bullet maybe that was part of the problem I loaded the image by doing a google search is if this is the problem is there a way from get this image (I am trying to get something like the visual studio Breakpoint) Thanks
So much confusion and misunderstandings to know where to start. Lets start with SetSel misunderstanding which starts at 0 NOT 1 it is a zero-based index. Very important is the file type you didn't say what the file was look at the last 3 letters of the filename is it BMP, GIF, JPG or PNG? Yes if you have a white border the white border will be on the image UNLESS it is a transparent image which needs a special header and depends on file format (so again we need the file format). You said you change the code over to LoadImage and I warned you that you can only load files that are of BMP and PCX type. That is files that end with those 3 letters and have a proper matching header. If you try to load a wrong type it does pretty much what you describe returns NULL with a GetLastError of 0 because it can find the file but it's just junk it can't understand. So can we at least get a filetype to start with so we know what we are dealing with, so 3 letter filename extension please. If you can't see them on windows go up to view settings and tick the box that says file name extensions.
In vino veritas
-
So much confusion and misunderstandings to know where to start. Lets start with SetSel misunderstanding which starts at 0 NOT 1 it is a zero-based index. Very important is the file type you didn't say what the file was look at the last 3 letters of the filename is it BMP, GIF, JPG or PNG? Yes if you have a white border the white border will be on the image UNLESS it is a transparent image which needs a special header and depends on file format (so again we need the file format). You said you change the code over to LoadImage and I warned you that you can only load files that are of BMP and PCX type. That is files that end with those 3 letters and have a proper matching header. If you try to load a wrong type it does pretty much what you describe returns NULL with a GetLastError of 0 because it can find the file but it's just junk it can't understand. So can we at least get a filetype to start with so we know what we are dealing with, so 3 letter filename extension please. If you can't see them on windows go up to view settings and tick the box that says file name extensions.
In vino veritas
I understand that LoadImage wont work, Let me ask the following if I use LineIndex(-1) then I am returned the char index on the line and its I ASSUME it is the first char index in that line that has the caret Afterwards if I do GetCharPos using that value I get the x,y coordinates in pixels of that char so I would like to place my bullet there and x = 1 that it should lie all the way to the left of the rich edit control and yet its off (about 1/8 of inch) my only guess is when I display the bullet in paintbrush there is white rectangle around it and that is what is pushing it off. what do you think if this true would you know how I would go about getting a red bullet bmp/png like the breakpoint in Visual studio Debugger Thanks
-
I understand that LoadImage wont work, Let me ask the following if I use LineIndex(-1) then I am returned the char index on the line and its I ASSUME it is the first char index in that line that has the caret Afterwards if I do GetCharPos using that value I get the x,y coordinates in pixels of that char so I would like to place my bullet there and x = 1 that it should lie all the way to the left of the rich edit control and yet its off (about 1/8 of inch) my only guess is when I display the bullet in paintbrush there is white rectangle around it and that is what is pushing it off. what do you think if this true would you know how I would go about getting a red bullet bmp/png like the breakpoint in Visual studio Debugger Thanks
Well techinically it is x = 0 but there is nothing stopping you simply entering a negative x co-ordinate of a few pixels to allow for your white border. The richedit like all windows knows how to clip :-)
In vino veritas