-
Sep 27th, 2005, 02:44 AM
#1
Thread Starter
Lively Member
[RESOLVED] Resize Image With Compact Framework
I am trying to resize an image in a program that runs on a pocket PC.
this doesn't work in the compact framework:
dim ReBMP as NEW bitmap (OrigBMP, width, height)
Anyone know how I can do this?
-
Sep 27th, 2005, 06:52 AM
#2
Addicted Member
Re: Resize Image With Compact Framework
Where is this image being displayed for you to test?
Stupid question, but you haven't got autosize on a picture box have you?
Look into the heart of infinity and find your truth
Colonel Tom Edwards: This is the most fantastic story I've ever heard
Jeff Trent: And every word of it's true, too
Colonel Tom Edwards: That's the fantastic part of it
ROFL
-
Sep 27th, 2005, 06:56 AM
#3
Thread Starter
Lively Member
Re: Resize Image With Compact Framework
the picturebox has stretch or centre. what I need is a 100*100 image displayed as a 200*200 picturebox.image.
-
Sep 27th, 2005, 08:11 AM
#4
Re: Resize Image With Compact Framework
what do you mean it doesnt work ? you mean it doesnt build?
Regards
Jorge
"The dark side clouds everything. Impossible to see the future is."
-
Sep 27th, 2005, 08:20 AM
#5
Fanatic Member
Re: Resize Image With Compact Framework
Please give the specific error
"so just keep in mind that fantasy is not the same as realtiy and make sure u remember that wii sports may be fun but u cant count on it as exercise ok cool bye" - HungarianHuman
-
Sep 27th, 2005, 09:29 AM
#6
Thread Starter
Lively Member
Re: Resize Image With Compact Framework
Overload resolution failed because no accessible 'New' accepts this number of arguments.
As far as I can tell this is supported on the normal framework but not on the compact framework. I did look at the possible parameter combinations for a new bitmap but none were suitable.
-
Sep 27th, 2005, 09:35 AM
#7
Re: Resize Image With Compact Framework
And how about using Image.GetThumbnailImage ?
Regards
Jorge
"The dark side clouds everything. Impossible to see the future is."
-
Sep 27th, 2005, 09:48 AM
#8
Thread Starter
Lively Member
Re: Resize Image With Compact Framework
guess what; Image.GetThumbnailImage doesn't appear to be
supported on the compact framework.
-
Sep 27th, 2005, 09:50 AM
#9
Fanatic Member
Re: Resize Image With Compact Framework
Well you can always create a new bitmap with the desired size, then create a Graphics object from it to draw the image on it.
"so just keep in mind that fantasy is not the same as realtiy and make sure u remember that wii sports may be fun but u cant count on it as exercise ok cool bye" - HungarianHuman
-
Sep 27th, 2005, 09:56 AM
#10
Thread Starter
Lively Member
Re: Resize Image With Compact Framework
the graphic.drawimage looks like it could be a winner. I don't suppose you have an example of how to code this?
-
Sep 27th, 2005, 09:59 AM
#11
Fanatic Member
Re: Resize Image With Compact Framework
As it happens I was just jotting it up
VB Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim origimage As Image = Image.FromFile("someimageondisk")
Dim bmp As New Bitmap(100, 100)
Dim gr As Graphics = Graphics.FromImage(bmp)
gr.DrawImage(origimage, 0, 0, 100, 100)
Me.BackgroundImage = bmp
End Sub
edit: don't know if it works compact though.
Last edited by grilkip; Sep 27th, 2005 at 10:05 AM.
"so just keep in mind that fantasy is not the same as realtiy and make sure u remember that wii sports may be fun but u cant count on it as exercise ok cool bye" - HungarianHuman
-
Sep 27th, 2005, 10:19 AM
#12
Thread Starter
Lively Member
Re: Resize Image With Compact Framework
Thanks a lot. It looks like its going to work (no compilation errors but I need to spend a bit of time incorperation it into the rest of the code).
I will mark this as resolved and raise it again if I have a specific problem.
Thanks again to all.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|