I am trying to draw a bitmap on the screen 1" X 1.5" using this code:
The image draws correctly but draws to 1.3"X2"Code:status = GdipDrawImageRectRect(graphics, image, _
0, 0, 1, 1.5 , _
0, 0, 192, 288, _
UnitPixel)
What am I doing wrong?
Printable View
I am trying to draw a bitmap on the screen 1" X 1.5" using this code:
The image draws correctly but draws to 1.3"X2"Code:status = GdipDrawImageRectRect(graphics, image, _
0, 0, 1, 1.5 , _
0, 0, 192, 288, _
UnitPixel)
What am I doing wrong?
Maybe try specifying UnitInch instead of 'UnitPixel'?
Viggy
Thanks for the suggestion.
I tried that; I get an error when GdipDrawImageRectRect executes
(and obviously nothing gets drawn).
I'm not all that familiar with the GDI+ functions (anymore, it's been a while since I played around with them). Post the error, perhaps someone else can help.
Viggy
If I set the last parameter of the GdipDrawImageRectRect function to UnitInch I get a Not Implemented error
If I do as below I get proper drawing except not to the specified dimension (want 1" X 1.5" get 1.3" X 2").
It is always out by a constant factor.Code:status = GdipSetPageUnit(graphics, UnitInch)
status = GdipDrawImageRectRect(graphics, image, _
0, 0 1, 1.5, _
0, 0, 192, 288, _
UnitPixel)
If I adjust to accomodate for this by multiplying by 72 / 96 as below it works properly.
...but I don't understand the significance of * 72 / 96Code:status = GdipSetPageUnit(graphics, UnitInch)
status = GdipDrawImageRectRect(graphics, image, _
0, 0, 1 * 72 / 96, 1.5 * 72 / 96, _
0, 0, 192, 288, _
UnitPixel)