Click here to Skip to main content
15,917,005 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: RGB to long Pin
Mike Dimmick22-Sep-03 2:51
Mike Dimmick22-Sep-03 2:51 
GeneralRe: RGB to long Pin
David Crow22-Sep-03 3:02
David Crow22-Sep-03 3:02 
GeneralRe: RGB to long Pin
JWood22-Sep-03 3:36
JWood22-Sep-03 3:36 
GeneralRe: RGB to long Pin
Abin22-Sep-03 15:39
Abin22-Sep-03 15:39 
GeneralDrawFrameControl question Pin
YaronNir22-Sep-03 2:10
YaronNir22-Sep-03 2:10 
GeneralSendMessage(VK_SHIFT????) Pin
doplay22-Sep-03 2:09
doplay22-Sep-03 2:09 
GeneralRe: SendMessage(VK_SHIFT????) Pin
Mike Dimmick22-Sep-03 2:55
Mike Dimmick22-Sep-03 2:55 
GeneralAdvice on skewed ::StretchBlt()-ed image Pin
Johann Gerell22-Sep-03 1:56
Johann Gerell22-Sep-03 1:56 
Hi!

I've created a HBITMAP from a Jpeg image (using Chris Losinger's JpegFile: http://www.smalleranimals.com/jpegfile.htm[^]).

When I ::BitBlt it the result is ok, but when I ::StrecthBlt it, the result is a skewed image.

Roughly, it looks like this:
+--------------------+
|\                   |
| \                  |
|  \                 |
|   \                |
|    \               |
+--------------------+
I'll try to explain what I see: It seems as each data line is longer than the specified image width, so that every line continues on the next, which results in a skewed image with a "diagonal" where the right edge should be. Understand?

Using JpegFile, I do this:

  1. Load the Jpeg file into a RGB buffer.
  2. Switch from RGB to BGR.
  3. Make the BGR buffer DWORD aligned.
  4. Create the HBITMAP with ::CreateBitmap(the DWORD aligned BGR buffer).

See anything crazy in that scheme? Any other ideas?

As I said ::BitBlt works with the HBITMAP, but ::StretchBlt doesn't.

Thanks for any input!

--
Human beings, who are almost unique in having the ability
to learn from the experience of others, are also remarkable
for their apparent disinclination to do so. (Douglas Adams)

GeneralRe: Advice on skewed ::StretchBlt()-ed image Pin
Chris Losinger22-Sep-03 2:00
professionalChris Losinger22-Sep-03 2:00 
GeneralSOLVED! Pin
Johann Gerell22-Sep-03 22:44
Johann Gerell22-Sep-03 22:44 
GeneralRe: Advice on skewed ::StretchBlt()-ed image Pin
JWood22-Sep-03 3:40
JWood22-Sep-03 3:40 
GeneralRe: Advice on skewed ::StretchBlt()-ed image Pin
JWood22-Sep-03 3:42
JWood22-Sep-03 3:42 
GeneralRe: Advice on skewed ::StretchBlt()-ed image Pin
Johann Gerell22-Sep-03 22:36
Johann Gerell22-Sep-03 22:36 
GeneralRe: Advice on skewed ::StretchBlt()-ed image Pin
Anonymous23-Sep-03 2:40
Anonymous23-Sep-03 2:40 
GeneralI got some strange behaviors. ( VS2003 vs VS6 ) Pin
Mathias S.22-Sep-03 1:54
Mathias S.22-Sep-03 1:54 
Generaluse PDF printer as the default printer Pin
harshsingh21-Sep-03 22:12
harshsingh21-Sep-03 22:12 
GeneralRe: use PDF printer as the default printer Pin
Dangleberry22-Sep-03 0:08
sussDangleberry22-Sep-03 0:08 
GeneralRe: use PDF printer as the default printer Pin
harshsingh22-Sep-03 2:08
harshsingh22-Sep-03 2:08 
GeneralRe: use PDF printer as the default printer (long) Pin
Roger Allen22-Sep-03 4:34
Roger Allen22-Sep-03 4:34 
Generaladf Pin
Anonymous21-Sep-03 21:52
Anonymous21-Sep-03 21:52 
GeneralRe: adf Pin
r i s h a b h s21-Sep-03 23:28
r i s h a b h s21-Sep-03 23:28 
GeneralRe: adf Pin
Dangleberry22-Sep-03 0:06
sussDangleberry22-Sep-03 0:06 
GeneralRe: adf Pin
David Crow22-Sep-03 2:43
David Crow22-Sep-03 2:43 
GeneralRe: adf Pin
Michael Dunn22-Sep-03 4:07
sitebuilderMichael Dunn22-Sep-03 4:07 
GeneralTutorials Help Pin
Neelesh K J Jain21-Sep-03 21:48
Neelesh K J Jain21-Sep-03 21:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.